Commit 7a46c078 authored by Gwendal Grignou's avatar Gwendal Grignou Committed by Jeff Garzik

[libata] Issue SRST to Sil3726 PMP

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.
Signed-off-by: default avatarGwendal Grignou <gwendal@google.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 142924cf
...@@ -2883,7 +2883,7 @@ int ata_eh_reset(struct ata_link *link, int classify, ...@@ -2883,7 +2883,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
sata_scr_read(link, SCR_STATUS, &sstatus)) sata_scr_read(link, SCR_STATUS, &sstatus))
rc = -ERESTART; rc = -ERESTART;
if (rc == -ERESTART || try >= max_tries) { if (try >= max_tries) {
/* /*
* Thaw host port even if reset failed, so that the port * Thaw host port even if reset failed, so that the port
* can be retried on the next phy event. This risks * can be retried on the next phy event. This risks
...@@ -2909,6 +2909,16 @@ int ata_eh_reset(struct ata_link *link, int classify, ...@@ -2909,6 +2909,16 @@ int ata_eh_reset(struct ata_link *link, int classify,
ata_eh_acquire(ap); 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) { if (try == max_tries - 1) {
sata_down_spd_limit(link, 0); sata_down_spd_limit(link, 0);
if (slave) if (slave)
......
...@@ -389,12 +389,9 @@ static void sata_pmp_quirks(struct ata_port *ap) ...@@ -389,12 +389,9 @@ static void sata_pmp_quirks(struct ata_port *ap)
/* link reports offline after LPM */ /* link reports offline after LPM */
link->flags |= ATA_LFLAG_NO_LPM; link->flags |= ATA_LFLAG_NO_LPM;
/* Class code report is unreliable and SRST /* Class code report is unreliable. */
* times out under certain configurations.
*/
if (link->pmp < 5) if (link->pmp < 5)
link->flags |= ATA_LFLAG_NO_SRST | link->flags |= ATA_LFLAG_ASSUME_ATA;
ATA_LFLAG_ASSUME_ATA;
/* port 5 is for SEMB device and it doesn't like SRST */ /* port 5 is for SEMB device and it doesn't like SRST */
if (link->pmp == 5) if (link->pmp == 5)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment