Closed Hypfer closed 2 years ago
Not sure what's going on here. Your kernel 5.18 seems very new. Perhaps newer kernels require different permission model, e.g. using capabilities? Do you see any other errors in dmesg when not running as root (and not suid)?
Strangely, it's really just the [230304.886220] usb 1-4.1: reset full-speed USB device number 51 using xhci_hci
Running the same command as non-root in quick succession multiple times with a short delay (1-2s) inbetween, I do sometimes get these log messages as well as a working power-cycling.
[230672.132642] usb 1-4.1: Failed to suspend device, error -32
[230672.645665] usb 1-4.1: USB disconnect, device number 62
However if the delay between the two executions of uhubctl is too large, then I just get another reset full-speed USB device
. Also, if I do that too often, the USB hub itself seems to lock up occasionally
Do you have ability to use RPi4 image with older kernel on your hardware? My hunch feeling is this has something to do with most recent Linux kernel 5.18 changes.
It's not a Pi4 but a regular x86 computer (a Wyse 3040 Thin Client to be precise). I can try an older Kernel nonetheless. Would 5.10 be old enough or even too old?
I think trying 5.10 should be okay. Best approach would be to do a binary search, but that is of course quite difficult if you are not kernel developer. Better yet is to debug this inside the kernel...
I am closing this because I don't think this is is something that uhubctl code can fix. However, if you do find the reason for this discrepancy and if there is a way to solve it (perhaps changing udev rules or kernel parameters?), please let us know to update README accordingly. Thank you @Hypfer!
I'm seeing a bit of a weird behavior on an x86 based Host running the latest Debian Bookworm (current testing) with kernel
5.18.0-2-amd64
and libusb1.0.26
. uhubctl was built from commit06e7240db6150d2f5a753c22bfd4f0b2d658324a
My hub is the Amazon Basics HU3641V1.When executed as root, uhubctl switches the port just fine. When executed as a non-root however, uhubctl reports that it did switch the hub but apparently it doesn't?
log as root:
dmesg when switches as root:
log as a regular user:
dmesg when switched as a regular user:
(repeated if executed multiple times)
In both cases, the command executed was
uhubctl -a 2 -p 1 -l 1-4
The recommended udev rule is in place and seems to work as uhubctl could not see the hub running as a regular user before its creation.
Previously, I've used uhubctl on a pi3b+ running raspbian 10 and 11 with no issues. As a workaround, I have now set the suid bit on the binary which makes switching work even as a regular user