From e6448a982d304ce1c106ccb4e61609e99747bfe9 Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Wed, 19 Oct 2011 17:17:02 -0700 Subject: [PATCH] --- yaml --- r: 275335 b: refs/heads/master c: 7a46c0780babea7d0b3f277a33ea243be38eb942 h: refs/heads/master i: 275333: 895c09a42a6e5454e850b9991de29996e97bfcd7 275331: 5387d69a460dc2d9bd9278cb3c330a6b87b94ed7 275327: 63bcccee3683c68dbf63bb5e2cfbb9b22f9da369 v: v3 --- [refs] | 2 +- trunk/drivers/ata/libata-eh.c | 12 +++++++++++- trunk/drivers/ata/libata-pmp.c | 7 ++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 31ef38b9e6bc..6e16edf15a05 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 142924cf402f9c0568004f0e2a27988fe3556c61 +refs/heads/master: 7a46c0780babea7d0b3f277a33ea243be38eb942 diff --git a/trunk/drivers/ata/libata-eh.c b/trunk/drivers/ata/libata-eh.c index f22957c2769a..a9b282038000 100644 --- a/trunk/drivers/ata/libata-eh.c +++ b/trunk/drivers/ata/libata-eh.c @@ -2883,7 +2883,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 @@ -2909,6 +2909,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/trunk/drivers/ata/libata-pmp.c b/trunk/drivers/ata/libata-pmp.c index 104462dbc524..21b80c555c60 100644 --- a/trunk/drivers/ata/libata-pmp.c +++ b/trunk/drivers/ata/libata-pmp.c @@ -389,12 +389,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)