[ltp] Re: udev hotswap events broken for bay in 2.6.24?

Marc MERLIN linux-thinkpad@linux-thinkpad.org
Fri, 9 May 2008 08:42:16 -0700


So, as shown below, I had it working until I upgraded to a newer kernel and
distro (2.6.24 / ubuntu hardy), and how I don't get a hotswap event anymore:
gandalf:/etc/acpi# udevmonitor 
udevmonitor will print the received events for:
UDEV the event which udev sends out after rule processing
UEVENT the kernel uevent

> UEVENT[1210347383.288270] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
> UDEV  [1210347383.289551] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
^^^ I get this when I pull the latch, but no more 'change   /devices/platform/bay.0'

if I put the latch right back vvvv
> UEVENT[1210347396.860131] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
> UDEV  [1210347396.861383] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
> May  9 08:36:36 gandalf kernel: ata5: exception Emask 0x10 SAct 0x0 SErr 0x0 action 0xa frozen
> May  9 08:36:36 gandalf kernel: ata5: ACPI event
> May  9 08:36:36 gandalf kernel: ata5: soft resetting link
> May  9 08:36:37 gandalf kernel: ata5.00: configured for UDMA/100
> May  9 08:36:37 gandalf kernel: ata5: EH complete
> May  9 08:36:37 gandalf kernel: sd 4:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
> May  9 08:36:37 gandalf kernel: sd 4:0:0:0: [sdb] Write Protect is off
> May  9 08:36:37 gandalf kernel: sd 4:0:0:0: [sdb] Mode Sense: 00 3a 00 00
> May  9 08:36:37 gandalf kernel: sd 4:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

gandalf:~# lsmod | grep bay
bay                     7040  0 
dock                   11412  1 bay

gandalf:~# cat /var/log/dmesg | grep bay
thinkpad_acpi: another device driver is already handling bay events
thinkpad_acpi: disabling subdriver bay

Any ideas?

Thanks,
Marc

On Fri, Feb 01, 2008 at 02:16:27PM +1100, Marc MERLIN wrote:
> On Thu, Jan 31, 2008 at 11:26:45PM -0200, Henrique de Moraes Holschuh wrote:
> > On Thu, 31 Jan 2008, Henrique de Moraes Holschuh wrote:
> > > > I had a similar problem with 2.6.23 and thinkpad_acpi before I loaded 
> > > > thinkpad_acpi before most other modules (including libata). Is it possible 
> > > > that libata, which now has been extended to make use of ACPI, causes this?
> > > 
> > > Sounds very strange, it shouldn't.
> > 
> > I stand corrected.  I guess that's it.  We may have finally hit a case where
> > the linux ACPI model of only one "notify handler"/driver per node fails, and
> > fails so bad it is not funny.
> > 
> > But better to be sure about it first.  Here's how to test it for people with
> > the new libata ACPI support:
> > 
> > Please boot the kernel with "libata.noacpi=1".  If either bay or
> > thinkpad-acpi bay handling starts working *for disks insterted in the
> > ultrabay, NOT for batteries*, then we have pinpointed the problem.
> 
> Sure enough, it worked:
> 
> > 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
> > 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:~# uname -r
> > 2.6.24-slab-tpacpi0.19-p4core2smp-preempt-1khz-noticks-marc8
> > gandalf:~# cat /proc/cmdline 
> > resume=/dev/sda8 ro nosplash vga=1 acpi_sleep=s3_bios root=/dev/sda2 libata.noacpi=1
> > gandalf:~# cat /proc/acpi/ibm/bay      
> > status:         occupied
> > commands:       eject
> > gandalf:~# rmmod thinkpad_acpi
> > gandalf:~# modprobe bay
> > ACPI: \_SB_.PCI0.IDE0.PRIM.MSTR: found ejectable bay
> > ACPI: \_SB_.PCI0.IDE0.PRIM.MSTR: Adding notify handler
> > ACPI: Bay [\_SB_.PCI0.IDE0.PRIM.MSTR] Added
> 
> Then, I tried to eject my bay:
> gandalf:~# udevmonitor
> udevmonitor will print the received events for:
> UDEV the event which udev sends out after rule processing
> UEVENT the kernel uevent
> 
> UEVENT[1201835705.008037] change   /devices/platform/bay.0 (platform)
> UDEV  [1201835705.009688] change   /devices/platform/bay.0 (platform)
> Feb  1 14:15:05 gandalf kernel: ACPI: \_SB_.PCI0.IDE0.PRIM.MSTR: Bay event
> UEVENT[1201835705.547646] remove   /class/scsi_generic/sg1 (scsi_generic)
> UEVENT[1201835705.547682] remove   /class/scsi_device/4:0:0:0 (scsi_device)
> UEVENT[1201835705.548041] remove   /class/scsi_disk/4:0:0:0 (scsi_disk)
> UEVENT[1201835705.548063] remove   /block/sdb/sdb1 (block)
> UEVENT[1201835705.548078] remove   /block/sdb (block)
> UDEV  [1201835705.550048] remove   /class/scsi_generic/sg1 (scsi_generic)
> UDEV  [1201835705.552639] remove   /class/scsi_device/4:0:0:0 (scsi_device)
> UDEV  [1201835705.553772] remove   /class/scsi_disk/4:0:0:0 (scsi_disk)
> UDEV  [1201835705.556085] remove   /block/sdb/sdb1 (block)
> UDEV  [1201835705.557985] remove   /block/sdb (block)
> kernel: sd 4:0:0:0: [sdb] Synchronizing SCSI cache
> kernel: sd 4:0:0:0: [sdb] Stopping disk
> UEVENT[1201835707.602057] remove   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
> UDEV  [1201835707.603319] remove   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
> kernel: ata5.00: disabled
> kernel: ACPI: \_SB_.PCI0.IDE0.PRIM.MSTR: Ejecting device
> 
> Success! 
> 
> 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/

-- 
"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/