-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.x+ Kernel cannot recognize USB devices on external hub #3779
Comments
I do confirm this issue |
Link to Pi forum thread to avoid duplication of effort - https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=281454 |
I can confirm that connecting any FTDI chipset USB-to-Serial cable causes this issue. As soon as the FTDI cable is removed, and after rebooting the system, USB is back to normal. FTDI chipsets are very common and I hope this narrows down the issue. |
What is first 5.4.x failing taking them from https://github.com/raspberrypi/firmware/commits/master |
@macmpi How can I update the OS to a specific commit? using rpi-update? |
Yes, check options here |
Just tested with the earliest 5.x I found which was 5.4.35 and this exhibits the same issue. The commit before that which has Kernel 4.19.118 has no issues. |
Here is some of the relevant info from the forum thread, copied here for convenience. It seems the offending device is a (FTDI) USB-to-Serial adapter. As soon as I plug it into the USB hub, the permissions in the /sys hierarchy get messed up. However, it does create a /dev/ttyUSB0 device, and it is perfectly usable! So I plugged all my devices (WiFi dongle, two astronomy cameras that are powered via USB, an electronic filter wheel, also USB powered) into the USB3 powered hub, with power applied to the hub, and rebooted the Pi. Everything looks normal:
Then I plug the USB-to-Serial adapter into the USB3 hub, and bam! The permissions get messed up, and lsusb (and libusb) no longer work properly:
Here's the output from dmesg when I plugged in the adapter:
Plugging the USB-to-Serial adapter into the built-in ports on the Pi works perfectly fine, and that's what I will be doing until this gets resolved. |
I confirm I have a similar problem in my implementation. I can no longer use one USB device (Pegasus Astro Pocket Power Box) since I upgraded (unknowingly) to Kernel 5.4 from 4.19, and have learned that it contains an FTDI chip for USB to Serial interface. I have an RPi4 4GB v1.1 |
Is there a way to trace this in the kernel somehow? i.e. trace the events that leads to this? |
I am no expert, but I believe something has changed in the very latest Raspberry Pi OS updates that has made my system stable again with the FTDI serial adapter in the Pegasus Astro PPB in KStars/Ekos/Indi using /dev/ttyUSB1 and the Prolific adapter internal to the mount using /dev/ttyUSB0. |
Why has this been closed? It's still a problem in the latest stable release "Linux fmt978-x47282 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux" |
I also confirm this issue. (caused by kernel upgrade from 4.19.x to 5.4.y) It is still very present. Running a RPi 4. |
This is not a kernel issue. Just remove the offending rpi-gpio.common package and it should be fine. |
How is GPIO messing with USB hub permissions? Is there another ticket related to this with more details then, to follow? |
I was able to trace it back to 60-rpi.gpio-common.rules What was happening is that
was always reset to 660 whenever a USB device is plugged in. Sometimes even arbitrary changes to /sys/devices/platform/scb/fd500000.pcie It took me a while (few hours) to figure out it's udev related and by process of elimination your script was the only one left. I was able to edit it by adding a slash before the dev_patch (%p) and that seems to make the system happy and operational. It looks now like this: SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:dialout /sys/%p/active_low /sys/%p/direction /sys/%p/edge /sys/%p/value ; chmod 660 /sys/%p/active_low /sys/%p/direction /sys/%p/edge /sys/%p/value'" was able to trace it back to 60-rpi.gpio-common.rules What was happening is that
was always reset to 660 whenever a USB device is plugged in. Sometimes even arbitrary changes to /sys/devices/platform/scb/fd500000.pcie Any any rate, IMO the udev rules for that package are making quite dangerous changes. I emailed the maintainer about this and not sure if there was any action taken. So the safe bet to is remove the package. |
@XECDesign are you aware of these funny udev rules? Can we patch? At a guess it's trying to preserve the permissions on the ethernet port of SMSC9514, but I don't see why it's being triggered by the quoted udev rule. |
Thank you for the workaround ( |
Sorry I missed the nudge. I've now modified the package with @knro's suggestion. |
Go the same strange stuff : type lsusb and got all usb devices listed. Plug an FTDI USB RS232 devices, and types lsusb and got no devices.
REboot needed to have changes applied. The bugged original one has the last line with added slash before each %p pattern : /sys/%p/active_low instead of the correct form /sys%p/active_low |
This worked fine for me |
Alright, I'll revert the previous "fix" until I can investigate it myself. |
So it looks like what's actually happening is that it's hitting some character limit and cutting the command short. Instead of the full path, the chmod command gets cut short at usb1. I've split the chmod and chown into two rules, which seems to work as intended. Updated package should show up later today. |
I discovered this while trying to get network ups tools going for a USB UPS, which also needs non-root device enumeration permissions. Since you can specify the PROGRAM key multiple times, I replaced the gpio rules with this:
note that this also is referencing the I was able to enumerate devices as any user, and access my gpio settings as a user with the appropriate permissions after this. |
Is this the right place for my bug report?
This problem started appearing after upgrading from 4.19.xx to 5.4.xx Kernel. Downgrading the kernel to 4.19 restores the USB functionality.
Describe the bug
USB devices inaccessible if connected to an external powered USB hub.
To reproduce
Connect USB devices to an external powered USB hub. lsusb only shows the root hub:
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Expected behaviour
All USB devices attached to the hub are listed and accessible. Running sudo lsusb shows all the devices correctly so it appears to be some permission issue.
Actual behaviour
No USB devices detected. /sys/devices/platform/scb/fd500000.pcie shows permission 660 in Kernel 5.4, while on Kernel 4.19, the permission is 755
System
Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:
Raspberry Pi 4.
Hardware : BCM2711
Revision : c03112
Serial : 1000000089b8c084
Model : Raspberry Pi 4 Model B Rev 1.2
cat /etc/rpi-issue
)?Raspberry Pi reference 2019-09-26
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 80d486687ea77d31fc3fc13cf3a2f8b464e129be, stage4
vcgencmd version
)?Aug 6 2020 16:22:25
Copyright (c) 2012 Broadcom
version af3edc2de473197cdfe1ff5a8ff2d34095d5b336 (clean) (release) (start)
uname -a
)?Linux ikaruspi 5.4.51-v7l+ #1332 SMP Tue Aug 4 18:40:14 BST 2020 armv7l GNU/Linux
Logs
If applicable, add the relevant output from
dmesg
or similar.boot.txt
cmdline.txt
config.txt
dmesg.txt
lsusb.txt
Additional context
This issue was reported by several users in INDI forum.
The text was updated successfully, but these errors were encountered: