linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH REPOST] libata: lengthen interval between SRST set and clear
@ 2006-09-28  9:13 Tejun Heo
  2006-09-28  9:53 ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Tejun Heo @ 2006-09-28  9:13 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide, justin

20us delay is not enough for some controllers and they end up not
sending the second H2D FIS to clear SRST resulting in softreset
failure.  This problem has been spotted and diagnosed with SATA trace
by JMicron on sata_nv.

This patch makes ata_bus_softreset() use msleep(1) instead of
udelay(20) between SRST set and clear.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Justin Tsai <justin@jmicron.com>

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 753b015..007020e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2414,15 +2414,15 @@ static unsigned int ata_bus_softreset(st
 	/* software reset.  causes dev0 to be selected */
 	if (ap->flags & ATA_FLAG_MMIO) {
 		writeb(ap->ctl, (void __iomem *) ioaddr->ctl_addr);
-		udelay(20);	/* FIXME: flush */
+		msleep(1);	/* FIXME: flush */
 		writeb(ap->ctl | ATA_SRST, (void __iomem *) ioaddr->ctl_addr);
-		udelay(20);	/* FIXME: flush */
+		msleep(1);	/* FIXME: flush */
 		writeb(ap->ctl, (void __iomem *) ioaddr->ctl_addr);
 	} else {
 		outb(ap->ctl, ioaddr->ctl_addr);
-		udelay(10);
+		msleep(1);
 		outb(ap->ctl | ATA_SRST, ioaddr->ctl_addr);
-		udelay(10);
+		msleep(1);
 		outb(ap->ctl, ioaddr->ctl_addr);
 	}
 
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-09-28 20:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-28  9:13 [PATCH REPOST] libata: lengthen interval between SRST set and clear Tejun Heo
2006-09-28  9:53 ` Jeff Garzik
2006-09-28  9:57   ` Tejun Heo
2006-09-28 10:00     ` Jeff Garzik
2006-09-28 20:11       ` Eric D. Mudama

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).