Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: akpm@osdl.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Subject: PATCH: Fix error handling for drives which clear the FIFO on error
Date: Mon, 26 Jun 2006 14:54:08 +0100	[thread overview]
Message-ID: <1151330048.27147.32.camel@localhost.localdomain> (raw)

If the controller FIFO cleared automatically on error we must not try
and drain it as this will hang some chips.

Signed-off-by: Alan Cox <alan@redhat.com>

Based in concept on a broken patch from -mm some while back


diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.17/drivers/ide/ide-io.c linux-2.6.17/drivers/ide/ide-io.c
--- linux.vanilla-2.6.17/drivers/ide/ide-io.c	2006-06-19 17:17:24.000000000 +0100
+++ linux-2.6.17/drivers/ide/ide-io.c	2006-06-26 13:49:56.377579264 +0100
@@ -444,7 +444,7 @@
 		}
 	}
 
-	if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ)
+	if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0)
 		try_to_flush_leftover_data(drive);
 
 	if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT))
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.17/include/linux/ide.h linux-2.6.17/include/linux/ide.h
--- linux.vanilla-2.6.17/include/linux/ide.h	2006-06-19 17:29:50.000000000 +0100
+++ linux-2.6.17/include/linux/ide.h	2006-06-26 13:50:53.218938064 +0100
@@ -793,6 +793,7 @@
 	unsigned	auto_poll  : 1; /* supports nop auto-poll */
 	unsigned	sg_mapped  : 1;	/* sg_table and sg_nents are ready */
 	unsigned	no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
+	unsigned	err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */
 
 	struct device	gendev;
 	struct completion gendev_rel_comp; /* To deal with device release() */


                 reply	other threads:[~2006-06-26 13:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1151330048.27147.32.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@osdl.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox