diff mbox

[libata] Issue SRST to Sil3726 PMP

Message ID 1319068962-18983-2-git-send-email-gwendal@google.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Gwendal Grignou Oct. 20, 2011, 12:02 a.m. UTC
Reenable sending SRST to devices connected behind a Sil3726 PMP.
This allow staggered spinups and handles drives that spins up slowly.

While the drives spin up, the PMP will not accept SRST.
Most controller reissues the reset until the drive is ready, while
some [Sil3124] returns an error.
In ata_eh_error, wait 10s before reset the ATA port and try again.

---
 drivers/ata/libata-eh.c  |   12 +++++++++++-
 drivers/ata/libata-pmp.c |    7 ++-----
 2 files changed, 13 insertions(+), 6 deletions(-)

Comments

Tejun Heo Oct. 20, 2011, 12:07 a.m. UTC | #1
Hello,

On Wed, Oct 19, 2011 at 05:02:42PM -0700, Gwendal Grignou wrote:
> Reenable sending SRST to devices connected behind a Sil3726 PMP.
> This allow staggered spinups and handles drives that spins up slowly.
> 
> While the drives spin up, the PMP will not accept SRST.
> Most controller reissues the reset until the drive is ready, while
> some [Sil3124] returns an error.
> In ata_eh_error, wait 10s before reset the ATA port and try again.

While I agree with the change, the description doesn't seem too
accurate.

* The behavior change applies to all PMPs.

* I hope 3726 change is in a separate patch.

* It waits for reset deadline which currently happens to be 10s.

Thanks.
Gwendal Grignou Oct. 20, 2011, 12:28 a.m. UTC | #2
On Wed, Oct 19, 2011 at 5:07 PM, Tejun Heo <htejun@gmail.com> wrote:
> Hello,
>
> On Wed, Oct 19, 2011 at 05:02:42PM -0700, Gwendal Grignou wrote:
>> Reenable sending SRST to devices connected behind a Sil3726 PMP.
>> This allow staggered spinups and handles drives that spins up slowly.
>>
>> While the drives spin up, the PMP will not accept SRST.
>> Most controller reissues the reset until the drive is ready, while
>> some [Sil3124] returns an error.
>> In ata_eh_error, wait 10s before reset the ATA port and try again.
>
> While I agree with the change, the description doesn't seem too
> accurate.
>
> * The behavior change applies to all PMPs.
I just re-enable SRST for Sil3726, not the other PMPs. For the other
ones where ATA_LFLAG_NO_SRST is still set, we will not issue softreset
and therefore will not try to access the spining disk until we send
the first identify.
For the other PMP where SRST was allowed, I guess the Sil3132
controller would have offline the disks or downgrade the speed
unnecessarily.
>
> * I hope 3726 change is in a separate patch.
>
> * It waits for reset deadline which currently happens to be 10s.
That's correct.

I update the description.

Gwendal.
>
> Thanks.
>
> --
> tejun
>
--
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

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index c021186..927d750 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2882,7 +2882,7 @@  int ata_eh_reset(struct ata_link *link, int classify,
 	    sata_scr_read(link, SCR_STATUS, &sstatus))
 		rc = -ERESTART;
 
-	if (rc == -ERESTART || try >= max_tries) {
+	if (try >= max_tries) {
 		/*
 		 * Thaw host port even if reset failed, so that the port
 		 * can be retried on the next phy event.  This risks
@@ -2908,6 +2908,16 @@  int ata_eh_reset(struct ata_link *link, int classify,
 		ata_eh_acquire(ap);
 	}
 
+	/*
+	 * While disks spinup behind PMP, some controllers fail sending SRST.
+	 * They need to be reset - as well as the PMP - before retrying.
+	 */
+	if (rc == -ERESTART) {
+		if (ata_is_host_link(link))
+			ata_eh_thaw_port(ap);
+		goto out;
+	}
+
 	if (try == max_tries - 1) {
 		sata_down_spd_limit(link, 0);
 		if (slave)
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index 3eb2b81..183643f 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -388,12 +388,9 @@  static void sata_pmp_quirks(struct ata_port *ap)
 			/* link reports offline after LPM */
 			link->flags |= ATA_LFLAG_NO_LPM;
 
-			/* Class code report is unreliable and SRST
-			 * times out under certain configurations.
-			 */
+			/* Class code report is unreliable. */
 			if (link->pmp < 5)
-				link->flags |= ATA_LFLAG_NO_SRST |
-					       ATA_LFLAG_ASSUME_ATA;
+				link->flags |= ATA_LFLAG_ASSUME_ATA;
 
 			/* port 5 is for SEMB device and it doesn't like SRST */
 			if (link->pmp == 5)