SATA hotplug and AHCI

Andrey V. Elsukov bu7cher at yandex.ru
Tue Dec 30 05:45:41 UTC 2008


David Ehrmann wrote:
> http://pastebin.com/f5ab2ed28
> 
> dmesg.boot never changes.  When I remove the drive, I see this from dmesg:
> 
> ata4: DISCONNECT requested
> subdisk8: detached
> ad8: detached
> ata4: DISCONNECTED
> 
> And when I plug it back in,
> 
> ata4: CONNECT requested
> ata4: DISCONNECTED
> ata4: CONNECTED
> ata4: SATA connect time=0ms
> ata4: SIGNATURE: 0000000c
> ata4: No signature, asuming disk device
> ata4: ahci_reset devices=0x1<ATA_MASTER>
> ata4: reiniting channel ..
> ata4: SATA connect time=0ms
> ata4: SIGNATURE: 0000000c
> ata4: No signature, asuming disk device
> ata4: ahci_reset devices=0x1<ATA_MASTER>
> ata4: reinit done ..
> ata4: reiniting channel ..
> ata4: SATA connect time=0ms
> ata4: SIGNATURE: 0000000c
> ata4: No signature, asuming disk device
> ata4: ahci_reset devices=0x1<ATA_MASTER>
> ata4: reinit done ..

There were several similar reports. AHCI driver can't read correct
device signature after hard reset and can't detect attached device.
This issue was fixed with hack which you can see in this output:

 > ata4: SIGNATURE: 0000000c
 > ata4: No signature, asuming disk device
 > ata4: ahci_reset devices=0x1<ATA_MASTER>

Linux's libata driver has a quirk for VIA AHCI:

/* vt8251 doesn't clear BSY on signature FIS reception,
  * request follow-up softreset.
  */

If i right understand it issues softreset for VIA controllers just
after hardreset. And after softreset it is trying to read device signature.

FreeBSD CURRENT has similar code, but it is disabled by default.
You can try install CURRENT and rebuild ata_ahci driver with AHCI_PM option.
May be it will help..

-- 
WBR, Andrey V. Elsukov


More information about the freebsd-stable mailing list