[PATCH] USB Storage: retry hard errors

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.

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

---
commit 86dbde9cbdfe8bc2c2dfe5d33027d3acc55e0470
tree 0dcfa65023ca3df8816bd7bbb42c19b443096a48
parent 4d07ef762fc8d6d35ecc1511a3b953a733a61a5f
author Matthew Dharm <[EMAIL PROTECTED]> Mon, 06 Jun 2005 17:22:42 -0700
committer Greg Kroah-Hartman <[EMAIL PROTECTED]> Mon, 27 Jun 2005 14:44:03 -0700

 drivers/usb/storage/scsiglue.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -155,6 +155,15 @@ static int slave_configure(struct scsi_d
                 * 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



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to