diff mbox

Hotplug borked after suspend/resume in Linux-3.3 ?

Message ID 4F8EF9F7.5040202@pobox.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Jeff Garzik April 18, 2012, 5:29 p.m. UTC
On 04/18/2012 01:10 PM, Martin Mokrejs wrote:
> Fix: I got my 3TB disk detected by this single command:
>
> # echo on>   /sys/devices/pci0000:00/0000:00:1f.2/ata6/power/control
> #
>
> This is a Dell Vostro 3550 with A09 BIOS. Same happend with 3.4-rc3 kernel.
>
> I can do some more testing if you want me to.
> Best,
> Martin


Can you test this one-line patch from Lin Ming?  Hopefully there is zero 
sysfs twiddling required with this one...



--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Martin Mokrejs April 18, 2012, 5:44 p.m. UTC | #1
Jeff Garzik wrote:
> On 04/18/2012 01:10 PM, Martin Mokrejs wrote:
>> Fix: I got my 3TB disk detected by this single command:
>>
>> # echo on>   /sys/devices/pci0000:00/0000:00:1f.2/ata6/power/control
>> #
>>
>> This is a Dell Vostro 3550 with A09 BIOS. Same happend with 3.4-rc3 kernel.
>>
>> I can do some more testing if you want me to.
>> Best,
>> Martin
> 
> 
> Can you test this one-line patch from Lin Ming?  Hopefully there is zero sysfs twiddling required with this one...
> 
> --- a/drivers/ata/libata-transport.c
> +++ b/drivers/ata/libata-transport.c
> @@ -294,6 +294,7 @@ int ata_tport_add(struct device *parent,
>      device_enable_async_suspend(dev);
>      pm_runtime_set_active(dev);
>      pm_runtime_enable(dev);
> +    pm_runtime_forbid(dev);
> 
>      transport_add_device(dev);
>      transport_configure_device(dev);

Works! (the src tree has some pcieh patches so can re-test in a while on vanilla kernel
sources if you want me to confirm that). Just too many patches to try. ;-)

