| Summary: | JMicron USB3 -> SATA adaptor 152d:0578 requires 'usb-storage.quirks=152d:0578:u' | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Barry Jackson <zen25000> |
| Component: | RPM Packages | Assignee: | Kernel and Drivers maintainers <kernel> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | davidwhodgins |
| Version: | Cauldron | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | CVE: | ||
| Status comment: | |||
|
Description
Barry Jackson
2023-03-16 17:10:41 CET
I have since come across this: https://unix.stackexchange.com/questions/239782/connection-problem-with-usb3-external-storage-on-linux-uas-driver-problem May this be the way to go? Based on the stackexchange article, it should be easy to create a udev rule
for that specific device such as ...
$ cat /etc/udev/rules.d/00-myusb.rules
# udev rules file for my usb drive
ACTION!="add", GOTO="myusb_rules_end"
KERNEL=="sd?1", ATTRS{idVendor}=="152d", ATTRS{idProduct}=="0583", , ACTION=="add", RUN+="/bin/echo '152d:0583:u' >> /sys/module/usb_storage/parameters/quirks"
LABEL="myusb_rules_end"
I don't have such a device so can't test the rule. It may be necessary to
escape the single quotes in the RUN command by preceding each with a \.
You could also have the udev command run a script that checks to see if
it device is already listed in the quirks, and do the echo if it isn't
already there.
Assigning to the kernel team to see if there is a better way.Assignee:
bugsquad =>
kernel Thanks Dave,
I can't get a rule to write directly to .../quirks, I tried escaping the single quotes and a few other quoting combinations to no avail.
(note the ATTRS{idProduct}=="0583" was also wrong ;)
Calling a separate script from the rule works fine.
From journal:
Mar 16 20:33:55 jackodesktop (udev-worker)[302548]: sde1: /etc/udev/rules.d/00-myusb.rules:3 RUN '/bin/usbquirkadd'
[root@jackodesktop baz]# cat /sys/module/usb_storage/parameters/quirks
152d:0578:u
Now after plugging the device:
[root@jackodesktop baz]# udevadm monitor --environment|grep ID_USB_DRIVER
ID_USB_DRIVER=usb-storage
where previously it was:
ID_USB_DRIVER=uas
So the current rule is:
cat /etc/udev/rules.d/00-myusb.rules
# udev rules file for my usb drive
ACTION!="add", GOTO="myusb_rules_end"
KERNEL=="sd?1", ATTRS{idVendor}=="152d", ATTRS{idProduct}=="0578", , ACTION=="add", RUN+="/bin/usbquirkadd"
LABEL="myusb_rules_end"
Calling:
[root@jackodesktop baz]# cat /bin/usbquirkadd
#!/bin/bash
if ! grep "152d:0578:u" /sys/module/usb_storage/parameters/quirks; then
echo "152d:0578:u" >> /sys/module/usb_storage/parameters/quirks
fi
If this could be fixed in the default udev rule for this device, then there would be no need to manually add another rule to use it.
I can only assume that udev is blocked from writing to /sys/module/usb_storage/parameters/quirks as well as other sensitive system folders.
This does not error (with or without escaping ' ), but neither does it write anything to quirks.
KERNEL=="sd?1", ATTRS{idVendor}=="152d", ATTRS{idProduct}=="0578", , ACTION=="add", RUN+="/bin/sh -cv echo '152d:0578:u' >> /sys/module/usb_storage/parameters/quirks"
I am out of ideas trying to avoid the extra script and it's bed time :(
|