aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-02-02 01:29:52 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-09 17:39:39 -0500
commitfe334602a83463aff59ae24c4b3e808d650a3c80 (patch)
tree044c48cd68d7b14f270310ab68c9f710c00b78b9 /drivers/ata
parent34fee227dd13af593be599b19683464ac4dd4c8b (diff)
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>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/sata_inic162x.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index 170a10ad478f..c5335f422801 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -429,11 +429,6 @@ static int inic_hardreset(struct ata_port *ap, unsigned int *class)
429 /* hammer it into sane state */ 429 /* hammer it into sane state */
430 inic_reset_port(port_base); 430 inic_reset_port(port_base);
431 431
432 if (ata_port_offline(ap)) {
433 *class = ATA_DEV_NONE;
434 return 0;
435 }
436
437 val = readw(idma_ctl); 432 val = readw(idma_ctl);
438 writew(val | IDMA_CTL_RST_ATA, idma_ctl); 433 writew(val | IDMA_CTL_RST_ATA, idma_ctl);
439 readw(idma_ctl); /* flush */ 434 readw(idma_ctl); /* flush */
@@ -443,16 +438,17 @@ static int inic_hardreset(struct ata_port *ap, unsigned int *class)
443 rc = sata_phy_resume(ap, timing); 438 rc = sata_phy_resume(ap, timing);
444 if (rc) { 439 if (rc) {
445 ata_port_printk(ap, KERN_WARNING, "failed to resume " 440 ata_port_printk(ap, KERN_WARNING, "failed to resume "
446 "link for reset (errno=%d)\n", rc); 441 "link after reset (errno=%d)\n", rc);
447 return rc; 442 return rc;
448 } 443 }
449 444
450 msleep(150);
451
452 *class = ATA_DEV_NONE; 445 *class = ATA_DEV_NONE;
453 if (ata_port_online(ap)) { 446 if (ata_port_online(ap)) {
454 struct ata_taskfile tf; 447 struct ata_taskfile tf;
455 448
449 /* wait a while before checking status */
450 msleep(150);
451
456 if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) { 452 if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) {
457 ata_port_printk(ap, KERN_WARNING, 453 ata_port_printk(ap, KERN_WARNING,
458 "device busy after hardreset\n"); 454 "device busy after hardreset\n");