Do phy debouncing instead of unconditional wait after DEV_RST. --- drivers/scsi/sata_sil24.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) b8c4776dbd446dd2087689d23c1a6ca153abd293 diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index 629679e..72219fa 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c @@ -591,7 +591,7 @@ static int sil24_hardreset(struct ata_po { void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; const char *reason; - int tout_msec; + int tout_msec, rc; u32 tmp; /* sil24 does the right thing(tm) without any protection */ @@ -605,10 +605,15 @@ static int sil24_hardreset(struct ata_po tmp = ata_wait_register(port + PORT_CTRL_STAT, PORT_CS_DEV_RST, PORT_CS_DEV_RST, 10, tout_msec); - /* SStatus oscillates between zero and valid status for short - * duration after DEV_RST, give it time to settle. + /* SStatus oscillates between zero and valid status after + * DEV_RST, debounce it. */ - msleep(100); + rc = sata_phy_debounce(ap, ATA_DEBOUNCE_INTERVAL, + ATA_DEBOUNCE_DURATION, ATA_DEBOUNCE_TIMEOUT); + if (rc) { + reason = "PHY debouncing failed"; + goto err; + } if (tmp & PORT_CS_DEV_RST) { if (ata_port_offline(ap)) -- 1.2.4 - : send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html