On Wed, 29 Dec 2004, David Relson wrote:

> Alan,
> 
> I've added your patch and have plugged in the HDD twice.  The first time
> succeeded.  Here's some output:

> Unfortunately the second try resulted in a hang.  That was 13 minutes
> ago, at 08:43.  Attached is dmesg output for the two tries.
> 
> The last entry is:  "usb-storage: bus_reset called"
> 
> David

> usb-storage: queuecommand called
> usb-storage: *** thread awakened.
> usb-storage: Command TEST_UNIT_READY (6 bytes)
> usb-storage:  00 00 00 00 00 00
> usb-storage: Bulk Command S 0x43425355 T 0x37 L 0 F 0 Trg 0 LUN 0 CL 6
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x37 R 0 Stat 0x0
> usb-storage: result = 0
> usb-storage: Transport returns result = 327680

It looks like something is changing the value stored in srb->result when 
it's not supposed to.  How strange...

Try using this patch instead of the earlier one.  It does a finer 
subdivision of the code, so maybe it will give a better clue as to where 
the problem occurs.

Alan Stern 



--- a/drivers/usb/storage/transport.c   Fri Dec 17 14:00:19 2004
+++ b/drivers/usb/storage/transport.c   Fri Dec 31 12:20:10 2004
@@ -533,6 +533,7 @@
        /* send the command to the transport layer */
        srb->resid = 0;
        result = us->transport(srb, us);
+       US_DEBUGP("Transport result = %x\n", result);
 
        /* if the command gets aborted by the higher layers, we need to
         * short-circuit all other processing
@@ -557,6 +558,7 @@
        }
 
        srb->result = SAM_STAT_GOOD;
+       US_DEBUGP("srb result1 = %x\n", srb->result);
 
        /* Determine if we need to auto-sense
         *
@@ -599,6 +601,7 @@
              (srb->cmnd[0] == MODE_SENSE_10))) {
                US_DEBUGP("-- unexpectedly short transfer\n");
        }
+       US_DEBUGP("srb result2 = %x\n", srb->result);
 
        /* Now, if we need to do the auto-sense, let's do it */
        if (need_auto_sense) {
@@ -711,17 +714,20 @@
                        srb->sense_buffer[0] = 0x0;
                }
        }
+       US_DEBUGP("srb result3 = %x\n", srb->result);
 
        /* Did we transfer less than the minimum amount required? */
        if (srb->result == SAM_STAT_GOOD &&
                        srb->request_bufflen - srb->resid < srb->underflow)
                srb->result = (DID_ERROR << 16) | (SUGGEST_RETRY << 24);
 
+       US_DEBUGP("srb result4 = %x\n", srb->result);
        return;
 
        /* abort processing: the bulk-only transport requires a reset
         * following an abort */
   Handle_Abort:
+       US_DEBUGP("Handle_Abort\n");
        srb->result = DID_ABORT << 16;
        if (us->protocol == US_PR_BULK)
                us->transport_reset(us);



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to