sata hotplug does'nt work on squeeze [regression from lenny]

Kernels & Hardware, configuring network, installing services

sata hotplug does'nt work on squeeze [regression from lenny]

Postby illwieckz » 2010-09-23 14:32

Previously with Lenny I was happily hot(un)pluging sata drives in my supermicro.
I'm testing Squeeze and I encounter a problem, perhaps a bug : sata hotpluging works fine on Lenny but does'nt work on Squeeze.

We know hardware allow hotplug : it works on Lenny.
We know software allow hotplug : it works on Lenny.
For information, on Lenny or Squeeze, usb mass-storage hotplug works. It could be usefull to know: for usb hotplug Squeeze provide all necessary to manage hotplug, from hardware interrupt to file system mounting.

extract from my lspci concerning my Sata controller :
Code: Select all
00:1f.2 SATA controller: Intel Corporation 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03)


The BIOS show three modes for SATA support: IDE, AHCI and Raid, i'm using AHCI mode on Lenny, under Squeeze I've tested the others and it does'nt change anything.

In the past I've experienced similar problems with Lenny, some Lenny systems handle hotplug, and other don't. 'dpkg -l' output diffs showed me the presence of smartmontools packages on Lenny where hotplug was working. So I've identified that Smart is needed for sata hotplug, I don't know why, but is verified by experience. Under lenny I need smartmontools.

Code: Select all
Debian   linux-image      smartmontools     sata-hotplug

Lenny    2.6.26-21lenny4  -                 -
Lenny    2.6.26-21lenny4  5.38-2+lenny1     Works
Lenny    2.6.26-22lenny1  -                 -
Lenny    2.6.26-22lenny1  5.38-2+lenny1     Works
Lenny    2.6.26-24        -                 -
Lenny    2.6.26-24        5.38-2+lenny1     Works
Lenny    2.6.26-24lenny1  -                 -
Lenny    2.6.26-24lenny1  5.38-2+lenny1     Works


On Lenny I've noticied the presence (or not) of smartd in /usr/sbin to be the thing which does hotplug works or not. I don't need to have start_smartd=yes on /etc/default/smartmontools, I don't need /etc/default/smartmontools, I can also remove /usr/sbin/smartctl, smartd don't have to be running, but smartd must be in /usr/sbin.

On Lenny:
Code: Select all
smartd-in-sbin-at-boot-time  smartd-in-sbin-at-hotplug-time  sata-hotplug

-                            -                               -
-                            Yes                             -
Yes                          Yes                             Works
Yes                          -                               Works


I don't know why smartd is needed for hotplug, it's undocumented. Manpages, readmes and other infos only speak about health monitoring.

For Squeeze, it's more complicated.
Without smartd, hotplug never works, we know it, but with smartd, hotplug sometimes works, most of the time does'nt work, it's unpredictable. After a reboot, it works, after another reboot, it doesn't works…

Code: Select all
Debian   linux-image      smartmontools     sata-hotplug

Squeeze  2.6.32-18        -                 -
Squeeze  2.6.32-18        5.39.1+svn3124-1  Sometime-works¹


¹Sometimes means very rarely !

I've noticed that smartmontools have libcap-ng0 as a new dependance on Squeeze,

Code: Select all
Debian   linux-image   smartmontools     libcap-ng0  sata-hotplug

Squeeze  2.6.32-18     -                 -           -
Squeeze  2.6.32-18     -                 0.6.4-1     -
Squeeze  2.6.32-18     5.39.1+svn3124-1  0.6.4-1     Sometime-works


Smartd is always the thing which do the difference.
Perhaps a collateral damages form a bug in libcap-ng0?

I've tested some frankeinstein experiments, installing Lenny kernel and Lenny Smartmontools under Squeeze, it does'nt change anything. Hotplug does'nt work anymore.

Code: Select all
Debian   linux-image      smartmontools     sata-hotplug

Squeeze  2.6.32-18        -                 -


Perhaps the bug is in Squeeze userland (and perhaps not in Squeeze libcap-ng0, because Lenny smartmontools does'nt need it and does'nt work on Squeeze). Like I've already shown the need of smartmontools (I can't explain why, it's a fact) perhaps there is another tool I doesn'nt know…

