mirror of
https://github.com/torvalds/linux.git
synced 2024-12-31 23:31:29 +00:00
sata_inic162x: fix a few glitches in hardreset
* Hardreset must not exit without actually performing reset regardless of link status. We're resetting the link after all. * Minor message update. * 150ms delay is meaningful iff link is online after reset is complete. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
34fee227dd
commit
fe334602a8
@ -429,11 +429,6 @@ static int inic_hardreset(struct ata_port *ap, unsigned int *class)
|
|||||||
/* hammer it into sane state */
|
/* hammer it into sane state */
|
||||||
inic_reset_port(port_base);
|
inic_reset_port(port_base);
|
||||||
|
|
||||||
if (ata_port_offline(ap)) {
|
|
||||||
*class = ATA_DEV_NONE;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
val = readw(idma_ctl);
|
val = readw(idma_ctl);
|
||||||
writew(val | IDMA_CTL_RST_ATA, idma_ctl);
|
writew(val | IDMA_CTL_RST_ATA, idma_ctl);
|
||||||
readw(idma_ctl); /* flush */
|
readw(idma_ctl); /* flush */
|
||||||
@ -443,16 +438,17 @@ static int inic_hardreset(struct ata_port *ap, unsigned int *class)
|
|||||||
rc = sata_phy_resume(ap, timing);
|
rc = sata_phy_resume(ap, timing);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
ata_port_printk(ap, KERN_WARNING, "failed to resume "
|
ata_port_printk(ap, KERN_WARNING, "failed to resume "
|
||||||
"link for reset (errno=%d)\n", rc);
|
"link after reset (errno=%d)\n", rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
msleep(150);
|
|
||||||
|
|
||||||
*class = ATA_DEV_NONE;
|
*class = ATA_DEV_NONE;
|
||||||
if (ata_port_online(ap)) {
|
if (ata_port_online(ap)) {
|
||||||
struct ata_taskfile tf;
|
struct ata_taskfile tf;
|
||||||
|
|
||||||
|
/* wait a while before checking status */
|
||||||
|
msleep(150);
|
||||||
|
|
||||||
if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) {
|
if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) {
|
||||||
ata_port_printk(ap, KERN_WARNING,
|
ata_port_printk(ap, KERN_WARNING,
|
||||||
"device busy after hardreset\n");
|
"device busy after hardreset\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user