[ltp] /proc/acpi/ibm/bay gone with ThinkPad ACPI Extras v0.19-20080107/2.6.24

Marc MERLIN linux-thinkpad@linux-thinkpad.org
Thu, 31 Jan 2008 10:52:00 +1100


On Wed, Jan 30, 2008 at 06:37:54PM -0200, Henrique de Moraes Holschuh wrote:
> > > > I am also slightly confused about the bay driver in 2.6.24:
> > kernel: ACPI: \_SB_.PCI0.IDE0.PRIM.MSTR: found ejectable bay
> > kernel: ACPI: \_SB_.PCI0.IDE0.PRIM.MSTR: Adding notify handler
> > kernel: ACPI: Error installing bay notify handler
> > kernel: ACPI: Bay [\_SB_.PCI0.IDE0.PRIM.MSTR] Added
> 
> Ah, those are from ACPI bay, not thinkpad-acpi.  Looks like ACPI bay in
> 2.6.24 is buggy.  Try to *boot* without loading thinkpad-acpi at all, and
> load bay.  If it works, we have a bug in the exit path of thinkpad-acpi.
> Otherwise, we have a bug in ACPI bay, in which case you need to file a bug
> in bugzilla.kernel.org (file the info in the bug report *without* ever
> loading thinkpad-acpi, just in case).
 
Ok, I just rebooted after moving out thinkpad-acpi:
ACPI: ACPI Dock Station Driver 
ACPI: \_SB_.PCI0.IDE0.PRIM.MSTR: found ejectable bay
ACPI: \_SB_.PCI0.IDE0.PRIM.MSTR: Adding notify handler
ACPI: Error installing bay notify handler
ACPI: Bay [\_SB_.PCI0.IDE0.PRIM.MSTR] Added

gandalf:~# lsmod | grep thinkpad
gandalf:~# lsmod | grep bay
bay                     7040  0 
dock                   11412  1 bay
gandalf:~# uname -r
2.6.24-slab-tpacpi0.19-p4core2smp-preempt-1khz-noticks-marc8

After that, indeed, releasing the eject hatch (without ejecting) doesn't generate
any acpi event, or anything I can see in either /var/log/syslog /var/log/acpid

> > Just to confirm, I could eject for 2.6.22.15 but not 2.6.24 (I get no
> > eject even in acpid, and no /proc/acpi/ibm/bay)
> 
> As long as ACPI bay is NOT loaded when you load your patched thinkpad-acpi,
> *AND* you have the "deprecated" /proc/acpi functionality at all
> (/proc/acpi/events exists), it *should work* in 2.6.24.
 
After the above, I unloaded bay, rename thinkpad_acpi back, and loaded it:
thinkpad_acpi: ThinkPad ACPI Extras v0.19-20080107
thinkpad_acpi: http://ibm-acpi.sf.net/
thinkpad_acpi: ThinkPad BIOS 7FETA4WW (2.22 ), EC 7FHT26WW-1.08
thinkpad_acpi: Lenovo ThinkPad Z61p
thinkpad_acpi: radio switch found; radios are enabled
thinkpad_acpi: standard ACPI backlight interface available, not loading native one...
input: ThinkPad Extra Buttons as /devices/virtual/input/input8

I have /proc/acpi/event (not events):
gandalf:/usr/src/linux# cat /proc/acpi/event 
ibm/hotkey HKEY 00000080 00001003
ibm/hotkey HKEY 00000080 00001002
ibm/hotkey HKEY 00000080 00001003

acpid still works fine, my events are seen, I just get no events when
I release the lever, and my system now hardlocks if I remove the drive
:(

If you meant /proc/acpi/events, I don't have that.
Which kernel config option do I need?
Right now, I have:
http://marc.merlins.org/tmp/config.gz

> If it doesn't, there is a bug in 2.6.24's thinkpad-acpi or ACPI layer, and
> I will try to track it down and fix it with your help.

I'll help as much as I can, but I'm going off the net in 18 hours
(friday afternoon Sydney time) for 2 weeks.

> The two drivers always fight over the bay, you need to chose one of the two.
> Thinkpad-acpi will just not load the bay functionality if it finds someone
> else using it.  I don't know what ACPI Bay will do if it can't get a
> particular bay node.
 
I think that might be the bug: the new thinkpad_acpi seems to think the
bay is taken, even though it's not:
gandalf:~# lsmod | grep bay
gandalf:~# lsmod | grep thinkpad
thinkpad_acpi          57728  0 
hwmon                   4228  1 thinkpad_acpi
backlight               6148  2 thinkpad_acpi,video
nvram                   9352  2 thinkpad_acpi
gandalf:~# cat /proc/acpi/ibm/bay
cat: /proc/acpi/ibm/bay: No such file or directory
gandalf:~# cat /proc/acpi/ibm/driver 
driver:         ThinkPad ACPI Extras
version:        0.19-20080107

Shouldn't thinkpad_acpi output some message at load time that says
whether it saw the bay or if it was busy?

> > Ok, so from what I understand, /proc/acpi/ibm/bay was meant to be removed from
> 
> It *is* meant to be removed in the *future*.  It has not been removed yet in
> any way.  But obviously it won't work if you tell ACPI to not export its
> deprecated /proc/acpi interface (as it needs /proc/acpi), so please check
> that you did compile in some of the deprecated ACPI stuff :-)
 
Looks like it's still there:
gandalf:~# ls /proc/acpi/  
ac_adapter  dsdt                 fadt  info            sleep wakeup
battery     embedded_controller  fan   power_resource  thermal_zone
button      event                ibm   processor       vide

> > thinkpad-acpi, but my problem is that I was relying on /proc/acpi/ibm/bay and
> > I'm currently out of luck because kernel CONFIG_ACPI_BAY doesn't work on my Z61p.
> > Correct?
> 
> No.  You are currently out of luck because of some bug, let's find it, and
> fix it.

Ok :)
(one bug on each side apparently :) )

> 
> > As for \_SB_.PCI0.IDE0.PRIM.MSTR, am I supposed to keep patching that in the kernel, 
> > or are things supposed to work without it for me, considering that my bay does seem
> > to be there according to:
> > kernel: ACPI: \_SB_.PCI0.IDE0.PRIM.MSTR: found ejectable bay
> 
> ACPI bay is supposed to simply work for you (although the way you get the
> event that signals that the bay lever was released is different).

I see, so the _SB_.PCI0.IDE0.PRIM.MSTR: patch for thinkpad_acpi was
required for the bay to work with that deprecated system, and you can't
really fix that without breaking older machines, so my only way forward
is getting the new acpi bay to work.

Let's see where we get with that then.

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/