All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Cc: Luca Tettamanti <kronos.it@gmail.com>
Subject: [PATCH #upstream-fixes] libata: skip 0xff polling for PATA controllers
Date: Thu, 08 Nov 2007 11:20:18 +0900	[thread overview]
Message-ID: <47327262.9020004@gmail.com> (raw)

In a presentation of true workmanship, pata_ali asserts IRQ
permanantly if the TF status register is read more than once when
there's no device attached to the port.

Avoid waiting polling for !0xff if it's PATA.  It's needed only for
some rare SATA devices anyway.

This problem is reported by Luca Tettamanti in bugzilla bug 9298.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Tested-By: Luca Tettamanti <kronos.it@gmail.com>
---
 drivers/ata/libata-core.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 009bd60..fd73f0b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3383,14 +3383,20 @@ void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline)
 	 * to clear 0xff after reset.  For example, HHD424020F7SV00
 	 * iVDR needs >= 800ms while.  Quantum GoVault needs even more
 	 * than that.
+	 *
+	 * Note that some PATA controllers (pata_ali) explode if
+	 * status register is read more than once when there's no
+	 * device attached.
 	 */
-	while (1) {
-		u8 status = ata_chk_status(ap);
+	if (ap->flags & ATA_FLAG_SATA) {
+		while (1) {
+			u8 status = ata_chk_status(ap);
 
-		if (status != 0xff || time_after(jiffies, deadline))
-			return;
+			if (status != 0xff || time_after(jiffies, deadline))
+				return;
 
-		msleep(50);
+			msleep(50);
+		}
 	}
 }
 

             reply	other threads:[~2007-11-08  2:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08  2:20 Tejun Heo [this message]
2007-11-08 10:53 ` [PATCH #upstream-fixes] libata: skip 0xff polling for PATA controllers Alan Cox
2007-11-08 13:39 ` Mark Lord
2007-11-09  0:41   ` Tejun Heo
2007-11-08 18:14 ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47327262.9020004@gmail.com \
    --to=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=kronos.it@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.