This patch fixes an intersection between failed commands and SCSI-issued resets. It's an unlikely error case.
Greg, please apply.
Matt
----- Forwarded message from Alan Stern <[EMAIL PROTECTED]> -----
Date: Tue, 4 Nov 2003 16:40:19 -0500 (EST)
From: Alan Stern <[EMAIL PROTECTED]>
Subject: PATCH: (as129) Allow for timeout during device reset
To: Matthew Dharm <[EMAIL PROTECTED]>
cc: USB Storage List <[EMAIL PROTECTED]>
X-Spam-Status: No, hits=-4.0 required=5.0 tests=UNIFIED_PATCH,RCVD_IN_ORBZ version=2.11
Matt:
This patch fixes some odd behavior which I ran across while testing my USB
storage gadget. When a command returns an error we automatically issue a
device reset. This reset involves a 20-second delay, and during that
delay the scsi layer is likely to timeout the original command. It will
issue an abort, which prevents the reset routine from clearing halts on
the bulk endpoints. The patch turns off the US_FLIDX_ABORTING flag after
the delay period, so the clear_halt() calls will be able to work.
Alan Stern
===== transport.c 1.112 vs edited =====
--- 1.112/drivers/usb/storage/transport.c Fri Sep 26 12:37:45 2003
+++ edited/drivers/usb/storage/transport.c Tue Nov 4 10:48:15 2003
@@ -1080,6 +1080,9 @@
return FAILED;
}
+ /* permit the clear-halt transfers to take place */
+ clear_bit(US_FLIDX_ABORTING, &us->flags);
+
US_DEBUGP("Soft reset: clearing bulk-in endpoint halt\n");
result = usb_stor_clear_halt(us, us->recv_bulk_pipe);
----- End forwarded message -----
--
Matthew Dharm Home: [EMAIL PROTECTED]
Maintainer, Linux USB Mass Storage Driver
Somebody call an exorcist!
-- Dust Puppy
User Friendly, 5/16/1998
pgp00000.pgp
Description: PGP signature