[cut]
[   19.629276] EXT3-fs (sda5): using internal journal
[   19.894238] Adding 4998972k swap on /dev/sda6.  Priority:-1 extents:1 across:4998972k 
[   25.615229] r8169 0000:05:00.0: eth0: unable to load firmware patch rtl_nic/rtl8168e-2.fw (-2)
[   25.638382] r8169 0000:05:00.0: eth0: link down
[   25.638413] r8169 0000:05:00.0: eth0: link down
[   27.396716] r8169 0000:05:00.0: eth0: link up
[   31.405068] microcode: CPU0 updated to revision 0x25, date = 2011-10-11
[   31.405417] microcode: CPU1 updated to revision 0x25, date = 2011-10-11
[   31.405747] microcode: CPU2 updated to revision 0x25, date = 2011-10-11
[   31.406086] microcode: CPU3 updated to revision 0x25, date = 2011-10-11
[   31.566473] [drm] Changing LVDS panel from (+hsync, -vsync) to (-hsync, -vsync)
[   33.296080] r8169 0000:05:00.0: eth0: link down
[   35.674572] r8169 0000:05:00.0: eth0: link up
[   41.896276] ata6: exception Emask 0x10 SAct 0x0 SErr 0x4050000 action 0xe frozen
[   41.896285] ata6: irq_stat 0x00400040, connection status changed
[   41.896293] ata6: SError: { PHYRdyChg CommWake DevExch }
[   41.896313] ata6: hard resetting link
[   42.639279] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[   42.681085] ata6.00: ATA-8: WDC WD10TPVT-00HT5T0, 01.01A01, max UDMA/133
[   42.681096] ata6.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA
[   42.686541] ata6.00: configured for UDMA/133
[   42.686560] ata6: EH complete
[   42.686706] scsi 5:0:0:0: Direct-Access     ATA      WDC WD10TPVT-00H 01.0 PQ: 0 ANSI: 5
[   42.686833] sd 5:0:0:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)
[   42.686959] sd 5:0:0:0: [sdc] Write Protect is off
[   42.686961] sd 5:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[   42.686992] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   42.687000] sd 5:0:0:0: Attached scsi generic sg3 type 0
[   42.696794]  sdc: sdc1
[   42.697115] sd 5:0:0:0: [sdc] Attached SCSI disk
[   56.259694] [drm] Changing LVDS panel from (-hsync, -vsync) to (+hsync, -vsync)
[   61.127682] ata1.00: configured for UDMA/133
[   61.127685] ata1: EH complete
[   61.277874] ata6.00: configured for UDMA/133
[   61.277878] ata6: EH complete
[   98.163139] ata6: exception Emask 0x10 SAct 0x0 SErr 0x4090000 action 0xe frozen
[   98.163148] ata6: irq_stat 0x00400040, connection status changed
[   98.163156] ata6: SError: { PHYRdyChg 10B8B DevExch }
[   98.163173] ata6: hard resetting link
[   98.905476] ata6: SATA link down (SStatus 0 SControl 300)
[  103.898017] ata6: hard resetting link
[  104.247521] ata6: SATA link down (SStatus 0 SControl 300)
[  104.247540] ata6: limiting SATA link speed to 1.5 Gbps
[  109.240197] ata6: hard resetting link
[  109.589549] ata6: SATA link down (SStatus 0 SControl 310)
[  109.589568] ata6.00: disabled
[  109.609519] ata6: EH complete
[  109.609543] ata6.00: detaching (SCSI 5:0:0:0)
[  109.610027] sd 5:0:0:0: [sdc] Synchronizing SCSI cache
[  109.610058] sd 5:0:0:0: [sdc]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[  109.610062] sd 5:0:0:0: [sdc] Stopping disk
[  109.610070] sd 5:0:0:0: [sdc] START_STOP FAILED
[  109.610072] sd 5:0:0:0: [sdc]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[  140.043217] ata6: exception Emask 0x10 SAct 0x0 SErr 0x4050002 action 0xe frozen
[  140.043226] ata6: irq_stat 0x00400040, connection status changed
[  140.043234] ata6: SError: { RecovComm PHYRdyChg CommWake DevExch }
[  140.043253] ata6: limiting SATA link speed to 1.5 Gbps
[  140.043261] ata6: hard resetting link
[  141.322298] ata6: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[  141.332583] ata6.00: ATA-8: ST3000DM001-9YN166, CC4C, max UDMA/133
[  141.332593] ata6.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA
[  141.333407] ata6.00: configured for UDMA/133
[  141.352233] ata6: EH complete
[  141.352384] scsi 5:0:0:0: Direct-Access     ATA      ST3000DM001-9YN1 CC4C PQ: 0 ANSI: 5
[  141.352518] sd 5:0:0:0: [sdc] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)
[  141.352521] sd 5:0:0:0: [sdc] 4096-byte physical blocks
[  141.352540] sd 5:0:0:0: Attached scsi generic sg3 type 0
[  141.352575] sd 5:0:0:0: [sdc] Write Protect is off
[  141.352578] sd 5:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[  141.352601] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  141.400394]  sdc: sdc1
[  141.400833] sd 5:0:0:0: [sdc] Attached SCSI disk

Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin Mokrejs April 18, 2012, 6:23 p.m. UTC | #2
Martin Mokrejs wrote:
> 
> 
> Jeff Garzik wrote:
>> On 04/18/2012 01:10 PM, Martin Mokrejs wrote:
>>> Fix: I got my 3TB disk detected by this single command:
>>>
>>> # echo on>   /sys/devices/pci0000:00/0000:00:1f.2/ata6/power/control
>>> #
>>>
>>> This is a Dell Vostro 3550 with A09 BIOS. Same happend with 3.4-rc3 kernel.
>>>
>>> I can do some more testing if you want me to.
>>> Best,
>>> Martin
>>
>>
>> Can you test this one-line patch from Lin Ming?  Hopefully there is zero sysfs twiddling required with this one...
>>
>> --- a/drivers/ata/libata-transport.c
>> +++ b/drivers/ata/libata-transport.c
>> @@ -294,6 +294,7 @@ int ata_tport_add(struct device *parent,
>>      device_enable_async_suspend(dev);
>>      pm_runtime_set_active(dev);
>>      pm_runtime_enable(dev);
>> +    pm_runtime_forbid(dev);
>>
>>      transport_add_device(dev);
>>      transport_configure_device(dev);
> 
> Works! (the src tree has some pcieh patches so can re-test in a while on vanilla kernel
> sources if you want me to confirm that). Just too many patches to try. ;-)

Just confirming that it fixed even plain 3.4-rc3 as well.

Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin Mokrejs April 18, 2012, 6:32 p.m. UTC | #3
Martin Mokrejs wrote:
> 
> 
> Jeff Garzik wrote:
>> On 04/18/2012 01:10 PM, Martin Mokrejs wrote:
>>> Fix: I got my 3TB disk detected by this single command:
>>>
>>> # echo on>   /sys/devices/pci0000:00/0000:00:1f.2/ata6/power/control
>>> #
>>>
>>> This is a Dell Vostro 3550 with A09 BIOS. Same happend with 3.4-rc3 kernel.
>>>
>>> I can do some more testing if you want me to.
>>> Best,
>>> Martin
>>
>>
>> Can you test this one-line patch from Lin Ming?  Hopefully there is zero sysfs twiddling required with this one...
>>
>> --- a/drivers/ata/libata-transport.c
>> +++ b/drivers/ata/libata-transport.c
>> @@ -294,6 +294,7 @@ int ata_tport_add(struct device *parent,
>>      device_enable_async_suspend(dev);
>>      pm_runtime_set_active(dev);
>>      pm_runtime_enable(dev);
>> +    pm_runtime_forbid(dev);
>>
>>      transport_add_device(dev);
>>      transport_configure_device(dev);


There is one more minor issue. I cannot get my disk re-dectected at 3Gbps. Here is when I plugged it in
for the very first time after bootup (plain 3.4-rc3 with the above one-line fix):

[  146.876489] ata6: exception Emask 0x10 SAct 0x0 SErr 0x4050000 action 0xe frozen
[  146.876499] ata6: irq_stat 0x00400040, connection status changed
[  146.876508] ata6: SError: { PHYRdyChg CommWake DevExch }
[  146.876527] ata6: hard resetting link
[  147.619956] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[  147.869349] ata6.00: ATA-8: ST3000DM001-9YN166, CC4C, max UDMA/133
[  147.869360] ata6.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA
[  147.870126] ata6.00: configured for UDMA/133
[  147.870131] ata6: EH complete
[  147.870220] scsi 5:0:0:0: Direct-Access     ATA      ST3000DM001-9YN1 CC4C PQ: 0 ANSI: 5
[  147.870391] sd 5:0:0:0: [sdc] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)
[  147.870393] sd 5:0:0:0: [sdc] 4096-byte physical blocks
[  147.870396] sd 5:0:0:0: Attached scsi generic sg3 type 0
[  147.870434] sd 5:0:0:0: [sdc] Write Protect is off
[  147.870436] sd 5:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[  147.870460] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  147.904848]  sdc: sdc1
[  147.905196] sd 5:0:0:0: [sdc] Attached SCSI disk


