linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH #upstream-fixes] libata: retry FS IOs even if it has failed with AC_ERR_INVALID
@ 2010-01-14  7:18 Tejun Heo
  2010-01-20 19:25 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2010-01-14  7:18 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide@vger.kernel.org, Johannes Stezenbach

libata currently doesn't retry if a command fails with AC_ERR_INVALID
assuming that retrying won't get it any further even if retried.
However, a failure may be classified as invalid through hardware
glitch (incorrect reading of the error register or firmware bug) and
there isn't whole lot to gain by not retrying as actually invalid
commands will be failed immediately.  Also, commands serving FS IOs
are extremely unlikely to be invalid.  Retry FS IOs even if it's
marked invalid.

Transient and incorrect invalid failure was seen while debugging
firmware related issue on Samsung n130 on bko#14314.

  http://bugzilla.kernel.org/show_bug.cgi?id=14314

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Johannes Stezenbach <js@sig21.net>
---
 drivers/ata/libata-eh.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: ata/drivers/ata/libata-eh.c
===================================================================
--- ata.orig/drivers/ata/libata-eh.c
+++ ata/drivers/ata/libata-eh.c
@@ -2028,8 +2028,9 @@ static void ata_eh_link_autopsy(struct a
 			qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER);
 
 		/* determine whether the command is worth retrying */
-		if (!(qc->err_mask & AC_ERR_INVALID) &&
-		    ((qc->flags & ATA_QCFLAG_IO) || qc->err_mask != AC_ERR_DEV))
+		if (qc->flags & ATA_QCFLAG_IO ||
+		    (!(qc->err_mask & AC_ERR_INVALID) &&
+		     qc->err_mask != AC_ERR_DEV))
 			qc->flags |= ATA_QCFLAG_RETRY;
 
 		/* accumulate error info */

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

* Re: [PATCH #upstream-fixes] libata: retry FS IOs even if it has failed with AC_ERR_INVALID
  2010-01-14  7:18 [PATCH #upstream-fixes] libata: retry FS IOs even if it has failed with AC_ERR_INVALID Tejun Heo
@ 2010-01-20 19:25 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2010-01-20 19:25 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide@vger.kernel.org, Johannes Stezenbach

On 01/14/2010 02:18 AM, Tejun Heo wrote:
> libata currently doesn't retry if a command fails with AC_ERR_INVALID
> assuming that retrying won't get it any further even if retried.
> However, a failure may be classified as invalid through hardware
> glitch (incorrect reading of the error register or firmware bug) and
> there isn't whole lot to gain by not retrying as actually invalid
> commands will be failed immediately.  Also, commands serving FS IOs
> are extremely unlikely to be invalid.  Retry FS IOs even if it's
> marked invalid.
>
> Transient and incorrect invalid failure was seen while debugging
> firmware related issue on Samsung n130 on bko#14314.
>
>    http://bugzilla.kernel.org/show_bug.cgi?id=14314
>
> Signed-off-by: Tejun Heo<tj@kernel.org>
> Reported-by: Johannes Stezenbach<js@sig21.net>

applied



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

end of thread, other threads:[~2010-01-20 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14  7:18 [PATCH #upstream-fixes] libata: retry FS IOs even if it has failed with AC_ERR_INVALID Tejun Heo
2010-01-20 19:25 ` 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).