Code: Select all
Debian   linux-image       smartmontools     sata-hotplug

Squeeze  2.6.26+17+lenny1  5.38-2+lenny1     -


Also, I've tried to play with /sys !
Code: Select all
echo "- - -" >/sys/class/scsi_host/host3/scan

It could detect new drive hot plugged, but once.
I insert first drive, I manualy scan, first disk is discovered
I insert second drive, I manualy scan, second disk isn't discovered.

Also with /sys scan, it does'nt detected hotunplug.

I've saw a strange thing: In case of fail when trying to detect hotplug using the /sys way, the drive is detected at shutdown time. It's too late, I don't need to have my drive at shutdown time, but at run time!

Il also tried to install somes power-management related tools, in case of one of them was needed, I've installed laptop task (which provides well-sounding packages names like acpi-support, acpi, acpid, apmd, pm-utils…), it does'nt change anything.

To debug, I know:
Code: Select all
/var/log/syslog
/var/log/messages
/var/log/kern.log
dmesg
udevadm --debug monitor --kernel --udev --property


When hotplug works, I get verbose logs.
Under Lenny, during sata drive hot(un)plug I can read the following :

=== HotPlug ===
udevadm monitor :
Code: Select all
UEVENT[1282554575.789002] add      /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)
UEVENT[1282554575.789220] add      /class/scsi_disk/1:0:0:0 (scsi_disk)
UDEV  [1282554575.811741] add      /class/bdi/8:16 (bdi)
UEVENT[1282554575.811892] add      /block/sdb/sdb1 (block)
UEVENT[1282554575.812001] add      /block/sdb/sdb2 (block)
UEVENT[1282554575.812117] add      /class/bdi/8:16 (bdi)
UEVENT[1282554575.812616] add      /class/scsi_device/1:0:0:0 (scsi_device)
UEVENT[1282554575.812705] add      /class/bsg/1:0:0:0 (bsg)
UDEV  [1282554575.827441] add      /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)
UDEV  [1282554575.828592] add      /class/scsi_disk/1:0:0:0 (scsi_disk)
UDEV  [1282554575.833661] add      /class/bsg/1:0:0:0 (bsg)
UDEV  [1282554575.839596] add      /class/scsi_device/1:0:0:0 (scsi_device)
UDEV  [1282554575.928786] add      /block/sdb (block)
UDEV  [1282554575.973361] add      /block/sdb/sdb2 (block)
UDEV  [1282554576.002254] add      /block/sdb/sdb1 (block)

dmesg :
Code: Select all
[  237.071496] ata2: exception Emask 0x10 SAct 0x0 SErr 0x4050000 action 0xe frozen
[  237.071666] ata2: irq_stat 0x00400040, connection status changed
[  237.071810] ata2: SError: { PHYRdyChg CommWake DevExch }
[  237.071960] ata2: hard resetting link
[  242.834769] ata2: link is slow to respond, please be patient (ready=0)
[  244.906742] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[  244.909173] ata2.00: ATA-8: MAXTOR STM3500320AS, MX1A, max UDMA/133
[  244.909173] ata2.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[  244.936822] ata2.00: configured for UDMA/133
[  244.936968] ata2: EH complete
[  244.937223] scsi 1:0:0:0: Direct-Access     ATA      MAXTOR STM350032 MX1A PQ: 0 ANSI: 5
[  244.937529] sd 1:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
[  244.937692] sd 1:0:0:0: [sdb] Write Protect is off
[  244.937832] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[  244.937867] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  244.938105] sd 1:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
[  244.938267] sd 1:0:0:0: [sdb] Write Protect is off
[  244.938406] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[  244.938441] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  244.938505]  sdb: sdb1 sdb2
[  244.963229] sd 1:0:0:0: [sdb] Attached SCSI disk

=== HotUnPlug ===
udevadm monitor :
Code: Select all
UDEV  [1282554740.633724] remove   /class/bsg/1:0:0:0 (bsg)
UDEV  [1282554740.633796] remove   /class/scsi_device/1:0:0:0 (scsi_device)
UDEV  [1282554740.633824] remove   /class/scsi_disk/1:0:0:0 (scsi_disk)
UDEV  [1282554740.633848] remove   /class/bdi/8:16 (bdi)
UDEV  [1282554740.633868] remove   /block/sdb/sdb2 (block)
UDEV  [1282554740.633886] remove   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)
UDEV  [1282554740.633903] remove   /block/sdb/sdb1 (block)
UEVENT[1282554740.633921] remove   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)
UDEV  [1282554740.635766] remove   /block/sdb (block)

