Bug 5894
Summary: | usb-storage freezes during large file transfers | ||
---|---|---|---|
Product: | Drivers | Reporter: | Paul (paul14075) |
Component: | USB | Assignee: | Alan Stern (stern) |
Status: | CLOSED CODE_FIX | ||
Severity: | high | CC: | domi.dumont, greg, protasnb, sasakara, stern, tsg-swdev, zaitcev |
Priority: | P2 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | 2.6.15 | Subsystem: | |
Regression: | --- | Bisected commit-id: | |
Bug Depends on: | |||
Bug Blocks: | 5089 | ||
Attachments: |
usbmon output from freeze
experimental patch Reset even if there are multiple interfaces |
Description
Paul
2006-01-14 21:26:19 UTC
A log like that is useless. We know that usb-storage's logging sucks, but there may be a workaround. If you keep a "dmesg > /tmp/d.out" poised at a bash prompt and hit enter the moment you detect a hang, it will get the tail of the buffer intact. Getting a usbmon trace may be useful, too (to rule out interaction with some other process). See /usr/src/linux/Documentation/usb/usbmon.txt. I have to warn you, storage logging may be only the first step to the resolution. If the thing hangs because of VM problems, or because of EHCI problems, it's going to be a long haul. Does any older kernel work? If yes, which one? Here is the result of running "dmesg > /tmp/d.out" about a second after I noticed the freeze. rage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a e8 55 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x5685c L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x5685c R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a e8 d5 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x5685d L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x5685d R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a e9 55 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x5685e L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x5685e R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a e9 d5 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x5685f L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x5685f R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ea 55 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56860 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56860 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ea d5 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56861 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56861 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a eb 55 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56862 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56862 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a eb d5 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56863 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56863 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ec 55 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56864 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56864 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ec d5 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56865 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56865 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ed 55 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56866 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56866 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ed d5 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56867 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56867 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ee 55 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56868 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56868 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ee d5 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x56869 L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x56869 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ef 55 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x5686a L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code 0; transferred 65536/65536 usb-storage: -- transfer complete usb-storage: Bulk data transfer result 0x0 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 0x5686a R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. usb-storage: queuecommand called usb-storage: *** thread awakened. usb-storage: Command READ_10 (10 bytes) usb-storage: 28 00 0a 5a ef d5 00 00 80 00 usb-storage: Bulk Command S 0x43425355 T 0x5686b L 65536 F 128 Trg 0 LUN 0 CL 10 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: usb_stor_bulk_transfer_sglist: xfer 65536 bytes, 16 entries usb-storage: Status code -121; transferred 36867/65536 usb-storage: -- short read transfer usb-storage: Bulk data transfer result 0x1 usb-storage: Attempting to get CSW... usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes usb-storage: Status code -75; transferred 0/13 usb-storage: -- babble usb-storage: Bulk status result = 3 usb-storage: -- transport indicates error, resetting usb-storage: Refusing to reset a multi-interface device usb-storage: usb_stor_Bulk_reset called usb-storage: usb_stor_control_msg: rq=ff rqtype=21 value=0000 index=00 len=0 [root@titan tmp]# Created attachment 7028 [details]
usbmon output from freeze
This is the usbmon output from the freeze. I started usbmon about 5 seconds
before the freeze occured, the file transfer was stalled for about 40 seconds,
then it resumed, then I stopped usbmon about 5 seconds later. Its a 2MB file
compressed, cus bugzilla wont let me upload a 2mb file....
OK, I ran the usbmon like you asked. I started usbmon, copied a large file from the USB hard drive, and sure enough, the freeze did occur. I attached the usbmon output as usbmon.txt.tar.gz. (The uncompressed file was 2MB [about 1 minute of usbmon capturing], so I had to compress [tar.gz] it in order to upload it here. No, I haven't tried any other kernels, as I just got the USB hard drive recently, and before that, I never used USB for anything. If there's a kernel you'd like me to try, just let me know. Thanks again! Created attachment 7029 [details]
experimental patch
worth trying this patch ... might not help, but might.
I suspect this is an ordinary sort of data transfer error. Replacing USB cables might help. It's made more complicated by the fact that the device has multiple interfaces, so usb-storage won't do its normal port reset. What does "lsusb -v" show for the drive? I really dont think this is an ordinary data transfer problem. It happens VERY consistently in linux, and NEVER AT ALL in windows (exact same hardware, PC is dual boot). The drive and cable are less than 4 months old. I'm gonna try the patch later tonight. Here's the drive's lsusb -v: Bus 001 Device 002: ID 1058:0404 Western Digital Technologies, Inc. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x1058 Western Digital Technologies, Inc. idProduct 0x0404 bcdDevice 6.02 iManufacturer 1 Western Digital iProduct 2 External HDD iSerial 3 57442D5743414C3736313631333830 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 57 bNumInterfaces 2 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 8 Mass Storage bInterfaceSubClass 6 SCSI bInterfaceProtocol 80 Bulk (Zip) iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Devices bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.10 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 34 Report Descriptor: (length is 34) Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440 (null) Item(Local ): Usage, data= [ 0xa5 ] 165 (null) Item(Main ): Collection, data= [ 0x01 ] 1 Application Item(Local ): Usage, data= [ 0xa6 ] 166 (null) Item(Local ): Usage, data= [ 0xa7 ] 167 (null) Item(Global): Logical Minimum, data= [ 0x80 ] 128 Item(Global): Logical Maximum, data= [ 0x7f ] 127 Item(Global): Report Size, data= [ 0x08 ] 8 Item(Global): Report Count, data= [ 0x02 ] 2 Item(Main ): Input, data= [ 0x02 ] 2 Data Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Non_Volatile Bitfield Item(Local ): Usage, data= [ 0xa9 ] 169 (null) Item(Global): Logical Minimum, data= [ 0x80 ] 128 Item(Global): Logical Maximum, data= [ 0x7f ] 127 Item(Global): Report Size, data= [ 0x08 ] 8 Item(Global): Report Count, data= [ 0x02 ] 2 Item(Main ): Output, data= [ 0x02 ] 2 Data Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Non_Volatile Bitfield Item(Main ): End Collection, data=none Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 10 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 1 I am going to parse the usbmon output here. It adds nothing radically new to Alan's asessement, only some curious details. It shows a data transfer error (a bad cable or other, or a small bug in EHCI HCD), and failing to recover. This is no different for ub, by the way, because ub uses the same reset sequence as usb-storage. We submit a command, device responds, we submit data transfers (64KB): f7542100 3328941948 S Bo:002:01 -115 31 = 55534243 c9640000 00000100 80000a28 000a8770 95000080 00000000 000000 f7542100 3328942090 C Bo:002:01 0 31 > f1852a00 3328942107 S Bi:002:02 -115 8192 < f1852e00 3328942109 S Bi:002:02 -115 8192 < f1ee7400 3328942110 S Bi:002:02 -115 8192 < f1852780 3328942110 S Bi:002:02 -115 8192 < f1852280 3328942111 S Bi:002:02 -115 8192 < f1c51200 3328942112 S Bi:002:02 -115 8192 < f1c51f80 3328942113 S Bi:002:02 -115 8192 < f1852f80 3328942114 S Bi:002:02 -115 8192 < Data transfers fail midway with a code 121 -EREMOTEIO: f1852a00 3328943591 C Bi:002:02 0 8192 = 2bb6ed3a 6558923c 4978ad3f 9aa6a990 ded84311 c10c7f7c 91583281 1bd54299 f1852e00 3328943595 C Bi:002:02 0 8192 = f624946f 7ac16a34 44c927fc 1db0de7e eae04748 c8b3ef80 7b494b5a f1728064 f1ee7400 3328943596 C Bi:002:02 0 8192 = b03fdfa3 b4697855 0872af96 7d674645 3275f0e6 ddcfdadf 32f7b482 f8d8107a f1852780 3328943597 C Bi:002:02 0 8192 = 37d52070 0f65c53b adb66180 34ec17d0 3d8d0669 f0760c4c 5eaa9b97 749ffe83 f1852280 3328943598 C Bi:002:02 0 8192 = 4f24e29f 9952c61c 4d140387 97cc9f2e f1a823f4 9c751096 3d7f2989 8326b70c f1c51200 3328943599 C Bi:002:02 -121 4 = c672b92d f1c51f80 3328943602 C Bi:002:02 -104 0 f1852f80 3328943603 C Bi:002:02 -104 0 We read status, but get a bubble (presumably there's plenty of data pipelined yet): f7542100 3328943619 S Bi:002:02 -115 13 < f7542100 3328944091 C Bi:002:02 -75 0 We do a quick bulk reset and clear halts (+6s wait) f7542100 3328944111 S Co:002:00 s 21 ff 0000 0000 0000 0 f7542100 3328944466 C Co:002:00 0 0 f7542100 3334942799 S Co:002:00 s 02 01 0000 0082 0000 0 f7542100 3334943896 C Co:002:00 0 0 f7542100 3334943909 S Co:002:00 s 02 01 0000 0001 0000 0 f7542100 3334944393 C Co:002:00 0 0 We retry the read and it fails with a simple timeout, which eats 30s: f7542100 3334944523 S Bo:002:01 -115 31 = 55534243 ca640000 00000100 80000a28 000a8770 95000080 00000000 000000 f7542100 3334944768 C Bo:002:01 0 31 > f1852a00 3334944786 S Bi:002:02 -115 8192 < f1852e00 3334944788 S Bi:002:02 -115 8192 < f1ee7400 3334944790 S Bi:002:02 -115 8192 < f1852780 3334944791 S Bi:002:02 -115 8192 < f1852280 3334944792 S Bi:002:02 -115 8192 < f1c51200 3334944793 S Bi:002:02 -115 8192 < f1c51f80 3334944794 S Bi:002:02 -115 8192 < f1852f80 3334944795 S Bi:002:02 -115 8192 < f1852a00 3334950793 C Bi:002:02 0 8192 = 55534243 ca640000 00000100 80000a28 000a8770 95000080 00000000 00000075 f1852e00 3334950795 C Bi:002:02 0 8192 = 68fdd165 94a9bc2a 44f328bb b91116a0 b98b3ce6 2d8cfb3d b65ba60a a480d5f7 f1ee7400 3364944910 C Bi:002:02 -104 5120 = d1b5ee14 26d57fec 9f587441 6c39d6fa b1e12ef0 7d34cbdd e18f07be 3560fc11 f1852780 3364944919 C Bi:002:02 -104 0 f1852280 3364944920 C Bi:002:02 -104 0 f1c51200 3364944921 C Bi:002:02 -104 0 f1c51f80 3364944922 C Bi:002:02 -104 0 f1852f80 3364944923 C Bi:002:02 -104 0 Bulk reset again, and a 6s wait: f7542100 3364944948 S Co:002:00 s 21 ff 0000 0000 0000 0 f7542100 3364945281 C Co:002:00 0 0 f7542100 3370945048 S Co:002:00 s 02 01 0000 0082 0000 0 f7542100 3370946211 C Co:002:00 0 0 f7542100 3370946224 S Co:002:00 s 02 01 0000 0001 0000 0 f7542100 3370946583 C Co:002:00 0 0 Next command succeeds and we continue on our way, with 42s lost. By the way, it's a good thing that the device timed out after the first reset, because it transfered garbage. Normal data looked like this: f1852a00 3328943591 C Bi:002:02 0 8192 = 2bb6ed3a 6558923c 4978ad3f 9aa6a990 ded84311 c10c7f7c 91583281 1bd54299 .... looks like a compressed media stream. But after the reset it looked like this: f1852a00 3334950793 C Bi:002:02 0 8192 = 55534243 ca640000 00000100 80000a28 000a8770 95000080 00000000 00000075 .... which is the echo of the command which was just sent! The first bulk reset did not reset the device and its firmware got all confused. I think we really need to work on lifting the limitation of not doing port resets on multi-interface devices. It's a miracle that we did not end with a data corruption here. Created attachment 7034 [details]
Reset even if there are multiple interfaces
"I really dont think this is an ordinary data transfer problem. It happens
VERY
consistently in linux, and NEVER AT ALL in windows (exact same hardware, PC is
dual boot)."
You're missing the point. It probably _is_ happening with Windows, and you
just aren't aware of it because Windows is able to recover and continue the
data transmission in a fraction of a second. usb-storage would do the same
thing if your device didn't have a second interface. Note that the age of a
device or a cable means nothing -- some vendors sell computers with bad
internal cables connecting the motherboard to the front USB ports on the case!
The attached patch will cause usb-storage to ignore the second interface and
perform the reset anyway. I bet it will fix your problem. (It might mess up
that other interface, though.)
By the way, what is the other interface used for? Does the drive have some
buttons you can press, or a slider, or anything else of that sort?
Alan, you were indeed correct. I tried your patch first, and it worked like a charm! I transferred a few gigs without one single noticeable pause, not even any 6 second pauses. THANK YOU! I'll take your advice on replacing the USB cable. I'm definitely glad this problem didnt lead to any data corruption. The only thing I noticed now were these lines: Jan 16 00:10:42 titan kernel: usb 1-6: reset high speed USB device using ehci_hcd and address 2 Jan 16 00:11:15 titan last message repeated 2 times Jan 16 00:12:43 titan kernel: usb 1-6: reset high speed USB device using ehci_hcd and address 2 I assume this is OK, and is probably just indicitive of my need for a new USB cable, and wont lead to any data corruption :) In regards to the drive, its a Western Digital "Dual-Option Backup" drive. Which means that it has a useless button on the front that, had I ever installed its software, would let me spawn a backup-process by pressing... It also has a useless LED on the front that is supposed to tell me when I'm due for a backup..... Useless marketing gimmicks...If the patch broke these things, I couldn't possibly care less, because I've never used them. Thanks a ton for all your help guys! -Paul Good that the patch helped. We need to change the kernel to avoid this sort of problem coming up again in the future. Would you be willing to try out other patches in the future, to make sure they work properly? Don't automatically assume that the cable is at fault. I've got a USB disk drive that doesn't work with one cable and does work with another. However, other USB devices work with both cables, and the drive and cable work together when plugged into a different computer! So all you can be certain of is that the combination of USB-controller/cable/drive is a bad one. I would absolutely be willing to help with any furthur patching/testing. Just let me know. Alan, you seem to want to take this one on :) Alan, any thoughts? Yes, sorry I've been out of touch on this. If they're not at the center of my attention, bug reports tend to just fade away... out of sight, out of mind. To do this right will require a change to usbcore: sending notifications to drivers when a device is about to be reset or has just been reset. Not many drivers will be affected very much; the only ones I'm certain of are usb-hid and usb-storage. I'll post something on linux-usb-devel when it's ready. I am probably having a similar problem. In the kernel log (I don't have USB debugging turned on at the moment), these 3 lines repeat: usb 3-5: reset high speed USB device using ehci_hcd and address 5 sd 2:0:0:0: SCSI error: return code = 0x70000 end_request: I/O error, dev sdc, sector 154221 The device works when plugged to a slow "full speed" (12 Mbit) hub. I have an Asus A7N8X-E motherboard with an NForce 2 chipset which, as far as I know, doesn't have a good reputation in Linux. I am using the latest Fedora Core 5 kernel (2.6.16-1.2122_FC5). The weird thing is that I have a flash-disk which works fine always, and one which only works sometimes and in some USB ports/slots. Another thing is that sometimes it works even if plugged to a front-panel USB port (which might have bad cables) and after a power off/on, it doesn't work any more. The same devices work always well in my laptop (with an Intel chipset). I posted a comment to bug 4057, but it is closed now. You are experiencing a different problem. I didnt get any SCSI errors or I/O errors. My whole problem stemmed from the fact that the usb driver REFUSED to reset my device, but your device is in fact being reset, so I think your problem is unrelated to the bug. I had a similar problem with the Asus (VIA usb chip) motherboard. When I connected my mp3 player it would apparently randomly disconnect. On foot of a comment on the web I bought a pci usb card with an NEC chip (Belkin make the card). All appears to be well now. Alan, I suspect you've done the fix that you intended in #16 since many problems with USB reset has gone away. Should we keep this bug open? --Natalie Yes, the change has been made. Closing the bug report. Ahem, I still have usb lockup on AMD 64 2.6.21. Should I file another bug report or provide more information in this bug report ? Dominique, please start a new bug report and put the details there. To respond to #17: Alexandr, if you feel your issue hasn't been addressed yet please test with latest kernel from kernel.org and if the problem still there file a new bug also. Thanks. |