pik33
Posts: 195
Joined: Thu Sep 10, 2015 4:26 pm

RPi4 - incompatible (?) usb device

Fri Jul 05, 2019 10:25 am

A HDD USB3 enclosure. With 240 GB SATA SSD inside.

Code: Select all

[  471.717251] usb 2-1: new SuperSpeed Gen 1 USB device number 6 using xhci_hcd
[  471.758225] usb 2-1: New USB device found, idVendor=152d, idProduct=0578, bcdDevice= 2.04
[  471.758232] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  471.758236] usb 2-1: Product: USB to ATA/ATAPI Bridge
[  471.758239] usb 2-1: Manufacturer: JMicron
[  471.758243] usb 2-1: SerialNumber: 0123456789ABCDEF
[  471.765410] scsi host0: uas
[  471.766381] scsi 0:0:0:0: Direct-Access     JMicron  Generic          0204 PQ: 0 ANSI: 6
[  471.771996] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  476.595243] sd 0:0:0:0: [sda] 468862128 512-byte logical blocks: (240 GB/224 GiB)
[  476.595249] sd 0:0:0:0: [sda] 4096-byte physical blocks
[  476.595436] sd 0:0:0:0: [sda] Write Protect is off
[  476.595441] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[  476.595807] sd 0:0:0:0: [sda] Disabling FUA
[  476.595813] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  476.596396] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
[  476.605495]  sda: sda1 sda2 sda3
[  476.607801] sd 0:0:0:0: [sda] Attached SCSI disk
This thing works when connected to USB 2.0 at over 30 MB/s. When connected to usb3.0 in the same RPi it also works, but the read speed is then about 1 MB/s as if it is USB 1

G160
Posts: 25
Joined: Sun Dec 23, 2012 1:32 pm

Re: RPi4 - incompatible (?) usb device

Fri Jul 05, 2019 11:36 am

Im pretty sure there is a problem with the uas driver compatibility with a lot of usb enclosures, there's a lot of problems being reported with usb3 on the pi4.

I have a workaround that forces the enclosure to use the usb-storage driver, but performance takes a slight hit, and its not completely fixed the issue as I still get a lot of hanging, and file transfers stopping, so I guess its best to wait for the smart people at the pi foundation to get a proper fix in place.

jerrm
Posts: 202
Joined: Wed May 02, 2018 7:35 pm

Re: RPi4 - incompatible (?) usb device

Fri Jul 05, 2019 1:19 pm

G160 wrote:
Fri Jul 05, 2019 11:36 am
Im pretty sure there is a problem with the uas driver compatibility with a lot of usb enclosures, there's a lot of problems being reported with usb3 on the pi4.
To be fair, it's more a Linux issue than a a Pi-specific issue. I don't know if the Pi exacerbates things, but I've had the same issues for years with UAS on Linux.

G160
Posts: 25
Joined: Sun Dec 23, 2012 1:32 pm

Re: RPi4 - incompatible (?) usb device

Fri Jul 05, 2019 3:21 pm

jerrm wrote:
Fri Jul 05, 2019 1:19 pm
G160 wrote:
Fri Jul 05, 2019 11:36 am
Im pretty sure there is a problem with the uas driver compatibility with a lot of usb enclosures, there's a lot of problems being reported with usb3 on the pi4.
To be fair, it's more a Linux issue than a a Pi-specific issue. I don't know if the Pi exacerbates things, but I've had the same issues for years with UAS on Linux.
You may well be right, this is my only Linux device with USB3 so I've never run into the problem before.
Its seems pretty widespread, 2 out of my 4 USB3 enclosures seem to be suffering from this issue, all work fine on USB2.

User avatar
rpdom
Posts: 17725
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: RPi4 - incompatible (?) usb device

Fri Jul 05, 2019 3:35 pm

It is possible that it is a USB implementation issue with the device itself.

Some manufacturers make assumptions about the standards based on what a certain mainstream OS does.

I'm not saying this is the case here, but I remember using a particular USB flash drive some years ago which needed a Linux kernel patch to work.
It turned out that it ignored a parameter on how many bytes it should return and just gave what Windows expected.

Windows said "Send me this info in up to 64 bytes".
Device said "Here is your 64 bytes of data" and sent 64 bytes of data.

