This patch is an obviously correct fix for detecting errors on a CB[I]
transport.

Greg, please apply.

Matt

----- Forwarded message from Alan Stern <[EMAIL PROTECTED]> -----

Date: Wed, 17 Dec 2003 16:55:04 -0500 (EST)
From: Alan Stern <[EMAIL PROTECTED]>
Subject: PATCH: (as162)  Treat STALL as failure for CB[I]
To: Matthew Dharm <[EMAIL PROTECTED]>
cc: USB Storage List <[EMAIL PROTECTED]>
X-Spam-Status: No, hits=-0.9 required=5.0 
tests=AWL,PATCH_UNIFIED_DIFF,SPAM_PHRASE_00_01,UPPERCASE_25_50, USER_AGENT_PINE 
version=2.44

Matt:

I recall something like this had to be changed a while ago, but it looks 
like it's still not right.  A STALL during either the command or data 
phase of a CB[I] command should indicate a failure.

Alan Stern


===== transport.c 1.113 vs edited =====
--- 1.113/drivers/usb/storage/transport.c       Fri Oct 24 11:05:36 2003
+++ edited/drivers/usb/storage/transport.c      Wed Dec 17 10:34:28 2003
@@ -792,6 +792,10 @@
                                        srb->request_buffer, transfer_length,
                                        srb->use_sg, &srb->resid);
                US_DEBUGP("CBI data stage result is 0x%x\n", result);
+
+               /* if we stalled the data transfer it means command failed */
+               if (result == USB_STOR_XFER_STALLED)
+                       return USB_STOR_TRANSPORT_FAILED;
                if (result > USB_STOR_XFER_STALLED)
                        return USB_STOR_TRANSPORT_ERROR;
        }
@@ -883,6 +887,10 @@
                                        srb->request_buffer, transfer_length,
                                        srb->use_sg, &srb->resid);
                US_DEBUGP("CB data stage result is 0x%x\n", result);
+
+               /* if we stalled the data transfer it means command failed */
+               if (result == USB_STOR_XFER_STALLED)
+                       return USB_STOR_TRANSPORT_FAILED;
                if (result > USB_STOR_XFER_STALLED)
                        return USB_STOR_TRANSPORT_ERROR;
        }











----- End forwarded message -----

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

G:  Let me guess, you started on the 'net with AOL, right?
C:  WOW! d00d! U r leet!
                                        -- Greg and Customer 
User Friendly, 2/12/1999

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to