ChangeSet 1.2181.22.17, 2005/03/28 19:58:58-06:00, [EMAIL PROTECTED]
[PATCH] Add a scsi_device flag for RETRY_HWERROR
It turns out that a bunch of USB-IDE converters make the mistake of
returning SK = 04 (Hardware Error) whenever the IDE device signals any
sort of error, without bothering to distinguish recoverable from
non-recoverable errors. The best way to handle this is for usb-storage
to
set a per-device flag indicating that these errors should always be
retried. The current scheme (blacklist flag but no per-device flag)
isn't
well suited for this situation.
This patch adds the per-device flag and sets it initially based on the
blacklist setting. Once this has been merged, a separate patch will be
submitted to Matt Dharm adding the corresponding support to usb-storage.
Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
drivers/scsi/scsi_error.c | 6 +-----
drivers/scsi/scsi_scan.c | 3 +++
include/scsi/scsi_device.h | 1 +
3 files changed, 5 insertions(+), 5 deletions(-)
diff -Nru a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
--- a/drivers/scsi/scsi_error.c 2005-03-30 16:22:02 -08:00
+++ b/drivers/scsi/scsi_error.c 2005-03-30 16:22:02 -08:00
@@ -31,7 +31,6 @@
#include <scsi/scsi_host.h>
#include <scsi/scsi_ioctl.h>
#include <scsi/scsi_request.h>
-#include <scsi/scsi_devinfo.h>
#include "scsi_priv.h"
#include "scsi_logging.h"
@@ -352,10 +351,7 @@
return NEEDS_RETRY;
case HARDWARE_ERROR:
- if (scsi_get_device_flags(scmd->device,
- scmd->device->vendor,
- scmd->device->model)
- & BLIST_RETRY_HWERROR)
+ if (scmd->device->retry_hwerror)
return NEEDS_RETRY;
else
return SUCCESS;
diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
--- a/drivers/scsi/scsi_scan.c 2005-03-30 16:22:02 -08:00
+++ b/drivers/scsi/scsi_scan.c 2005-03-30 16:22:02 -08:00
@@ -725,6 +725,9 @@
if (*bflags & BLIST_NOT_LOCKABLE)
sdev->lockable = 0;
+ if (*bflags & BLIST_RETRY_HWERROR)
+ sdev->retry_hwerror = 1;
+
transport_configure_device(&sdev->sdev_gendev);
if (sdev->host->hostt->slave_configure)
diff -Nru a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
--- a/include/scsi/scsi_device.h 2005-03-30 16:22:02 -08:00
+++ b/include/scsi/scsi_device.h 2005-03-30 16:22:02 -08:00
@@ -112,6 +112,7 @@
unsigned no_uld_attach:1; /* disable connecting to upper level drivers
*/
unsigned select_no_atn:1;
unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */
+ unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */
unsigned int device_blocked; /* Device returned QUEUE_FULL. */
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html