Raspberry Pi , USB resets and USB to SATA converters

EDIT: 2013-02-03 : There is still an issue, not quite the same though.  My continuing notes here.

How to reproduce

Connect a SATA drive (2.5" or 3.5") to your Raspberry Pi (256MB or 512MB and one of many firmware versions) via a USB to SATA converter and put "a lot" of traffic on the USB bus.  (In my case it was a remote rsync to the USB drive so I had traffic flow over the Ethernet/USB and USB/SATA converter and indeed a third flow because I was using a pppoatm bridge).  So every bit flowed throughthe USB bus 3 times.  my flow rate was around 20Mbit/s.

After a period of time (not always the same) all would come crashing down and this would be my syslog entry:

[ 1470.343321] usb 1-1.3: reset high-speed USB device number 4 using dwc_otg
[ 1470.423323] usb 1-1.3: device descriptor read/64, error -71
[ 1470.613336] usb 1-1.3: device descriptor read/64, error -71
[ 1470.803363] usb 1-1.3: reset high-speed USB device number 4 using dwc_otg
[ 1470.883523] usb 1-1.3: device descriptor read/64, error -71
[ 1471.073276] usb 1-1.3: device descriptor read/64, error -71
[ 1471.263296] usb 1-1.3: reset high-speed USB device number 4 using dwc_otg
[ 1471.683173] usb 1-1.3: device not accepting address 4, error -71
[ 1471.763244] usb 1-1.3: reset high-speed USB device number 4 using dwc_otg
[ 1472.183089] usb 1-1.3: device not accepting address 4, error -71
[ 1472.183519] sd 0:0:0:0: Device offlined - not ready after error recovery
[ 1472.183665] sd 0:0:0:0: [sda] Unhandled error code
[ 1472.183684] sd 0:0:0:0: [sda]  Result: hostbyte=0x05 driverbyte=0x00
[ 1472.183705] sd 0:0:0:0: [sda] CDB: cdb[0]=0x2a: 2a 00 01 c0 08 48 00 00 08 00
[ 1472.183746] end_request: I/O error, dev sda, sector 29362248
[ 1472.183770] Buffer I/O error on device sda1, logical block 3670025
[ 1472.183785] lost page write due to I/O error on sda1
[ 1472.183849] sd 0:0:0:0: rejecting I/O to offline device
[ 1472.183874] sd 0:0:0:0: [sda] killing request
[ 1472.183910] sd 0:0:0:0: rejecting I/O to offline device
[ 1472.184061] sd 0:0:0:0: [sda] Unhandled error code
[ 1472.184081] sd 0:0:0:0: [sda]  Result: hostbyte=0x01 driverbyte=0x00
[ 1472.184100] sd 0:0:0:0: [sda] CDB: cdb[0]=0x2a: 2a 00 09 04 08 90 00 00 08 00
[ 1472.184139] end_request: I/O error, dev sda, sector 151259280
[ 1472.184159] Buffer I/O error on device sda1, logical block 18907154
[ 1472.184172] lost page write due to I/O error on sda1
[ 1472.184247] usb 1-1.3: USB disconnect, device number 4
[ 1472.190565] Buffer I/O error on device sda1, logical block 3994816
[ 1472.190601] Buffer I/O error on device sda1, logical block 3994817
[ 1472.190619] Buffer I/O error on device sda1, logical block 3994818

Attempts to fix it

  1. I thought at first it may be the HDD I was using (the Converter working on both Linux and Windows and various devices without issue), but after trying an IDE, SATA and 2.5" SATA drive all exhibited the issue.  So not the converter and not the drive.
  2. I thought will all the USB interupts in the Pi > 6000/s perhaps I needed to over clock to ensure there was sufficient processing resource to service the interrupts.  Tried this, I'm not convinced there was any difference.
  3. The famous power issues (any goes wrong with a Raspberry Pi people immediate blame volt drop) - wasn't that.  I used external power and monitored the 5v lines.  No issue there.
  4. Finally I ordered a new converter and this seems to have (thus far) been more stable.

 

 

This device never seems to need (or receive) the reset (Amazon:USB 2.0 to SATA 7+15 Pin Adapter Cable for 2.5" HDD Hard Disk Drive)

[  116.050739] usb 1-1.3.1: New USB device found, idVendor=05e3, idProduct=0718
[  116.050768] usb 1-1.3.1: New USB device strings: Mfr=0, Product=1, SerialNumber=2
[  116.050785] usb 1-1.3.1: Product: USB Storage

lsusb shows it as a "Genesys Logic, Inc. IDE/SATA Adapter"

 

This device does get the reset and doesn't handle it well

[   25.935284] usb 1-1.3: New USB device found, idVendor=152d, idProduct=2338
[   25.935336] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[   25.935351] usb 1-1.3: Product: USB to ATA/ATAPI Bridge
[   25.935362] usb 1-1.3: Manufacturer: JMicron

lsusb shows this as a "JMicron Technology Corp. / JMicron USA Technology Corp. JM20337 Hi-Speed USB to SATA & PATA Combo Bridge"

By just changing the USB to SATA converter the problem went away, but I still don't know why.

One difference that seems to be significant is that even though the original (JMicron) was externally powered from an AC adapter it was registered (lsusb -v) as "Self Powered".   The newer one (powered by a USB hub) shows as "Self Powered".