aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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");