Here is what happens on re-plug of the device. It is a 3.5" drive and the line
[  617.838013] ata6: hard resetting link
happens too early. I can hear the drive is still spinning up, it can't be ready yet.
I think the delay should be increased.


[  617.837966] ata6: exception Emask 0x10 SAct 0x0 SErr 0x4050002 action 0xe frozen
[  617.837976] ata6: irq_stat 0x00400040, connection status changed
[  617.837984] ata6: SError: { RecovComm PHYRdyChg CommWake DevExch }
[  617.838004] ata6: limiting SATA link speed to 1.5 Gbps
[  617.838013] ata6: hard resetting link
[  623.610941] ata6: link is slow to respond, please be patient (ready=0)
[  627.864604] ata6: COMRESET failed (errno=-16)
[  627.864615] ata6: hard resetting link
[  629.931538] ata6: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[  629.932355] ata6.00: ATA-8: ST3000DM001-9YN166, CC4C, max UDMA/133
[  629.932365] ata6.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA
[  629.933170] ata6.00: configured for UDMA/133
[  629.951629] ata6: EH complete
[  629.951700] scsi 5:0:0:0: Direct-Access     ATA      ST3000DM001-9YN1 CC4C PQ: 0 ANSI: 5
[  629.951816] sd 5:0:0:0: [sdc] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)
[  629.951819] sd 5:0:0:0: [sdc] 4096-byte physical blocks
[  629.951842] sd 5:0:0:0: Attached scsi generic sg3 type 0
[  629.951875] sd 5:0:0:0: [sdc] Write Protect is off
[  629.951877] sd 5:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[  629.951901] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  629.995970]  sdc: sdc1
[  629.996359] sd 5:0:0:0: [sdc] Attached SCSI disk


Martin

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lin Ming April 19, 2012, 1:31 a.m. UTC | #4
On Thu, Apr 19, 2012 at 2:32 AM, Martin Mokrejs
<mmokrejs@fold.natur.cuni.cz> wrote:
> Martin Mokrejs wrote:
>>
>>
>> Jeff Garzik wrote:
>>> On 04/18/2012 01:10 PM, Martin Mokrejs wrote:
>>>> Fix: I got my 3TB disk detected by this single command:
>>>>
>>>> # echo on>   /sys/devices/pci0000:00/0000:00:1f.2/ata6/power/control
>>>> #
>>>>
>>>> This is a Dell Vostro 3550 with A09 BIOS. Same happend with 3.4-rc3 kernel.
>>>>
>>>> I can do some more testing if you want me to.
>>>> Best,
>>>> Martin
>>>
>>>
>>> Can you test this one-line patch from Lin Ming?  Hopefully there is zero sysfs twiddling required with this one...
>>>
>>> --- a/drivers/ata/libata-transport.c
>>> +++ b/drivers/ata/libata-transport.c
>>> @@ -294,6 +294,7 @@ int ata_tport_add(struct device *parent,
>>>      device_enable_async_suspend(dev);
>>>      pm_runtime_set_active(dev);
>>>      pm_runtime_enable(dev);
>>> +    pm_runtime_forbid(dev);
>>>
>>>      transport_add_device(dev);
>>>      transport_configure_device(dev);
>
>
> There is one more minor issue. I cannot get my disk re-dectected at 3Gbps. Here is when I plugged it in
> for the very first time after bootup (plain 3.4-rc3 with the above one-line fix):

Hi Martin,

I'm looking at this issue now.

Thanks for test and report.

Lin Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -294,6 +294,7 @@  int ata_tport_add(struct device *parent,
  	device_enable_async_suspend(dev);
  	pm_runtime_set_active(dev);
  	pm_runtime_enable(dev);
+	pm_runtime_forbid(dev);

  	transport_add_device(dev);
  	transport_configure_device(dev);