Skip to contentSkip to conversation

ahci: fix boot/resume COMRESET failures

PATCH In review Brian Norris 7 participants 15 messages Feb 21, 2012 – Mar 13, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover ahci: fix boot/resume COMRESET failures

This series addresses regression problems with

commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
ahci: start engine only during soft/hard resets

Because the fix provided by the above commit caused COMRESET failures and 10 second boot-time/resume-time hangs for certain DVD drives, we need to make the fix conditional to certain devices/platforms. Add a flag for this.

Brian

v2: change flag name to AHCI_HFLAG_DELAY_ENGINE, write more detailed
comments

v1: flag named AHCI_HFLAG_STRICT_SPEC

Brian Norris (3):
ahci: add AHCI_HFLAG_DELAY_ENGINE host flag
ahci: move AHCI_HFLAGS() macro to ahci.h
ahci_platform: add STRICT_AHCI platform type

 drivers/ata/ahci.c          |    2 --
 drivers/ata/ahci.h          |    6 ++++++
 drivers/ata/ahci_platform.c |   11 +++++++++++
 drivers/ata/libahci.c       |    5 +++++
 4 files changed, 22 insertions(+), 2 deletions(-)
#1 lore raw

PATCH v2 1/3 ahci: add AHCI_HFLAG_DELAY_ENGINE host flag

The following commit was intended to fix problems with specific AHCI controller(s) that would become bricks if the AHCI specification was not followed strictly (that is, if ahci_start_engine() was called while the controller was in the wrong state):

commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
ahci: start engine only during soft/hard resets

However, some devices currently have issues with that fix, so we must implement a flag that delays the ahci_start_engine() call only for specific controllers.

This commit simply introduces the flag, without enabling it in any driver.

Note that even when AHCI_HFLAG_DELAY_ENGINE is not enabled, this patch does not constitue a full revert to commit 7faa33da; there is still a change in behavior to the ahci_port_suspend() failure path.

---
 drivers/ata/ahci.h    |    3 +++
 drivers/ata/libahci.c |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)