Linux said "Send me this data in up to 256 bytes".
Device said "Here is your 256 bytes of data" and sent 64 bytes of data.
Linux kernel sat there waiting for the rest... until it was patched to say "Ignore the shooty dog thing size this particular device claims to send, it will only ever send 64 bytes"
Unreadable squiggle

G160
Posts: 25
Joined: Sun Dec 23, 2012 1:32 pm

Re: RPi4 - incompatible (?) usb device

Fri Jul 05, 2019 4:04 pm

rpdom wrote:
Fri Jul 05, 2019 3:35 pm
It is possible that it is a USB implementation issue with the device itself.

Some manufacturers make assumptions about the standards based on what a certain mainstream OS does.

I'm not saying this is the case here, but I remember using a particular USB flash drive some years ago which needed a Linux kernel patch to work.
It turned out that it ignored a parameter on how many bytes it should return and just gave what Windows expected.

Windows said "Send me this info in up to 64 bytes".
Device said "Here is your 64 bytes of data" and sent 64 bytes of data.

Linux said "Send me this data in up to 256 bytes".
Device said "Here is your 256 bytes of data" and sent 64 bytes of data.
Linux kernel sat there waiting for the rest... until it was patched to say "Ignore the shooty dog thing size this particular device claims to send, it will only ever send 64 bytes"
You may be right, but would that theory be consistent with the fact all my drives work under usb2?

jerrm
Posts: 202
Joined: Wed May 02, 2018 7:35 pm

Re: RPi4 - incompatible (?) usb device

Fri Jul 05, 2019 5:48 pm

G160 wrote:
Fri Jul 05, 2019 3:21 pm
You may well be right, this is my only Linux device with USB3 so I've never run into the problem before.
Its seems pretty widespread, 2 out of my 4 USB3 enclosures seem to be suffering from this issue, all work fine on USB2.
It is very common. If I went to the Micro Center down the street and picked up every usb enclosure/adapter/device/external HD they have I would bet at least a 3rd would have uas/usb 3.0 issues in Linux when Windows is fine. USB2 will (virtually) always work.

It's amazing how much is still out there with older chips when newer revisions are available.

Plenty of hits googling the JMicron chip you listed.

pik33
Posts: 195
Joined: Thu Sep 10, 2015 4:26 pm

Re: RPi4 - incompatible (?) usb device

Fri Jul 05, 2019 6:11 pm

We need a list of compatible USB3 devices as it now seems I bought a piece of trash :(

User avatar
HawaiianPi
Posts: 6001
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: RPi4 - incompatible (?) usb device

Fri Jul 05, 2019 6:45 pm

pik33 wrote:
Fri Jul 05, 2019 6:11 pm
We need a list of compatible USB3 devices as it now seems I bought a piece of trash :(
Such a list would be exceedingly difficult to maintain. Many of those devices are manufactured by companies that don't have direct sales. The devices are purchased in bulk by lots of different sellers who may have multiple items under the same SKU, or change product suppliers without creating a new SKU.

However, such lists likely already exist. Look for USB 3.0 enclosures recommended for Linux, or something along those lines. But don't be surprised if you order from one of those lists and receive something different.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

pask876
Posts: 1
Joined: Fri Sep 06, 2019 12:21 pm

Re: RPi4 - incompatible (?) usb device

Fri Sep 06, 2019 12:46 pm

pik33 wrote:
Fri Jul 05, 2019 6:11 pm
We need a list of compatible USB3 devices as it now seems I bought a piece of trash :(
Here is a site with a list of working chipset: http://linux-sunxi.org/USB/UAS

In my experience products with Via Labs Sata Bridge controller VL715 (device ID 2109:0715), advertised as providing till 10Gbps using UAS, actually have a crap UASP implementation which doesn't work with the linux kernel, at least the 4.19. This is the case of Orico 's products sold on Amazon. If you have one of these, you''l have to force the kernel to swith to the usb-storage protocol to use it. One way to force usb-storage protocol, is to add a quirk to the kernel boot params line in boot/boot.ini
usb-storage.quirks=0x2109:0x0715:u"

On the other hand, startech.com UAS product sold by Amazon too, fully work in UAS mode (I don't know which chip they use... can't verify as I don't have it with me now)

Return to “Troubleshooting”