This patch started life as as527, and was rediffed by me.

Since the IDE interface doesn't convey much information about types of
errors, many USB-IDE adapters report all low-level errors with SK = 0x04,
which is supposed to be used only for non-recoverable errors.  As a result
the SCSI midlayer doesn't retry the command.  But quite often a retry
would succeed, whereas an unnecessary retry doesn't really hurt anything.

This patch uses a recently-implemented flag to tell the SCSI midlayer that 
such hardware errors should be retried.

Greg, please apply.

Matt

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Matthew Dharm <[EMAIL PROTECTED]>

Index: linux-2.6.12-rc5/drivers/usb/storage/scsiglue.c
===================================================================
--- linux-2.6.12-rc5.orig/drivers/usb/storage/scsiglue.c        2005-06-05 
21:49:14.000000000 -0700
+++ linux-2.6.12-rc5/drivers/usb/storage/scsiglue.c     2005-06-05 
21:49:44.000000000 -0700
@@ -155,6 +155,15 @@
                 * If this device makes that mistake, tell the sd driver. */
                if (us->flags & US_FL_FIX_CAPACITY)
                        sdev->fix_capacity = 1;
+
+               /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable
+                * Hardware Error) when any low-level error occurs,
+                * recoverable or not.  Setting this flag tells the SCSI
+                * midlayer to retry such commands, which frequently will
+                * succeed and fix the error.  The worst this can lead to
+                * is an occasional series of retries that will all fail. */
+               sdev->retry_hwerror = 1;
+
        } else {
 
                /* Non-disk-type devices don't need to blacklist any pages
-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

A:  The most ironic oxymoron wins ...
DP: "Microsoft Works"
A:  Uh, okay, you win.
                                        -- A.J. & Dust Puppy
User Friendly, 1/18/1998

Attachment: pgpKElso3g4oK.pgp
Description: PGP signature

Reply via email to