dmesg :
Code: Select all
[  397.907968] ata2: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen
[  397.908139] ata2: irq_stat 0x00400000, PHY RDY changed
[  397.908280] ata2: SError: { PHYRdyChg }
[  397.908427] ata2: hard resetting link
[  398.633045] ata2: SATA link down (SStatus 0 SControl 300)
[  398.633195] ata2: failed to recover some devices, retrying in 5 secs
[  403.639120] ata2: hard resetting link
[  403.959153] ata2: SATA link down (SStatus 0 SControl 300)
[  403.959305] ata2: failed to recover some devices, retrying in 5 secs
[  408.963251] ata2: hard resetting link
[  409.283723] ata2: SATA link down (SStatus 0 SControl 300)
[  409.283870] ata2.00: disabled
[  409.787746] ata2: EH complete
[  409.787904] ata2.00: detaching (SCSI 1:0:0:0)
[  409.788386] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[  409.790493] sd 1:0:0:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK
[  409.790777] sd 1:0:0:0: [sdb] Stopping disk
[  409.790927] sd 1:0:0:0: [sdb] START_STOP FAILED
[  409.791065] sd 1:0:0:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK


When hotplug does'nt work, I've nothing in logs, nowhere, I don't know what look for.

I play with 5 drives, I've tested different installs of Lenny and Squeeze on them with sames results.
Problem does'nt come from hard drive, nor sata controller, nor bios configuration, I think that it does'nt comes from hardware.
Problem comes from software, and is probably elsewhere than kernel and smartmontools. Perhaps it's about a thing I don't know (like previously the need of smartmontools), perhaps it's a bug and there is a cadaver in the next-stable wardrobe !

In bugs I've found bug 570821 which looks similar, but is'nt the same, the guy have something in dmesg, unlike me !
If it's a bug, I don't know where report it, udev, linux-image, smartd, other ?

(Sorry for my poor english speaking, french readers can find easier reading version on french forum).
illwieckz
 
Posts: 2
Joined: 2010-09-22 17:33

Re: sata hotplug does'nt work on squeeze [regression from lenny]

Postby illwieckz » 2010-09-29 16:11

The problem comes from modules, not from module loading, but from wich module is affected to sata management.
I've sames modules loded on Squeeze and on Lenny, and sames modules are loaded when hotplug works or not.

It's seems that the ICH6 sata controller can be managed with ide emulation mode, or with ahci. The linux kernel had two modules that can manage ICH6 sata controller, ata_piix (which can't handle hotplug) and ahci (which can handle obviously ahci, therefor hotplug).
La raison de mon problème est que le chipset ICH6 peut être géré soit en mode IDE, soit en mode SATA, nous l'avions déjà vu avec le BIOS, mais le problème là est de l'ordre du noyau. Sous linux il y a deux modules qui savent gérer le chipset ICH6, le module ata_piix, qui ne sait pas gérer l'hotplug, et le module ahci, qui comme son nom l'indique sait gérer tout ce que supporte l'AHCI, dont l'hotplug.

On Lenny or Squeeze I've sames lsmod outputs, ahci and ata_piix are both loaded. lspci -vv show the problem.

On Lenny :
Code: Select all
# lspci -vv -s 00:1f.2 | tee lspci-lenny
00:1f.2 SATA controller: Intel Corporation 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03) (prog-if 01 [AHCI 1.0])
   Subsystem: Super Micro Computer Inc Device 6280
   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Latency: 0
   Interrupt: pin B routed to IRQ 19
   Region 0: I/O ports at e900 [size=8]
   Region 1: I/O ports at ea00 [size=4]
   Region 2: I/O ports at eb00 [size=8]
   Region 3: I/O ports at ec00 [size=4]
   Region 4: I/O ports at ed00 [size=16]
   Region 5: Memory at d03c3000 (32-bit, non-prefetchable) [size=1K]
   Capabilities: [70] Power Management version 2
      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
      Status: D0 PME-Enable- DSel=0 DScale=0 PME-
   Kernel driver in use: ahci
   Kernel modules: ahci, ata_piix

