On Thu, 20 Mar 2003, Matthew Dharm wrote: > On Thu, Mar 20, 2003 at 05:01:46PM -0500, Alan Stern wrote: > > After inserting a 1Gb Microdrive into the card reader and attempting to > > mount it (following a successful MODE-SENSE): > > > > > usb-storage: queuecommand() called > > > usb-storage: *** thread awakened. > > > usb-storage: Command READ_10 (10 bytes) > > > usb-storage: 28 00 00 00 00 00 00 00 08 00 9b cf > > > usb-storage: Bulk command S 0x43425355 T 0x14 Trg 0 LUN 0 L 4096 F 128 CL 10 > > > usb-storage: Bulk command transfer result=0 > > > usb-storage: usb_stor_transfer_partial(): xfer 4096 bytes > > > usb-storage: command_abort() called > > > usb-storage: usb_stor_bulk_msg() returned -104 xferred 0/4096 > > > > So at this point the urb's completion routine has been called. -104 is > > -ECONNRESET, indicating the urb was unlinked by the abort routine. > > That timeout should be about 20 seconds or so. > > > > usb-storage: usb_stor_transfer_partial(): transfer aborted > > > usb-storage: Bulk data transfer result 0x3 > > > usb-storage: -- transport indicates command was aborted > > > usb-storage: scsi command aborted > > > usb-storage: *** thread sleeping. > > > usb-storage: queuecommand() called > > > usb-storage: *** thread awakened. > > > usb-storage: Command TEST_UNIT_READY (6 bytes) > > > usb-storage: 00 00 00 00 00 00 00 00 08 00 9b cf > > > usb-storage: Bulk command S 0x43425355 T 0x14 Trg 0 LUN 0 L 0 F 0 CL 6 > > > uhci.c: uhci_submit_urb: urb not available to submit (status = -104) > > > > What's that?! Any ideas from anybody? > > I've never seen it before. I'm wondering if the URB didn't get aborted > properly.
Well, I think the urb is getting aborted okay, and the problem is with the next submission. Look at this suspicious code from uhci_submit_urb() in host/uhci.c: if (urb->status == -EINPROGRESS || urb->status == -ECONNRESET || urb->status == -ECONNABORTED) { dbg("uhci_submit_urb: urb not available to submit (status = %d)", urb->status); <snip> return ret; } An urb that was unlinked asynchronously (and hence has status == -ECONNRESET) can't be resubmitted until its status has been changed! Below is a patch that will fix this problem for usb-storage, at least. A more general fix will ultimately be needed, because this problem can affect every USB driver. Dave, please try this patch, see what happens, and send another kernel log extract. I don't think it will fix everything because it doesn't address the root of your problem: your Microdrive isn't reading and returning the data from the disc (or it's taking longer than 20 seconds to do so). But it will move us one step closer towards solving this. Alan Stern --- 2.4.21-pre5/drivers/usb/storage/transport.c.orig Fri Mar 21 10:22:03 2003 +++ 2.4.21-pre5/drivers/usb/storage/transport.c Fri Mar 21 10:32:51 2003 @@ -388,6 +388,7 @@ us->current_urb->actual_length = 0; us->current_urb->error_count = 0; us->current_urb->transfer_flags = USB_ASYNC_UNLINK; + us->current_urb->status = 0; /* submit the URB */ status = usb_submit_urb(us->current_urb); @@ -434,6 +435,7 @@ us->current_urb->actual_length = 0; us->current_urb->error_count = 0; us->current_urb->transfer_flags = USB_ASYNC_UNLINK; + us->current_urb->status = 0; /* submit the URB */ status = usb_submit_urb(us->current_urb); ------------------------------------------------------- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel