All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
@ 2012-02-21 18:38 ` Brian Norris
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Norris @ 2012-02-21 18:38 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-ide, Linux Kernel, Tejun Heo, Brian Norris, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat, Valdis Kletnieks,
	Rafael J . Wysocki

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(-)


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
@ 2012-02-21 18:38 ` Brian Norris
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Norris @ 2012-02-21 18:38 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-ide, Linux Kernel, Tejun Heo, Brian Norris, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat, Valdis Kletnieks,
	Rafael J . Wysocki

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(-)


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2 1/3] ahci: add AHCI_HFLAG_DELAY_ENGINE host flag
  2012-02-21 18:38 ` Brian Norris
@ 2012-02-21 18:38   ` Brian Norris
  -1 siblings, 0 replies; 19+ messages in thread
From: Brian Norris @ 2012-02-21 18:38 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-ide, Linux Kernel, Tejun Heo, Brian Norris, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat, Valdis Kletnieks,
	Rafael J . Wysocki

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.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/ata/ahci.h    |    3 +++
 drivers/ata/libahci.c |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index b175000..feb127e 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -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 */
 
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index a72bfd0..f9eaa82 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -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) {

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 1/3] ahci: add AHCI_HFLAG_DELAY_ENGINE host flag
@ 2012-02-21 18:38   ` Brian Norris
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Norris @ 2012-02-21 18:38 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-ide, Linux Kernel, Tejun Heo, Brian Norris, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat, Valdis Kletnieks,
	Rafael J . Wysocki

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.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/ata/ahci.h    |    3 +++
 drivers/ata/libahci.c |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index b175000..feb127e 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -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 */
 
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index a72bfd0..f9eaa82 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -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) {

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 2/3] ahci: move AHCI_HFLAGS() macro to ahci.h
  2012-02-21 18:38 ` Brian Norris
@ 2012-02-21 18:38   ` Brian Norris
  -1 siblings, 0 replies; 19+ messages in thread
From: Brian Norris @ 2012-02-21 18:38 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-ide, Linux Kernel, Tejun Heo, Brian Norris, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat, Valdis Kletnieks,
	Rafael J . Wysocki

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

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/ata/ahci.c |    2 --
 drivers/ata/ahci.h |    3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index d07bf03..ddeb845 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -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] =
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index feb127e..c2594dd 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -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 */

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 2/3] ahci: move AHCI_HFLAGS() macro to ahci.h
@ 2012-02-21 18:38   ` Brian Norris
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Norris @ 2012-02-21 18:38 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-ide, Linux Kernel, Tejun Heo, Brian Norris, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat, Valdis Kletnieks,
	Rafael J . Wysocki

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

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/ata/ahci.c |    2 --
 drivers/ata/ahci.h |    3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index d07bf03..ddeb845 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -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] =
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index feb127e..c2594dd 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -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 */

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 3/3] ahci_platform: add STRICT_AHCI platform type
  2012-02-21 18:38 ` Brian Norris
@ 2012-02-21 18:38   ` Brian Norris
  -1 siblings, 0 replies; 19+ messages in thread
From: Brian Norris @ 2012-02-21 18:38 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-ide, Linux Kernel, Tejun Heo, Brian Norris, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat, Valdis Kletnieks,
	Rafael J . Wysocki

Some platforms need to make use of the AHCI_HFLAG_DELAY_ENGINE flag.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/ata/ahci_platform.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 48be4e1..0c86c77 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -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 = {

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 3/3] ahci_platform: add STRICT_AHCI platform type
@ 2012-02-21 18:38   ` Brian Norris
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Norris @ 2012-02-21 18:38 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-ide, Linux Kernel, Tejun Heo, Brian Norris, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat, Valdis Kletnieks,
	Rafael J . Wysocki

Some platforms need to make use of the AHCI_HFLAG_DELAY_ENGINE flag.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/ata/ahci_platform.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 48be4e1..0c86c77 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -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 = {

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-02-21 18:38 ` Brian Norris
                   ` (3 preceding siblings ...)
  (?)
@ 2012-02-23  0:02 ` Norbert Preining
  2012-03-06 18:24   ` Brian Norris
  -1 siblings, 1 reply; 19+ messages in thread
From: Norbert Preining @ 2012-02-23  0:02 UTC (permalink / raw)
  To: Brian Norris
  Cc: Jeff Garzik, linux-ide, Linux Kernel, Tejun Heo, Lin Ming,
	Srivatsa S . Bhat, Valdis Kletnieks, Rafael J . Wysocki

On Di, 21 Feb 2012, Brian Norris wrote:
> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-02-21 18:38 ` Brian Norris
                   ` (4 preceding siblings ...)
  (?)
@ 2012-03-02 13:16 ` cwillu
  2012-03-05  0:58   ` Lin Ming
  -1 siblings, 1 reply; 19+ messages in thread
From: cwillu @ 2012-03-02 13:16 UTC (permalink / raw)
  To: Brian Norris
  Cc: Jeff Garzik, linux-ide, Linux Kernel, Tejun Heo, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat

On Tue, Feb 21, 2012 at 12:38 PM, Brian Norris
<computersforpeace@gmail.com> wrote:
> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-03-02 13:16 ` cwillu
@ 2012-03-05  0:58   ` Lin Ming
  2012-03-05  5:12     ` cwillu
  0 siblings, 1 reply; 19+ messages in thread