On Squeeze :
Code: Select all
# lspci -vv -s 00:1f.2 | tee lspci-squeeze
00:1f.2 SATA controller: Intel Corporation 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03) (prog-if 01 [AHCI 1.0])
   Subsystem: Super Micro Computer Inc Device 6280
   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Latency: 0
   Interrupt: pin B routed to IRQ 19
   Region 0: I/O ports at e900 [size=8]
   Region 1: I/O ports at ea00 [size=4]
   Region 2: I/O ports at eb00 [size=8]
   Region 3: I/O ports at ec00 [size=4]
   Region 4: I/O ports at ed00 [size=16]
   Region 5: Memory at d03c3000 (32-bit, non-prefetchable) [size=1K]
   Capabilities: [70] Power Management version 2
      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
   Kernel driver in use: ata_piix

The diff is significant :
Code: Select all
# diff lspci-lenny lspci-squeeze
16,18c16,17
<       Status: D0 PME-Enable- DSel=0 DScale=0 PME-
<    Kernel driver in use: ahci
<    Kernel modules: ahci, ata_piix
---
>       Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>    Kernel driver in use: ata_piix

I've setup a Debian Squeeze on a usb key to manipulate hard-drive related modules without the risk of lose my rootfs.

By default I've both ata_piix and sata loaded
Code: Select all
# lsmod | grep ahci
ahci                   27246  0
libata                115721  3 ata_piix,ata_generic,ahci
# lsmod | grep ata_piix
ata_piix               17640  1
libata                115721  3 ata_piix,ata_generic,ahci

But as we saw it, lspci show that is the ata_piix module which is used
If I unload ata_piix and ahci modules, my sata controller becomes unmanaged.
Code: Select all
# modprobe -r ata_piix
# modprobe -r ahci
# lspci -vv -s 00:1f.2
00:1f.2 SATA controller: Intel Corporation 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03) (prog-if 01 [AHCI 1.0])
   Subsystem: Super Micro Computer Inc Device 6280
   Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Interrupt: pin B routed to IRQ 19
   Region 0: I/O ports at e900 [size=8]
   Region 1: I/O ports at ea00 [size=4]
   Region 2: I/O ports at eb00 [size=8]
   Region 3: I/O ports at ec00 [size=4]
   Region 4: I/O ports at ed00 [size=16]
   Region 5: Memory at d03c3000 (32-bit, non-prefetchable) [size=1K]
   Capabilities: [70] Power Management version 2
      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

If I load ata_piix before ahci module, it's ata_piix that manage my sata controller, and I have'nt hotplug support.
Code: Select all
# modprobe ata_piix
# lspci -vv -s 00:1f.2
00:1f.2 SATA controller: Intel Corporation 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03) (prog-if 01 [AHCI 1.0])
   Subsystem: Super Micro Computer Inc Device 6280
   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Latency: 0
   Interrupt: pin B routed to IRQ 19
   Region 0: I/O ports at e900 [size=8]
   Region 1: I/O ports at ea00 [size=4]
   Region 2: I/O ports at eb00 [size=8]
   Region 3: I/O ports at ec00 [size=4]
   Region 4: I/O ports at ed00 [size=16]
   Region 5: Memory at d03c3000 (32-bit, non-prefetchable) [size=1K]
   Capabilities: [70] Power Management version 2
      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
   Kernel driver in use: ata_piix
# modprobe ahci
# lspci -vv -s 00:1f.2
00:1f.2 SATA controller: Intel Corporation 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03) (prog-if 01 [AHCI 1.0])
   Subsystem: Super Micro Computer Inc Device 6280
   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Latency: 0
   Interrupt: pin B routed to IRQ 19
   Region 0: I/O ports at e900 [size=8]
   Region 1: I/O ports at ea00 [size=4]
   Region 2: I/O ports at eb00 [size=8]
   Region 3: I/O ports at ec00 [size=4]
   Region 4: I/O ports at ed00 [size=16]
   Region 5: Memory at d03c3000 (32-bit, non-prefetchable) [size=1K]
   Capabilities: [70] Power Management version 2
      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
   Kernel driver in use: ata_piix

