0

I tried to find a solution the whole day until now 3am. I'm cooked.

I am running Ubuntu on a Raspberry Pi with USB 3 and connected to it some external storage enclosures via a USB hub. One of them is controlled by JMicron controller. lsusb

Bus 002 Device 003: ID 152d:0567 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge

In the dmesg I can see it is blacklisted for some reason.

[    2.134591] usb 2-2.1: new SuperSpeed Gen 1 USB device number 3 using xhci_hcd
[    2.155251] usb 2-2.1: New USB device found, idVendor=152d, idProduct=0567, bcdDevice= 2.05
[    2.155259] usb 2-2.1: New USB device strings: Mfr=10, Product=11, SerialNumber=5
[    2.155264] usb 2-2.1: Product: USB to ATA/ATAPI Bridge
[    2.155268] usb 2-2.1: Manufacturer: JMicron
[    2.155272] usb 2-2.1: SerialNumber: 152D00539000
[    2.169663] usb-storage 2-2.1:1.0: USB Mass Storage device detected
[    2.169914] usb-storage 2-2.1:1.0: Quirks match for vid 152d pid 0567: 5000000
[    2.169997] scsi host0: usb-storage 2-2.1:1.0
[    2.170329] usbcore: registered new interface driver usb-storage
[    2.173030] usbcore: registered new interface driver uas

It says registered for the interface driver uas.

However it is not used. I believe because of the Quirks. lsmod gives

uas                    28672  0
usb_storage            81920  6 uas

I read it this way. 6 uas capable devices use usb_storage driver instead of uas. I believe this is because of the Quirks (I hate that word).

I tried many things, many of which I do not remember anymore, brain is a pudding.

My goal is to unblacklist these devices. How can I do that?

Let me know any information you need if you can help and I shall provide.

5
  • 3
    How are you determining that the device is blacklisted? Commented Jul 31, 2021 at 0:56
  • And how do you know it is not used? USB storage devices are recognized as SCSI disks on Linux; what does lsblk tell you, and dmesg | grep sd? Commented Jul 31, 2021 at 4:55
  • @larsks The line [ 2.169914] usb-storage 2-2.1:1.0: Quirks match for vid 152d pid 0567: 5000000 means a match was found for a quirks, which afaik means that somehow it is blacklisted. Commented Jul 31, 2021 at 6:18
  • @berndbausch in my post I list modules (amongst them drivers). uas does not show usage, but usb_storage does. lsblk shows the disk property and I can use it, but only with limited speed. Regarding dmesg and sd: I see the devices are used with the scsi interface. That is not my problem. My problem is that usb_storage driver is used instead of uas, which can be translated to: the system uses usb 2 instead of usb 3 - that is my problem. This can popularly happen on a raspberry pi unfortunately. Commented Jul 31, 2021 at 6:23
  • 2
    From what I read this is done to protect you. You might like to read the overview here smartmontools.org/wiki/SAT-with-UAS-Linux if I read that right the kernel is disabling it because it thinks the chipset is functionally broken. Commented Jul 31, 2021 at 7:41

1 Answer 1

2

The JMicron JMS567 does not work properly, at least does it not operate as expected. So do not expect anything to get better, when enabling uas for that device.

Quirks are workarounds for firmware implementation bugs and a "quirk" was added for the JMS567 quite a while ago.

According to the Kernel parameter documentation a quirk can be disabled by setting an empty quirk.

Quoting the the usbcore.quirks documentation:

usbcore.quirks=
        [USB] A list of quirk entries to augment the built-in
        usb core quirk list. List entries are separated by
        commas. Each entry has the form
        VendorID:ProductID:Flags. The IDs are 4-digit hex
        numbers and Flags is a set of letters. Each letter
        will change the built-in quirk; setting it if it is
        clear and clearing it if it is set. [...]

Please note, that this is from the usbcore.quirks documentation, the usb-storage.quirks does not mention "setting it if it is clear and clearing it if it is set."

Anyway, to unblacklist the device, the following should work:

% sudo rmmod uas usb-storage
% sudo modprobe usb-storage quirks=152d:0567:
% sudo modprobe uas

To verify that the module parameter has been set:

% cat /sys/module/usb_storage/parameters/quirks
152d:0567:

To make the change permanent (aka the module parameter should be automatically set on boot):

% echo "options usb-storage quirks=152d:0567:" | sudo tee /etc/modprobe.d/usb-storage-unblacklist.conf
% sudo update-initramfs -u -k all

This should work if the kernel loads usb_storage as a module, if it is built in, take a look here to get a hint what to do: https://unix.stackexchange.com/a/441772/144250

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.