* [PATCH libata-dev-2.6] libata: flush COMRESET write
@ 2005-03-25 23:19 Brett Russ
2005-03-28 20:10 ` [PATCH libata-2.6] libata: flush COMRESET set and clear Brett Russ
0 siblings, 1 reply; 3+ messages in thread
From: Brett Russ @ 2005-03-25 23:19 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-ide, linux-kernel
Jeff,
I'm seeing single drives getting stuck in ata_busy_sleep() with these
log messages on boot:
<4>ata2 is slow to respond, please be patient
<3>ata2 failed to respond (30 secs)
One thing I found was the bug fixed below, where the COMRESET wasn't
getting flushed properly. This may or may not be the reason, but it
can't hurt. I have to keep looking and testing.
I wanted to also send a separate patch to ensure the port was stopped
before issuing COMRESET, since this is required by at least the ICH6R,
but the port_stop() routines seemed too heavy to call from
__sata_phy_reset() so I'm not sending anything like that yet.
Signed-off-by: Brett Russ <russb@emc.com>
Index: libata-dev-2.6/drivers/scsi/libata-core.c
===================================================================
--- libata-dev-2.6.orig/drivers/scsi/libata-core.c 2005-03-23 16:44:48.000000000 -0500
+++ libata-dev-2.6/drivers/scsi/libata-core.c 2005-03-25 16:58:22.000000000 -0500
@@ -1262,7 +1262,7 @@
if (ap->flags & ATA_FLAG_SATA_RESET) {
scr_write(ap, SCR_CONTROL, 0x301); /* issue phy wake/reset */
- scr_read(ap, SCR_STATUS); /* dummy read; flush */
+ scr_read(ap, SCR_CONTROL); /* dummy read; flush */
udelay(400); /* FIXME: a guess */
}
scr_write(ap, SCR_CONTROL, 0x300); /* issue phy wake/clear reset */
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH libata-2.6] libata: flush COMRESET set and clear
2005-03-25 23:19 [PATCH libata-dev-2.6] libata: flush COMRESET write Brett Russ
@ 2005-03-28 20:10 ` Brett Russ
2005-05-15 23:01 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Brett Russ @ 2005-03-28 20:10 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-ide, linux-kernel
Updated patch to fix erroneous flush of COMRESET set and missing flush
of COMRESET clear. Created a new routine scr_write_flush() to try to
prevent this in the future. Also, this patch is based on libata-2.6
instead of the previous libata-dev-2.6 based patch.
Signed-off-by: Brett Russ <russb@emc.com>
Index: libata-2.6/drivers/scsi/libata-core.c
===================================================================
--- libata-2.6.orig/drivers/scsi/libata-core.c 2005-03-28 15:06:41.000000000 -0500
+++ libata-2.6/drivers/scsi/libata-core.c 2005-03-28 15:06:41.000000000 -0500
@@ -1253,11 +1253,11 @@
unsigned long timeout = jiffies + (HZ * 5);
if (ap->flags & ATA_FLAG_SATA_RESET) {
- scr_write(ap, SCR_CONTROL, 0x301); /* issue phy wake/reset */
- scr_read(ap, SCR_STATUS); /* dummy read; flush */
+ /* issue phy wake/reset */
+ scr_write_flush(ap, SCR_CONTROL, 0x301);
udelay(400); /* FIXME: a guess */
}
- scr_write(ap, SCR_CONTROL, 0x300); /* issue phy wake/clear reset */
+ scr_write_flush(ap, SCR_CONTROL, 0x300); /* phy wake/clear reset */
/* wait for phy to become ready, if necessary */
do {
Index: libata-2.6/include/linux/libata.h
===================================================================
--- libata-2.6.orig/include/linux/libata.h 2005-03-28 15:06:42.000000000 -0500
+++ libata-2.6/include/linux/libata.h 2005-03-28 15:06:42.000000000 -0500
@@ -584,6 +584,13 @@
ap->ops->scr_write(ap, reg, val);
}
+static inline void scr_write_flush(struct ata_port *ap, unsigned int reg,
+ u32 val)
+{
+ ap->ops->scr_write(ap, reg, val);
+ (void) ap->ops->scr_read(ap, reg);
+}
+
static inline unsigned int sata_dev_present(struct ata_port *ap)
{
return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-05-15 23:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-25 23:19 [PATCH libata-dev-2.6] libata: flush COMRESET write Brett Russ
2005-03-28 20:10 ` [PATCH libata-2.6] libata: flush COMRESET set and clear Brett Russ
2005-05-15 23:01 ` Jeff Garzik
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).