If I unload ata_piix module, my controler becomes unmanaged, then if I reload ahci module, my controller is managed again, and I've hotplug support.
Code: Select all
# modprobe -r ata_piix
# lspci -vv -s 00:1f.2
00:1f.2 SATA controller: Intel Corporation 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03) (prog-if 01 [AHCI 1.0])
   Subsystem: Super Micro Computer Inc Device 6280
   Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Interrupt: pin B routed to IRQ 19
   Region 0: I/O ports at e900 [size=8]
   Region 1: I/O ports at ea00 [size=4]
   Region 2: I/O ports at eb00 [size=8]
   Region 3: I/O ports at ec00 [size=4]
   Region 4: I/O ports at ed00 [size=16]
   Region 5: Memory at d03c3000 (32-bit, non-prefetchable) [size=1K]
   Capabilities: [70] Power Management version 2
      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
# modprobe -r ahci
# modprobe ahci
# lspci -vv -s 00:1f.2
00:1f.2 SATA controller: Intel Corporation 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03) (prog-if 01 [AHCI 1.0])
   Subsystem: Super Micro Computer Inc Device 6280
   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Latency: 0
   Interrupt: pin B routed to IRQ 19
   Region 0: I/O ports at e900 [size=8]
   Region 1: I/O ports at ea00 [size=4]
   Region 2: I/O ports at eb00 [size=8]
   Region 3: I/O ports at ec00 [size=4]
   Region 4: I/O ports at ed00 [size=16]
   Region 5: Memory at d03c3000 (32-bit, non-prefetchable) [size=1K]
   Capabilities: [70] Power Management version 2
      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
   Kernel driver in use: ahci


Because the ata_piix module is'nt loaded, my IDE CD drive does'nt work, but if I load the ata_piix module, it is managed, but beacause the sata controller is already managed by ahci module, ata_piix does'nt attempt to manage my sata controller. In this case, ata_piix only manage IDE drives.
Code: Select all
# modprobe ata_piix
# lspci -vv -s 00:1f.2
00:1f.2 SATA controller: Intel Corporation 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03) (prog-if 01 [AHCI 1.0])
   Subsystem: Super Micro Computer Inc Device 6280
   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Latency: 0
   Interrupt: pin B routed to IRQ 19
   Region 0: I/O ports at e900 [size=8]
   Region 1: I/O ports at ea00 [size=4]
   Region 2: I/O ports at eb00 [size=8]
   Region 3: I/O ports at ec00 [size=4]
   Region 4: I/O ports at ed00 [size=16]
   Region 5: Memory at d03c3000 (32-bit, non-prefetchable) [size=1K]
   Capabilities: [70] Power Management version 2
      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
   Kernel driver in use: ahci

The ahci module is used for sata management, and ata_piix also works ! :smile:

I MUST load ahaci module BEFORE ata_piix module, if the load order is ata_piix before ahci, because ata_piix can manage the hardware, it takes control in place of ahci module, but with limited functionalities.

A dirty hack is to blacklist ata_piix, to have'nt it loded at boot time, then to load manualy or (dirtier) to load it with rc.local. With this dirty hack I'm sure that ata_piix module will be loaded after ahci module !

Here the behavour on Squeeze where ata_piix is blacklisted then loaded manually.
Code: Select all
# echo 'blacklist ata_piix' >> /etc/modprobe.d/blacklist.conf
# update-initramfs -k all -u
# reboot

We have only one SATA drive.
Code: Select all
# ls /dev/sd*
/dev/sda  /dev/sda1

IDE CD drive is'nt managed.
Code: Select all
# ls /dev/sr*
ls: cannot access /dev/sr*: No such file or directory

