From: Tejun Heo Date: Sun, 2 Apr 2006 08:54:46 +0000 (+0900) Subject: [PATCH] libata: use SATA speed down in ata_drive_probe_reset() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=90dac02c08dabd471927f151b8393eb51e3e020e;p=linux-beck.git [PATCH] libata: use SATA speed down in ata_drive_probe_reset() Make ata_drive_probe_reset() use SATA SPD configuration. Hardreset will be force if speed renegotiation is necessary. Also, if a hardreset fails, PHY speed is stepped down and hardreset is retried until the lowest speed is reached. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 63488673765f..4fd24075afd2 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -2578,7 +2578,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit, if (probeinit) probeinit(ap); - if (softreset) { + if (softreset && !ata_set_sata_spd_needed(ap)) { rc = ata_do_reset(ap, softreset, postreset, 0, classes); if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN) goto done; @@ -2587,9 +2587,17 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit, if (!hardreset) goto done; - rc = ata_do_reset(ap, hardreset, postreset, 0, classes); - if (rc || classes[0] != ATA_DEV_UNKNOWN) - goto done; + while (1) { + rc = ata_do_reset(ap, hardreset, postreset, 0, classes); + if (rc == 0) { + if (classes[0] != ATA_DEV_UNKNOWN) + goto done; + break; + } + + if (ata_down_sata_spd_limit(ap)) + goto done; + } if (softreset) rc = ata_do_reset(ap, softreset, postreset, 0, classes);