Skip to content

Commit

Permalink
[PATCH] libata: use SATA speed down in ata_drive_probe_reset()
Browse files Browse the repository at this point in the history
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 <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 2, 2006
1 parent 1c3fae4 commit 90dac02
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 90dac02

Please sign in to comment.