From: Lin Ming @ 2012-03-05  0:58 UTC (permalink / raw)
  To: cwillu
  Cc: Brian Norris, Jeff Garzik, linux-ide, Linux Kernel, Tejun Heo,
	Norbert Preining, Srivatsa S . Bhat, Matt

On Fri, Mar 2, 2012 at 9:16 PM, cwillu <cwillu@cwillu.com> wrote:
> On Tue, Feb 21, 2012 at 12:38 PM, Brian Norris
> <computersforpeace@gmail.com> wrote:
>> 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:

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

>
> [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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-03-05  0:58   ` Lin Ming
@ 2012-03-05  5:12     ` cwillu
  2012-03-07  5:28       ` Lin Ming
  0 siblings, 1 reply; 19+ messages in thread
From: cwillu @ 2012-03-05  5:12 UTC (permalink / raw)
  To: Lin Ming
  Cc: Brian Norris, Jeff Garzik, linux-ide, Linux Kernel, Tejun Heo,
	Norbert Preining, Srivatsa S . Bhat, Matt

On Sun, Mar 4, 2012 at 6:58 PM, Lin Ming <ming.m.lin@intel.com> wrote:
> On Fri, Mar 2, 2012 at 9:16 PM, cwillu <cwillu@cwillu.com> wrote:
>> On Tue, Feb 21, 2012 at 12:38 PM, Brian Norris
>> <computersforpeace@gmail.com> wrote:
>>> 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:
>
> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-02-23  0:02 ` [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures Norbert Preining
@ 2012-03-06 18:24   ` Brian Norris
  0 siblings, 0 replies; 19+ messages in thread
From: Brian Norris @ 2012-03-06 18:24 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Norbert Preining, linux-ide, Linux Kernel, Tejun Heo, Lin Ming,
	Srivatsa S . Bhat, Valdis Kletnieks, Rafael J . Wysocki

Hi Jeff,

On Wed, Feb 22, 2012 at 4:02 PM, Norbert Preining <preining@logic.at> wrote:
> On Di, 21 Feb 2012, Brian Norris wrote:
>> 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.

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

Brian

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-03-05  5:12     ` cwillu
@ 2012-03-07  5:28       ` Lin Ming
  2012-03-09 16:07         ` cwillu
  2012-03-10  0:07         ` Matt
  0 siblings, 2 replies; 19+ messages in thread
From: Lin Ming @ 2012-03-07  5:28 UTC (permalink / raw)
  To: cwillu
  Cc: Brian Norris, Jeff Garzik, linux-ide, Linux Kernel, Tejun Heo,
	Norbert Preining, Srivatsa S . Bhat, Matt

On Mon, Mar 5, 2012 at 1:12 PM, cwillu <cwillu@cwillu.com> wrote:
> On Sun, Mar 4, 2012 at 6:58 PM, Lin Ming <ming.m.lin@intel.com> wrote:
>> On Fri, Mar 2, 2012 at 9:16 PM, cwillu <cwillu@cwillu.com> wrote:
>>> On Tue, Feb 21, 2012 at 12:38 PM, Brian Norris
>>> <computersforpeace@gmail.com> wrote:
>>>> 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:
>>
>> 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

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-03-07  5:28       ` Lin Ming
@ 2012-03-09 16:07         ` cwillu
  2012-03-10  0:07         ` Matt
  1 sibling, 0 replies; 19+ messages in thread
From: cwillu @ 2012-03-09 16:07 UTC (permalink / raw)
  To: Lin Ming
  Cc: Brian Norris, Jeff Garzik, linux-ide, Linux Kernel, Tejun Heo,
	Norbert Preining, Srivatsa S . Bhat, Matt

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-03-07  5:28       ` Lin Ming
  2012-03-09 16:07         ` cwillu
@ 2012-03-10  0:07         ` Matt
  1 sibling, 0 replies; 19+ messages in thread
From: Matt @ 2012-03-10  0:07 UTC (permalink / raw)
  To: Lin Ming
  Cc: Linus Torvalds, Linux Kernel, viro, jeff, Brian Norris,
	Jeff Garzik, linux-ide, Tejun Heo, Norbert Preining,
	Srivatsa S . Bhat

On Wed, Mar 7, 2012 at 6:28 AM, Lin Ming <ming.m.lin@intel.com> wrote:
> On Mon, Mar 5, 2012 at 1:12 PM, cwillu <cwillu@cwillu.com> wrote:
>> On Sun, Mar 4, 2012 at 6:58 PM, Lin Ming <ming.m.lin@intel.com> wrote:
>>> On Fri, Mar 2, 2012 at 9:16 PM, cwillu <cwillu@cwillu.com> wrote:
>>>> On Tue, Feb 21, 2012 at 12:38 PM, Brian Norris
>>>> <computersforpeace@gmail.com> wrote:
>>>>> 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:
>>>
>>> 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
>
>>
>> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-02-21 18:38 ` Brian Norris
                   ` (5 preceding siblings ...)
  (?)
@ 2012-03-12 22:12 ` Tejun Heo
  2012-03-13 20:37   ` Jeff Garzik
  -1 siblings, 1 reply; 19+ messages in thread
From: Tejun Heo @ 2012-03-12 22:12 UTC (permalink / raw)
  To: Brian Norris
  Cc: Jeff Garzik, linux-ide, Linux Kernel, Lin Ming, Norbert Preining,
	Srivatsa S . Bhat, Valdis Kletnieks, Rafael J . Wysocki

On Tue, Feb 21, 2012 at 10:38:41AM -0800, Brian Norris wrote:
> 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

This looks good to me.  Jeff?

-- 
tejun

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 1/3] ahci: add AHCI_HFLAG_DELAY_ENGINE host flag
  2012-02-21 18:38   ` Brian Norris
  (?)
@ 2012-03-13 20:36   ` Jeff Garzik
  -1 siblings, 0 replies; 19+ messages in thread
From: Jeff Garzik @ 2012-03-13 20:36 UTC (permalink / raw)
  To: Brian Norris
  Cc: linux-ide, Linux Kernel, Tejun Heo, Lin Ming, Norbert Preining,
	Srivatsa S . Bhat, Valdis Kletnieks, Rafael J . Wysocki

On 02/21/2012 01:38 PM, Brian Norris wrote:
> 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.
>
> Signed-off-by: Brian Norris<computersforpeace@gmail.com>

applied 1-3




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures
  2012-03-12 22:12 ` Tejun Heo
@ 2012-03-13 20:37   ` Jeff Garzik
  0 siblings, 0 replies; 19+ messages in thread
From: Jeff Garzik @ 2012-03-13 20:37 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Brian Norris, linux-ide, Linux Kernel, Lin Ming,
	Norbert Preining, Srivatsa S . Bhat, Valdis Kletnieks,
	Rafael J . Wysocki

On 03/12/2012 06:12 PM, Tejun Heo wrote:
> On Tue, Feb 21, 2012 at 10:38:41AM -0800, Brian Norris wrote:
>> 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
>
> This looks good to me.  Jeff?

Yep.  Added Cc stable@kernel.org to the commit messages.

	Jeff





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-03-13 20:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-21 18:38 [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures Brian Norris
2012-02-21 18:38 ` Brian Norris
2012-02-21 18:38 ` [PATCH v2 1/3] ahci: add AHCI_HFLAG_DELAY_ENGINE host flag Brian Norris
2012-02-21 18:38   ` Brian Norris
2012-03-13 20:36   ` Jeff Garzik
2012-02-21 18:38 ` [PATCH v2 2/3] ahci: move AHCI_HFLAGS() macro to ahci.h Brian Norris
2012-02-21 18:38   ` Brian Norris
2012-02-21 18:38 ` [PATCH v2 3/3] ahci_platform: add STRICT_AHCI platform type Brian Norris
2012-02-21 18:38   ` Brian Norris
2012-02-23  0:02 ` [PATCH v2 0/3] ahci: fix boot/resume COMRESET failures Norbert Preining
2012-03-06 18:24   ` Brian Norris
2012-03-02 13:16 ` cwillu
2012-03-05  0:58   ` Lin Ming
2012-03-05  5:12     ` cwillu
2012-03-07  5:28       ` Lin Ming
2012-03-09 16:07         ` cwillu
2012-03-10  0:07         ` Matt
2012-03-12 22:12 ` Tejun Heo
2012-03-13 20:37   ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.