]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
libata: retry FS IOs even if it has failed with AC_ERR_INVALID
authorTejun Heo <tj@kernel.org>
Thu, 14 Jan 2010 07:18:09 +0000 (16:18 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 9 Feb 2010 12:50:44 +0000 (04:50 -0800)
commit 534ead709235b967b659947c55d9130873a432c4 upstream.

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>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ata/libata-eh.c

index bba2ae5df1c2270664c7b9c0c19f94ca4eefb63b..7d8d3c3b4c80b09dbf5f9d7742094cffd2f212c6 100644 (file)
@@ -2019,8 +2019,9 @@ static void ata_eh_link_autopsy(struct ata_link *link)
                        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 */