drivers/ata/ahci.h +3 -0
index b175000..feb127e 100644
@@ -210,6 +210,9 @@ enum {
 	AHCI_HFLAG_NO_SNTF		= (1 << 12), /* no sntf */
 	AHCI_HFLAG_NO_FPDMA_AA		= (1 << 13), /* no FPDMA AA */
 	AHCI_HFLAG_YES_FBS		= (1 << 14), /* force FBS cap on */
+	AHCI_HFLAG_DELAY_ENGINE		= (1 << 15), /* do not start engine on
+						        port start (wait until
+						        error-handling stage) */
 
 	/* ap->flags bits */
 
drivers/ata/libahci.c +5 -0
index a72bfd0..f9eaa82 100644
@@ -737,6 +737,7 @@ static void ahci_power_down(struct ata_port *ap)
 
 static void ahci_start_port(struct ata_port *ap)
 {
+	struct ahci_host_priv *hpriv = ap->host->private_data;
 	struct ahci_port_priv *pp = ap->private_data;
 	struct ata_link *link;
 	struct ahci_em_priv *emp;
@@ -746,6 +747,10 @@ static void ahci_start_port(struct ata_port *ap)
 	/* enable FIS reception */
 	ahci_start_fis_rx(ap);
 
+	/* enable DMA */
+	if (!(hpriv->flags & AHCI_HFLAG_DELAY_ENGINE))
+		ahci_start_engine(ap);
+
 	/* turn on LEDs */
 	if (ap->flags & ATA_FLAG_EM) {
 		ata_for_each_link(link, ap, EDGE) {
#2 lore raw

Re: [PATCH v2 1/3] ahci: add AHCI_HFLAG_DELAY_ENGINE host flag

Quoted 12 lines · Brian Norris

The following commit was intended to fix problems with specific AHCI controller(s) that would become bricks if the AHCI specification was not followed strictly (that is, if ahci_start_engine() was called while the controller was in the wrong state):

commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
ahci: start engine only during soft/hard resets

However, some devices currently have issues with that fix, so we must implement a flag that delays the ahci_start_engine() call only for specific controllers.

Quoted 7 lines

This commit simply introduces the flag, without enabling it in any driver.

Note that even when AHCI_HFLAG_DELAY_ENGINE is not enabled, this patch does not constitue a full revert to commit 7faa33da; there is still a change in behavior to the ahci_port_suspend() failure path.

applied 1-3

#3 lore raw

PATCH v2 2/3 ahci: move AHCI_HFLAGS() macro to ahci.h

In reply to Brian Norris

We will need this macro in both ahci.c and ahci_platform.c, so just move it to the header.

---
 drivers/ata/ahci.c |    2 --
 drivers/ata/ahci.h |    3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/ata/ahci.c +0 -2
index d07bf03..ddeb845 100644
@@ -103,8 +103,6 @@ static struct ata_port_operations ahci_p5wdh_ops = {
 	.hardreset		= ahci_p5wdh_hardreset,
 };
 
-#define AHCI_HFLAGS(flags)	.private_data	= (void *)(flags)
-
 static const struct ata_port_info ahci_port_info[] = {
 	/* by features */
 	[board_ahci] =
drivers/ata/ahci.h +3 -0
index feb127e..c2594dd 100644
@@ -195,6 +195,9 @@ enum {
 	PORT_FBS_EN		= (1 << 0), /* Enable FBS */
 
 	/* hpriv->flags bits */
+
+#define AHCI_HFLAGS(flags)		.private_data	= (void *)(flags)
+
 	AHCI_HFLAG_NO_NCQ		= (1 << 0),
 	AHCI_HFLAG_IGN_IRQ_IF_ERR	= (1 << 1), /* ignore IRQ_IF_ERR */
 	AHCI_HFLAG_IGN_SERR_INTERNAL	= (1 << 2), /* ignore SERR_INTERNAL */
#4 lore raw

PATCH v2 3/3 ahci_platform: add STRICT_AHCI platform type

In reply to Brian Norris

Some platforms need to make use of the AHCI_HFLAG_DELAY_ENGINE flag.

---
 drivers/ata/ahci_platform.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/ata/ahci_platform.c +11 -0
index 48be4e1..0c86c77 100644
@@ -26,6 +26,7 @@
 enum ahci_type {
 	AHCI,		/* standard platform ahci */
 	IMX53_AHCI,	/* ahci on i.mx53 */
+	STRICT_AHCI,	/* delayed DMA engine start */
 };
 
 static struct platform_device_id ahci_devtype[] = {
@@ -36,6 +37,9 @@ static struct platform_device_id ahci_devtype[] = {
 		.name = "imx53-ahci",
 		.driver_data = IMX53_AHCI,
 	}, {
+		.name = "strict-ahci",
+		.driver_data = STRICT_AHCI,
+	}, {
 		/* sentinel */
 	}
 };
@@ -56,6 +60,13 @@ static const struct ata_port_info ahci_port_info[] = {
 		.udma_mask	= ATA_UDMA6,
 		.port_ops	= &ahci_pmp_retry_srst_ops,
 	},
+	[STRICT_AHCI] = {
+		AHCI_HFLAGS	(AHCI_HFLAG_DELAY_ENGINE),
+		.flags		= AHCI_FLAG_COMMON,
+		.pio_mask	= ATA_PIO4,
+		.udma_mask	= ATA_UDMA6,
+		.port_ops	= &ahci_ops,
+	},
 };
 
 static struct scsi_host_template ahci_platform_sht = {
#5 lore raw
In reply to Brian Norris
Quoted 8 lines · Brian Norris

This series addresses regression problems with

commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
ahci: start engine only during soft/hard resets

Because the fix provided by the above commit caused COMRESET failures and 10 second boot-time/resume-time hangs for certain DVD drives, we need to make the fix conditional to certain devices/platforms. Add a flag for this.

I confirm that these patches without the previous fix also fixes the regression I have seen. Thanks.

Best wishes

Norbert
------------------------------------------------------------------------
Norbert Preining preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
SHIRMERS (pl.n.)
Tall young men who stand around smiling at weddings as if to suggest that they know they bride reather well.
--- Douglas Adams, The Meaning of Liff

#6 lore raw

Hi Jeff,

Quoted 6 lines · Norbert Preining
Quoted 5 lines · Brian Norris

This series addresses regression problems with

    commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
    ahci: start engine only during soft/hard resets

Quoted 6 lines
Quoted 3 lines

Because the fix provided by the above commit caused COMRESET failures and 10 second boot-time/resume-time hangs for certain DVD drives, we need to make the fix conditional to certain devices/platforms. Add a flag for this.

I confirm that these patches without the previous fix also fixes the regression I have seen. Thanks.

Shouldn't this patch series be sent mainline during the 3.3 cycle?

Brian

#7 lore raw
In reply to Brian Norris
Quoted 4 lines · Brian Norris

This series addresses regression problems with

   commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
   ahci: start engine only during soft/hard resets

I just spent the better part of last night tracking down the specific sources of the log entry I get when I disconnect my e-sata drive; once it disconnects, the port is dead until I reboot; no combination of anything I've been able to poke at in /sys or elsewhere gets it live again. This starts with 3.3rc1, and turns out to still work fine in 3.2.1. Any chance it's related?

3.3rc5, immediately after the unplug:

[359799.624284] ata5: exception Emask 0x50 SAct 0x0 SErr 0x4090800
action 0xe frozen
[359799.624293] ata5: irq_stat 0x00400040, connection status changed
[359799.624298] ata5: SError: { HostInt PHYRdyChg 10B8B DevExch }
[359799.624304] ata5: hard resetting link
[359800.348021] ata5: SATA link down (SStatus 0 SControl 300)
[359805.348019] ata5: hard resetting link
[359805.668015] ata5: SATA link down (SStatus 0 SControl 300)
[359805.668030] ata5: limiting SATA link speed to 1.5 Gbps
[359810.668014] ata5: hard resetting link
[359810.988027] ata5: SATA link down (SStatus 0 SControl 310)
[359810.988038] ata5.00: disabled
[359810.988052] ata5: EH complete
[359810.988062] ata5.00: detaching (SCSI 4:0:0:0)
[359810.989357] sd 4:0:0:0: [sde] Synchronizing SCSI cache
[359810.989403] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[359810.989410] sd 4:0:0:0: [sde] Stopping disk
[359810.989422] sd 4:0:0:0: [sde] START_STOP FAILED
[359810.989426] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET

driverbyte=DRIVER_OK

plug it back in, and nothing happens.

3.3rc4 + v2 of your patch series (because there's nothing better than finding a likely culprit after 8 hours reading unfamiliar code, and the first search result for its commit log has words "However, some devices currently have issues with that fix, so we must implement a flag that delays the ahci_start_engine() call only for specific controllers" along with a patch):

[  135.966542] netconsole: network logging started
[  136.043949] Fri Mar 2 06:09:41 CST 2012
[  164.204992] SysRq : Changing Loglevel
[  164.205008] Loglevel set to 9

unplug the esata cable

[  182.076415] ata5: exception Emask 0x50 SAct 0x0 SErr 0x4090800
action 0xe frozen
[  182.076429] ata5: irq_stat 0x00400040, connection status changed
[  182.076443] ata5: SError: { HostInt PHYRdyChg 10B8B DevExch }
[  182.076449] ata5: hard resetting link
[  182.800028] ata5: SATA link down (SStatus 0 SControl 300)
[  187.800020] ata5: hard resetting link
[  188.120032] ata5: SATA link down (SStatus 0 SControl 300)
[  188.120050] ata5: limiting SATA link speed to 1.5 Gbps
[  193.120021] ata5: hard resetting link
[  193.440046] ata5: SATA link down (SStatus 0 SControl 310)
[  193.440087] ata5.00: disabled
[  193.440106] ata5: EH complete
[  193.440127] ata5.00: detaching (SCSI 4:0:0:0)
[  193.441626] sd 4:0:0:0: [sde] Synchronizing SCSI cache
[  193.441726] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[  193.441734] sd 4:0:0:0: [sde] Stopping disk
[  193.441745] sd 4:0:0:0: [sde] START_STOP FAILED
[  193.441750] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET

driverbyte=DRIVER_OK

plug it back in, and nothing happens.

The same the same thing on 3.2.1 for comparison:

[   68.834142] netconsole: network logging started
[   76.551905] SysRq : Changing Loglevel
[   76.551917] Loglevel set to 9

unplug

[   87.530721] ata5: exception Emask 0x50 SAct 0x0 SErr 0x4090800
action 0xe frozen
[   87.530735] ata5: irq_stat 0x00400040, connection status changed
[   87.530739] ata5: SError: { HostInt PHYRdyChg 10B8B DevExch }
[   87.530748] ata5: hard resetting link
[   88.252038] ata5: SATA link down (SStatus 0 SControl 300)
[   93.252026] ata5: hard resetting link
[   93.576040] ata5: SATA link down (SStatus 0 SControl 300)
[   93.576069] ata5: limiting SATA link speed to 1.5 Gbps
[   98.576034] ata5: hard resetting link
[   98.896035] ata5: SATA link down (SStatus 0 SControl 310)
[   98.896052] ata5.00: disabled
[   98.896069] ata5: EH complete
[   98.896090] ata5.00: detaching (SCSI 4:0:0:0)
[   98.897565] sd 4:0:0:0: [sde] Synchronizing SCSI cache
[   98.898391] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[   98.898405] sd 4:0:0:0: [sde] Stopping disk
[   98.898417] sd 4:0:0:0: [sde] START_STOP FAILED
[   98.898421] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET

driverbyte=DRIVER_OK

and plug it back in...

[  111.783606] ata5: exception Emask 0x10 SAct 0x0 SErr 0x4040000
action 0xe frozen
[  111.783620] ata5: irq_stat 0x00000040, connection status changed
[  111.783625] ata5: SError: { CommWake DevExch }
[  111.783633] ata5: limiting SATA link speed to 1.5 Gbps
[  111.783638] ata5: hard resetting link
[  112.676058] ata5: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[  112.678304] ata5.00: ATA-8: WDC WD10EARS-00Y5B1, 80.00A80, max UDMA/133
[  112.678316] ata5.00: 1953525168 sectors, multi 16: LBA48 NCQ (depth
31/32), AA
[  112.679599] ata5.00: configured for UDMA/133
[  112.679635] ata5: EH complete
[  112.679763] scsi 4:0:0:0: Direct-Access     ATA      WDC
WD10EARS-00Y 80.0 PQ: 0 ANSI: 5
[  112.679933] sd 4:0:0:0: [sde] 1953525168 512-byte logical blocks:
(1.00 TB/931 GiB)
[  112.680107] sd 4:0:0:0: [sde] Write Protect is off
[  112.680112] sd 4:0:0:0: [sde] Mode Sense: 00 3a 00 00
[  112.680140] sd 4:0:0:0: [sde] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[  112.680804] sd 4:0:0:0: Attached scsi generic sg4 type 0
[  113.099967]  sde: unknown partition table
[  113.100259] sd 4:0:0:0: [sde] Attached SCSI disk

It lives! (and it works fine all the way back to 2.6.32, possibly earlier).

Now, the reason I'm picking on you is that git blame only has a handful of lines in libata-eh.c, and as near as I can figure, the only lines of code that changed in 3.3 that would seem to be able to cause this are the ones that your series is a quasi revert of. I don't have hard evidence yet (unless the logged messages are more damning than I think they are), but it does seem likely that, at the very least, you might have some idea what's going on :p

-- Carey

#8 lore raw
Quoted 7 lines · cwillu
Quoted 4 lines · Brian Norris

This series addresses regression problems with

   commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
   ahci: start engine only during soft/hard resets

Quoted 8 lines

I just spent the better part of last night tracking down the specific sources of the log entry I get when I disconnect my e-sata drive; once it disconnects, the port is dead until I reboot; no combination of anything I've been able to poke at in /sys or elsewhere gets it live again.  This starts with 3.3rc1, and turns out to still work fine in 3.2.1. Any chance it's related?

3.3rc5, immediately after the unplug:

Hi,

I tested on my machine and it's fixed by below patch.
http://marc.info/?l=linux-kernel&m=132996405028746&w=2

Would you please also try it?

Thanks,
Lin Ming

Quoted 135 lines
[359799.624284] ata5: exception Emask 0x50 SAct 0x0 SErr 0x4090800
action 0xe frozen
[359799.624293] ata5: irq_stat 0x00400040, connection status changed
[359799.624298] ata5: SError: { HostInt PHYRdyChg 10B8B DevExch }
[359799.624304] ata5: hard resetting link
[359800.348021] ata5: SATA link down (SStatus 0 SControl 300)
[359805.348019] ata5: hard resetting link
[359805.668015] ata5: SATA link down (SStatus 0 SControl 300)
[359805.668030] ata5: limiting SATA link speed to 1.5 Gbps
[359810.668014] ata5: hard resetting link
[359810.988027] ata5: SATA link down (SStatus 0 SControl 310)
[359810.988038] ata5.00: disabled
[359810.988052] ata5: EH complete
[359810.988062] ata5.00: detaching (SCSI 4:0:0:0)
[359810.989357] sd 4:0:0:0: [sde] Synchronizing SCSI cache
[359810.989403] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[359810.989410] sd 4:0:0:0: [sde] Stopping disk
[359810.989422] sd 4:0:0:0: [sde] START_STOP FAILED
[359810.989426] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET

driverbyte=DRIVER_OK

plug it back in, and nothing happens.

3.3rc4 + v2 of your patch series (because there's nothing better than finding a likely culprit after 8 hours reading unfamiliar code, and the first search result for its commit log has words  "However, some devices currently have issues with that fix, so we must implement a flag that delays the ahci_start_engine() call only for specific controllers" along with a patch):

[  135.966542] netconsole: network logging started [  136.043949] Fri Mar 2 06:09:41 CST 2012 [  164.204992] SysRq : Changing Loglevel
[  164.205008] Loglevel set to 9

unplug the esata cable

[  182.076415] ata5: exception Emask 0x50 SAct 0x0 SErr 0x4090800 action 0xe frozen
[  182.076429] ata5: irq_stat 0x00400040, connection status changed [  182.076443] ata5: SError: { HostInt PHYRdyChg 10B8B DevExch } [  182.076449] ata5: hard resetting link
[  182.800028] ata5: SATA link down (SStatus 0 SControl 300) [  187.800020] ata5: hard resetting link
[  188.120032] ata5: SATA link down (SStatus 0 SControl 300) [  188.120050] ata5: limiting SATA link speed to 1.5 Gbps [  193.120021] ata5: hard resetting link
[  193.440046] ata5: SATA link down (SStatus 0 SControl 310) [  193.440087] ata5.00: disabled
[  193.440106] ata5: EH complete
[  193.440127] ata5.00: detaching (SCSI 4:0:0:0)
[  193.441626] sd 4:0:0:0: [sde] Synchronizing SCSI cache [  193.441726] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[  193.441734] sd 4:0:0:0: [sde] Stopping disk
[  193.441745] sd 4:0:0:0: [sde] START_STOP FAILED
[  193.441750] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK

plug it back in, and nothing happens.

The same the same thing on 3.2.1 for comparison:

[   68.834142] netconsole: network logging started [   76.551905] SysRq : Changing Loglevel
[   76.551917] Loglevel set to 9

unplug

[   87.530721] ata5: exception Emask 0x50 SAct 0x0 SErr 0x4090800 action 0xe frozen
[   87.530735] ata5: irq_stat 0x00400040, connection status changed [   87.530739] ata5: SError: { HostInt PHYRdyChg 10B8B DevExch } [   87.530748] ata5: hard resetting link
[   88.252038] ata5: SATA link down (SStatus 0 SControl 300) [   93.252026] ata5: hard resetting link
[   93.576040] ata5: SATA link down (SStatus 0 SControl 300) [   93.576069] ata5: limiting SATA link speed to 1.5 Gbps [   98.576034] ata5: hard resetting link
[   98.896035] ata5: SATA link down (SStatus 0 SControl 310) [   98.896052] ata5.00: disabled
[   98.896069] ata5: EH complete
[   98.896090] ata5.00: detaching (SCSI 4:0:0:0)
[   98.897565] sd 4:0:0:0: [sde] Synchronizing SCSI cache [   98.898391] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[   98.898405] sd 4:0:0:0: [sde] Stopping disk
[   98.898417] sd 4:0:0:0: [sde] START_STOP FAILED
[   98.898421] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK

and plug it back in...

[  111.783606] ata5: exception Emask 0x10 SAct 0x0 SErr 0x4040000 action 0xe frozen
[  111.783620] ata5: irq_stat 0x00000040, connection status changed [  111.783625] ata5: SError: { CommWake DevExch }
[  111.783633] ata5: limiting SATA link speed to 1.5 Gbps
[  111.783638] ata5: hard resetting link
[  112.676058] ata5: SATA link up 1.5 Gbps (SStatus 113 SControl 310) [  112.678304] ata5.00: ATA-8: WDC WD10EARS-00Y5B1, 80.00A80, max UDMA/133 [  112.678316] ata5.00: 1953525168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[  112.679599] ata5.00: configured for UDMA/133
[  112.679635] ata5: EH complete
[  112.679763] scsi 4:0:0:0: Direct-Access     ATA      WDC WD10EARS-00Y 80.0 PQ: 0 ANSI: 5
[  112.679933] sd 4:0:0:0: [sde] 1953525168 512-byte logical blocks:
(1.00 TB/931 GiB)
[  112.680107] sd 4:0:0:0: [sde] Write Protect is off
[  112.680112] sd 4:0:0:0: [sde] Mode Sense: 00 3a 00 00
[  112.680140] sd 4:0:0:0: [sde] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[  112.680804] sd 4:0:0:0: Attached scsi generic sg4 type 0
[  113.099967]  sde: unknown partition table
[  113.100259] sd 4:0:0:0: [sde] Attached SCSI disk

It lives!  (and it works fine all the way back to 2.6.32, possibly earlier).

Now, the reason I'm picking on you is that git blame only has a handful of lines in libata-eh.c, and as near as I can figure, the only lines of code that changed in 3.3 that would seem to be able to cause this are the ones that your series is a quasi revert of.  I don't have hard evidence yet (unless the logged messages are more damning than I think they are), but it does seem likely that, at the very least, you might have some idea what's going on :p

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

#9 lore raw
Quoted 15 lines · Lin Ming
Quoted 14 lines · cwillu
Quoted 4 lines · Brian Norris

This series addresses regression problems with

   commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
   ahci: start engine only during soft/hard resets

I just spent the better part of last night tracking down the specific sources of the log entry I get when I disconnect my e-sata drive; once it disconnects, the port is dead until I reboot; no combination of anything I've been able to poke at in /sys or elsewhere gets it live again.  This starts with 3.3rc1, and turns out to still work fine in 3.2.1. Any chance it's related?

Quoted 8 lines
Quoted 1 line

3.3rc5, immediately after the unplug:

Hi,

I tested on my machine and it's fixed by below patch.
http://marc.info/?l=linux-kernel&m=132996405028746&w=2

Would you please also try it?

Building it now, and will be able to test in about 5 hours.

After looking at the thread, I spent another couple hours on poking /sys, and did get the port to come back up and find the drive with the following:

echo on > /sys/devices/pci0000:00/0000:00:1f.2/ata5/power/control
echo on > /sys/devices/pci0000:00/0000:00:1f.2/ata5/host4/power/control echo '- - -' > /sys/devices/pci0000:00/0000:00:1f.2/ata5/host4/scsi_host/host4/scan

#10 lore raw
Quoted 18 lines · cwillu
Quoted 17 lines · Lin Ming
Quoted 15 lines · cwillu
Quoted 4 lines · Brian Norris

This series addresses regression problems with

   commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
   ahci: start engine only during soft/hard resets

I just spent the better part of last night tracking down the specific sources of the log entry I get when I disconnect my e-sata drive; once it disconnects, the port is dead until I reboot; no combination of anything I've been able to poke at in /sys or elsewhere gets it live again.  This starts with 3.3rc1, and turns out to still work fine in 3.2.1. Any chance it's related?

3.3rc5, immediately after the unplug:

Quoted 8 lines
Quoted 6 lines

Hi,

I tested on my machine and it's fixed by below patch.
http://marc.info/?l=linux-kernel&m=132996405028746&w=2

Would you please also try it?

Building it now, and will be able to test in about 5 hours.

Hi,

How about the test result?

Regards,
Lin Ming

Quoted 9 lines

After looking at the thread, I spent another couple hours on poking /sys, and did get the port to come back up and find the drive with the following:

echo on > /sys/devices/pci0000:00/0000:00:1f.2/ata5/power/control
echo on > /sys/devices/pci0000:00/0000:00:1f.2/ata5/host4/power/control echo '- - -' > /sys/devices/pci0000:00/0000:00:1f.2/ata5/host4/scsi_host/host4/scan --

#11 lore raw
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 8 lines

I just spent the better part of last night tracking down the specific sources of the log entry I get when I disconnect my e-sata drive; once it disconnects, the port is dead until I reboot; no combination of anything I've been able to poke at in /sys or elsewhere gets it live again.  This starts with 3.3rc1, and turns out to still work fine in 3.2.1. Any chance it's related?

3.3rc5, immediately after the unplug:

I tested on my machine and it's fixed by below patch.
http://marc.info/?l=linux-kernel&m=132996405028746&w=2

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Would you please also try it?

Building it now, and will be able to test in about 5 hours.

Hi,

How about the test result?

Sorry about the delay.

Just verified, that patch does fix the problem:

*disconnect drive*

[   80.474026] ata5: exception Emask 0x50 SAct 0x0 SErr 0x4090800
action 0xe frozen
[   80.474041] ata5: irq_stat 0x00400040, connection status changed
[   80.474057] ata5: SError: { HostInt PHYRdyChg 10B8B DevExch }
[   80.474064] ata5: hard resetting link
[   81.197080] ata5: SATA link down (SStatus 0 SControl 300)
[   86.197028] ata5: hard resetting link
[   86.502021] ata5: SATA link down (SStatus 0 SControl 300)
[   86.502039] ata5: limiting SATA link speed to 1.5 Gbps
[   91.502018] ata5: hard resetting link
[   91.807032] ata5: SATA link down (SStatus 0 SControl 310)
[   91.807050] ata5.00: disabled
[   91.807069] ata5: EH complete
[   91.807095] ata5.00: detaching (SCSI 4:0:0:0)
[   91.808988] sd 4:0:0:0: [sde] Synchronizing SCSI cache
[   91.810288] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[   91.810305] sd 4:0:0:0: [sde] Stopping disk
[   91.810318] sd 4:0:0:0: [sde] START_STOP FAILED
[   91.810333] sd 4:0:0:0: [sde]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[  106.507666] ata5: exception Emask 0x10 SAct 0x0 SErr 0x4040000
action 0xe frozen
[  106.507683] ata5: irq_stat 0x00000040, connection status changed
[  106.507703] ata5: SError: { CommWake DevExch }
[  106.507710] ata5: limiting SATA link speed to 1.5 Gbps
[  106.507715] ata5: hard resetting link
*reconnect drive*
[  107.386022] ata5: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[  107.387979] ata5.00: ATA-8: WDC WD10EARS-00Y5B1, 80.00A80, max UDMA/133
[  107.387985] ata5.00: 1953525168 sectors, multi 16: LBA48 NCQ (depth
31/32), AA
[  107.389253] ata5.00: configured for UDMA/133
[  107.389264] ata5: EH complete
[  107.389375] scsi 4:0:0:0: Direct-Access     ATA      WDC
WD10EARS-00Y 80.0 PQ: 0 ANSI: 5
[  107.389551] sd 4:0:0:0: [sde] 1953525168 512-byte logical blocks:
(1.00 TB/931 GiB)
[  107.389613] sd 4:0:0:0: [sde] Write Protect is off
[  107.389619] sd 4:0:0:0: [sde] Mode Sense: 00 3a 00 00
[  107.389651] sd 4:0:0:0: [sde] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[  107.389667] sd 4:0:0:0: Attached scsi generic sg4 type 0
[  107.803230]  sde: unknown partition table
[  107.803550] sd 4:0:0:0: [sde] Attached SCSI disk

*rejoicing*

Thanks.

--Carey

#12 lore raw
In reply to Lin Ming
Quoted 26 lines · Lin Ming
Quoted 25 lines · cwillu
Quoted 23 lines · Lin Ming
Quoted 7 lines · cwillu
Quoted 4 lines · Brian Norris

This series addresses regression problems with

   commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
   ahci: start engine only during soft/hard resets

Quoted 8 lines

I just spent the better part of last night tracking down the specific sources of the log entry I get when I disconnect my e-sata drive; once it disconnects, the port is dead until I reboot; no combination of anything I've been able to poke at in /sys or elsewhere gets it live again.  This starts with 3.3rc1, and turns out to still work fine in 3.2.1. Any chance it's related?

3.3rc5, immediately after the unplug:

Hi,

I tested on my machine and it's fixed by below patch.
http://marc.info/?l=linux-kernel&m=132996405028746&w=2

Would you please also try it?

Quoted 18 lines
Quoted 1 line

Building it now, and will be able to test in about 5 hours.

Hi,

How about the test result?

Regards,
Lin Ming

Quoted 9 lines

After looking at the thread, I spent another couple hours on poking /sys, and did get the port to come back up and find the drive with the following:

echo on > /sys/devices/pci0000:00/0000:00:1f.2/ata5/power/control
echo on > /sys/devices/pci0000:00/0000:00:1f.2/ata5/host4/power/control echo '- - -' > /sys/devices/pci0000:00/0000:00:1f.2/ata5/host4/scsi_host/host4/scan --

@Carey:

thanks for the commands !

@Lin Ming:

I also have to apologize for the delay, I had much stuff to repartition, reformat and re-sync during the week and finally yesterday & today - after finishing that - I could do some testing

that patch works wonderfully - thanks a lot !

the system with 3.3 is significantly more responsive :)

so if there are no reservations against the patch please include it for final and/or .1 kernel-release of 3.3

on a related note: I had one observation though (non-related to the mentioned issue)

with or without the patch my computer doesn't turn itself off anymore, if I remember correctly that didn't happen with rc3 (I could be wrong though)

anyone else had the same issue ?

to not further delay the final release by this "minor" issue - I'll test again once final is out and see whether there it's the same

and if that's the case I'll write again & provide you with further information that you'll need

Awesome work as always, thanks !

Kind Regards

Matt

#13 lore raw
In reply to Brian Norris
Quoted 14 lines · Brian Norris

This series addresses regression problems with

commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
ahci: start engine only during soft/hard resets

Because the fix provided by the above commit caused COMRESET failures and 10 second boot-time/resume-time hangs for certain DVD drives, we need to make the fix conditional to certain devices/platforms. Add a flag for this.

Brian

v2: change flag name to AHCI_HFLAG_DELAY_ENGINE, write more detailed
comments

Quoted 6 lines

v1: flag named AHCI_HFLAG_STRICT_SPEC

Brian Norris (3):
ahci: add AHCI_HFLAG_DELAY_ENGINE host flag
ahci: move AHCI_HFLAGS() macro to ahci.h
ahci_platform: add STRICT_AHCI platform type

This looks good to me. Jeff?

Signature · 1 line
tejun
#14 lore raw
Quoted 15 lines · Tejun Heo
Quoted 14 lines · Brian Norris

This series addresses regression problems with

commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
ahci: start engine only during soft/hard resets

Because the fix provided by the above commit caused COMRESET failures and 10 second boot-time/resume-time hangs for certain DVD drives, we need to make the fix conditional to certain devices/platforms. Add a flag for this.

Brian

v2: change flag name to AHCI_HFLAG_DELAY_ENGINE, write more detailed
comments

Quoted 8 lines
Quoted 6 lines

v1: flag named AHCI_HFLAG_STRICT_SPEC

Brian Norris (3):
ahci: add AHCI_HFLAG_DELAY_ENGINE host flag
ahci: move AHCI_HFLAGS() macro to ahci.h
ahci_platform: add STRICT_AHCI platform type

This looks good to me. Jeff?

Yep. Added Cc [email protected] to the commit messages.

Jeff