Skip to content

Commit

Permalink
[PATCH] libata: add 5s sleep between resets
Browse files Browse the repository at this point in the history
Some devices react badly if resets are performed back-to-back.  Give
devices some time to breath and tell user that we're taking a nap.

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 90dac02 commit edbabd8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2582,6 +2582,9 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
rc = ata_do_reset(ap, softreset, postreset, 0, classes);
if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN)
goto done;
printk(KERN_INFO "ata%u: softreset failed, will try "
"hardreset in 5 secs\n", ap->id);
ssleep(5);
}

if (!hardreset)
Expand All @@ -2597,10 +2600,20 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,

if (ata_down_sata_spd_limit(ap))
goto done;

printk(KERN_INFO "ata%u: hardreset failed, will retry "
"in 5 secs\n", ap->id);
ssleep(5);
}

if (softreset)
if (softreset) {
printk(KERN_INFO "ata%u: hardreset succeeded without "
"classification, will retry softreset in 5 secs\n",
ap->id);
ssleep(5);

rc = ata_do_reset(ap, softreset, postreset, 0, classes);
}

done:
if (rc == 0 && classes[0] == ATA_DEV_UNKNOWN)
Expand Down

0 comments on commit edbabd8

Please sign in to comment.