I hotplug a drive, it's successfully managed.
Code: Select all
# dmesg
[  168.135380] ata4: exception Emask 0x10 SAct 0x0 SErr 0x4050000 action 0xe frozen
[  168.135450] ata4: irq_stat 0x00400040, connection status changed
[  168.135500] ata4: SError: { PHYRdyChg CommWake DevExch }
[  168.135558] ata4: hard resetting link
[  173.896016] ata4: link is slow to respond, please be patient (ready=0)
[  176.080025] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[  176.097162] ata4.00: ATA-8: MAXTOR STM3500320AS, MX1A, max UDMA/133
[  176.097166] ata4.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[  176.099149] ata4.00: configured for UDMA/133
[  176.099159] ata4: EH complete
[  176.099280] scsi 3:0:0:0: Direct-Access     ATA      MAXTOR STM350032 MX1A PQ: 0 ANSI: 5
[  176.099832] sd 3:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[  176.099942] sd 3:0:0:0: [sdb] Write Protect is off
[  176.099949] sd 3:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[  176.099997] sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  176.100264]  sdb: sdb1
[  176.132414] sd 3:0:0:0: [sdb] Attached SCSI disk
# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sdb  /dev/sdb1
# sfdisk -s /dev/sdb
488386584
# sfdisk -l /dev/sdb
Disk /dev/sdb: 60801 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdb1   *      0+  60666   60667- 487307646   fd  Linux raid autodetect
/dev/sdb2          0       -       0          0    0  Empty
/dev/sdb3          0       -       0          0    0  Empty
/dev/sdb4          0       -       0          0    0  Empty

I load ata_piix module, my CD is managed
Code: Select all
# modprobe ata_piix
# dmesg
[  326.542856] ata_piix 0000:00:1f.1: version 2.13
[  326.542882] ata_piix 0000:00:1f.1: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[  326.542943] ata_piix 0000:00:1f.1: setting latency timer to 64
[  326.543051] scsi5 : ata_piix
[  326.543200] scsi6 : ata_piix
[  326.544470] ata5: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xf000 irq 14
[  326.544475] ata6: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0xf008 irq 15
[  326.711446] ata5.01: ATAPI: MATSHITADVD-ROM SR-8178, PZ16, max UDMA/66
[  326.711479] ata5.01: limited to UDMA/33 due to 40-wire cable
[  326.724304] ata5.01: configured for UDMA/33
[  326.727103] scsi 5:0:1:0: CD-ROM            MATSHITA DVD-ROM SR-8178  PZ16 PQ: 0 ANSI: 5
[  326.753876] sr0: scsi3-mmc drive: 24x/24x cd/rw xa/form2 cdda tray
[  326.753881] Uniform CD-ROM driver Revision: 3.20
[  326.754169] sr 5:0:1:0: Attached scsi CD-ROM sr0
[  326.785463] sd 4:0:0:0: Attached scsi generic sg0 type 0
[  326.786133] sd 3:0:0:0: Attached scsi generic sg1 type 0
[  326.786261] sr 5:0:1:0: Attached scsi generic sg2 type 5
# ls /dev/sr*
/dev/sr0
# mount /dev/sr0 /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
# ls /mnt/
autorun.inf  debian        dists  g2ldr      install       isolinux   pics  README.html      README.mirrors.txt  README.txt  tools
css        dedication.txt  doc    g2ldr.mbr  install.386  md5sum.txt   pool  README.mirrors.html  README.source       setup.exe   win32-loader.ini


Yes we have a serious bug in Squeeze ICH6 management !
When ata_piix module is loaded before ahci module hotplug does'nt work, but we can't know when ata_piix module will be loaded before ahci module, it seems depend on weather or candle burning :? .
Perhaps on Lenny we were lucky !

I've shown previously a dirty hack, but like I could blackilst a module, perhaps I could specify a loading priority ? It should be cleaner than put blacklisted module modprobe in rc.local !

Anyone know how to do it cleanly ?

To which package repport the bug ? linux-image, module-init-tool, other ?

It could be good if Squeeze can be released without this bug !

(I don't mark this thread resolved because I must know how specify module loading priority, and the most important thing, how to resolve this bug upstream, at least how to report this bug ! :?: )
illwieckz
 
Posts: 2
Joined: 2010-09-22 17:33

Re: sata hotplug does'nt work on squeeze [regression from le

Postby kolafa » 2011-08-15 12:13

I have similar problems, but automount works when the system (Debian/squeeze) is freshly rebooted, fails for the second time.
Mounting the same disk as USB works fine

Jiri
kolafa
 
Posts: 1
Joined: 2011-08-15 12:09


Return to System configuration

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable