Skip to content
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

Problem when plugging several USB devices at once #2097

Closed
slaadvak opened this issue Jul 4, 2017 · 6 comments
Closed

Problem when plugging several USB devices at once #2097

slaadvak opened this issue Jul 4, 2017 · 6 comments
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.

Comments

@slaadvak
Copy link

slaadvak commented Jul 4, 2017

I make a test bench using a lot of USB peripherals. Everything was working fine with kernel 4.4.50-v7+, except for a sporadic problem (#830). So, I've decided to upgrade my kernel with the dist-upgrade command, because of this recent pull request in kernel 4.9.28: #2010. But since then, I'm running into important issues which have for effect of preventing using most of my USB peripherals, keyboard included.

I'm using a RasPi 3 with Raspian.

cat /etc/os-release:

PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

uname -r:

4.9.35-v7+

My setup is made of two independently powered USB hubs and a keyboard. Each hub have 10 ports and each port is filled with a USB ACM device.
The idVendor of the hubs is 1a40. The idVendor of the ACM devices is 15a2.
All the devices, except for the keyboard are initialy unplugged.

If I only plug the first hub (path is 1.1.2) everything works fine. You can see this at around 46 seconds in the dmesg excerpt below.

Then, if I plug the second USB hub (path is 1.1.4) the USB keyboard stops working. I can however still connect to my RasPi with SSH. I see that all the USB peripherals appear corrrectly in /dev, but slower than usual. When I try to connect to these devices (through some serial API) it doesn't work, or if it finally works, I receive a lot of garbage.

You can see in the dmesg below the connection of the second USB hub at around 68 seconds. You will see a lot of errors about clock problems and then, finally an error in assign_and_init_hc. Even if I try to unplug/replug the hubs, in the same or in another port, I won't be able to recover from that weird state.

[   47.636830] usb 1-1.2: new high-speed USB device number 5 using dwc_otg
[   47.767285] usb 1-1.2: New USB device found, idVendor=1a40, idProduct=0201
[   47.767298] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[   47.767306] usb 1-1.2: Product: USB 2.0 Hub [MTT]
[   47.768243] hub 1-1.2:1.0: USB hub found
[   47.768342] hub 1-1.2:1.0: 7 ports detected
[   48.086839] usb 1-1.2.1: new full-speed USB device number 6 using dwc_otg
[   48.219908] usb 1-1.2.1: New USB device found, idVendor=15a2, idProduct=0300
[   48.219920] usb 1-1.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   48.219928] usb 1-1.2.1: Product: IO BOARD
[   48.219936] usb 1-1.2.1: Manufacturer: ZIP HYPERION.
[   48.243494] cdc_acm 1-1.2.1:1.0: ttyACM0: USB ACM device
[   48.244392] usbcore: registered new interface driver cdc_acm
[   48.244397] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   48.316833] usb 1-1.2.2: new full-speed USB device number 7 using dwc_otg
[   48.449907] usb 1-1.2.2: New USB device found, idVendor=15a2, idProduct=0300
[   48.449918] usb 1-1.2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   48.449926] usb 1-1.2.2: Product: IO BOARD
[   48.449934] usb 1-1.2.2: Manufacturer: ZIP HYPERION.
[   48.452067] cdc_acm 1-1.2.2:1.0: ttyACM1: USB ACM device
[   48.546832] usb 1-1.2.3: new full-speed USB device number 8 using dwc_otg
[   48.679906] usb 1-1.2.3: New USB device found, idVendor=15a2, idProduct=0300
[   48.679918] usb 1-1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   48.679926] usb 1-1.2.3: Product: IO BOARD
[   48.679934] usb 1-1.2.3: Manufacturer: ZIP HYPERION.
[   48.683154] cdc_acm 1-1.2.3:1.0: ttyACM2: USB ACM device
[   48.776840] usb 1-1.2.4: new full-speed USB device number 9 using dwc_otg
[   48.909907] usb 1-1.2.4: New USB device found, idVendor=15a2, idProduct=0300
[   48.909918] usb 1-1.2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   48.909926] usb 1-1.2.4: Product: IO BOARD
[   48.909934] usb 1-1.2.4: Manufacturer: ZIP HYPERION.
[   48.912172] cdc_acm 1-1.2.4:1.0: ttyACM3: USB ACM device
[   49.006856] usb 1-1.2.5: new full-speed USB device number 10 using dwc_otg
[   49.139908] usb 1-1.2.5: New USB device found, idVendor=15a2, idProduct=0300
[   49.139919] usb 1-1.2.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   49.139927] usb 1-1.2.5: Product: IO BOARD
[   49.139936] usb 1-1.2.5: Manufacturer: ZIP HYPERION.
[   49.142007] cdc_acm 1-1.2.5:1.0: ttyACM4: USB ACM device
[   49.236842] usb 1-1.2.6: new full-speed USB device number 11 using dwc_otg
[   49.369908] usb 1-1.2.6: New USB device found, idVendor=15a2, idProduct=0300
[   49.369920] usb 1-1.2.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   49.369928] usb 1-1.2.6: Product: IO BOARD
[   49.369936] usb 1-1.2.6: Manufacturer: ZIP HYPERION.
[   49.372137] cdc_acm 1-1.2.6:1.0: ttyACM5: USB ACM device
[   49.466834] usb 1-1.2.7: new high-speed USB device number 12 using dwc_otg
[   49.597273] usb 1-1.2.7: New USB device found, idVendor=1a40, idProduct=0101
[   49.597289] usb 1-1.2.7: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[   49.597297] usb 1-1.2.7: Product: USB 2.0 Hub
[   49.598298] hub 1-1.2.7:1.0: USB hub found
[   49.598410] hub 1-1.2.7:1.0: 4 ports detected
[   49.926832] usb 1-1.2.7.1: new full-speed USB device number 13 using dwc_otg
[   50.059904] usb 1-1.2.7.1: New USB device found, idVendor=15a2, idProduct=0300
[   50.059916] usb 1-1.2.7.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   50.059924] usb 1-1.2.7.1: Product: IO BOARD
[   50.059933] usb 1-1.2.7.1: Manufacturer: ZIP HYPERION.
[   50.063270] cdc_acm 1-1.2.7.1:1.0: ttyACM6: USB ACM device
[   50.166842] usb 1-1.2.7.2: new full-speed USB device number 14 using dwc_otg
[   50.299907] usb 1-1.2.7.2: New USB device found, idVendor=ffff, idProduct=0001
[   50.299919] usb 1-1.2.7.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   50.299927] usb 1-1.2.7.2: Product: MCU VIRTUAL COM
[   50.299936] usb 1-1.2.7.2: Manufacturer: ZIP LIGHTING.
[   50.303209] cdc_acm 1-1.2.7.2:1.0: ttyACM7: USB ACM device
[   50.396841] usb 1-1.2.7.3: new full-speed USB device number 15 using dwc_otg
[   50.529911] usb 1-1.2.7.3: New USB device found, idVendor=ffff, idProduct=0001
[   50.529921] usb 1-1.2.7.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   50.529928] usb 1-1.2.7.3: Product: MCU VIRTUAL COM
[   50.529936] usb 1-1.2.7.3: Manufacturer: ZIP LIGHTING.
[   50.532190] cdc_acm 1-1.2.7.3:1.0: ttyACM8: USB ACM device
[   50.626815] usb 1-1.2.7.4: new full-speed USB device number 16 using dwc_otg
[   50.759889] usb 1-1.2.7.4: New USB device found, idVendor=15a2, idProduct=0300
[   50.759894] usb 1-1.2.7.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   50.759897] usb 1-1.2.7.4: Product: IO BOARD
[   50.759901] usb 1-1.2.7.4: Manufacturer: ZIP HYPERION.
[   50.761520] cdc_acm 1-1.2.7.4:1.0: ttyACM9: USB ACM device
[   50.849519] usb 1-1.2.7.3: USB disconnect, device number 15
[   51.105488] usb 1-1.2.7.2: USB disconnect, device number 14
[   51.656812] usb 1-1.2.7.2: new full-speed USB device number 17 using dwc_otg
[   51.789889] usb 1-1.2.7.2: New USB device found, idVendor=15a2, idProduct=0300
[   51.789894] usb 1-1.2.7.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   51.789897] usb 1-1.2.7.2: Product: IO BOARD
[   51.789901] usb 1-1.2.7.2: Manufacturer: ZIP HYPERION.
[   51.790725] cdc_acm 1-1.2.7.2:1.0: ttyACM7: USB ACM device
[   52.096817] usb 1-1.2.7.3: new full-speed USB device number 18 using dwc_otg
[   52.249885] usb 1-1.2.7.3: New USB device found, idVendor=15a2, idProduct=0300
[   52.249892] usb 1-1.2.7.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   52.249896] usb 1-1.2.7.3: Product: IO BOARD
[   52.249901] usb 1-1.2.7.3: Manufacturer: ZIP HYPERION.
[   52.250694] cdc_acm 1-1.2.7.3:1.0: ttyACM8: USB ACM device
[   68.636865] usb 1-1.4: new high-speed USB device number 19 using dwc_otg
[   68.767361] usb 1-1.4: New USB device found, idVendor=1a40, idProduct=0201
[   68.767377] usb 1-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[   68.767385] usb 1-1.4: Product: USB 2.0 Hub [MTT]
[   68.768282] hub 1-1.4:1.0: USB hub found
[   68.768386] hub 1-1.4:1.0: 7 ports detected
[   69.086869] usb 1-1.4.1: new full-speed USB device number 20 using dwc_otg
[   69.220030] usb 1-1.4.1: New USB device found, idVendor=15a2, idProduct=0300
[   69.220042] usb 1-1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   69.220051] usb 1-1.4.1: Product: IO BOARD
[   69.220059] usb 1-1.4.1: Manufacturer: ZIP HYPERION.
[   69.222408] cdc_acm 1-1.4.1:1.0: ttyACM10: USB ACM device
[   69.316881] usb 1-1.4.2: new full-speed USB device number 21 using dwc_otg
[   69.450032] usb 1-1.4.2: New USB device found, idVendor=15a2, idProduct=0300
[   69.450046] usb 1-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   69.450055] usb 1-1.4.2: Product: IO BOARD
[   69.450063] usb 1-1.4.2: Manufacturer: ZIP HYPERION.
[   69.452335] cdc_acm 1-1.4.2:1.0: ttyACM11: USB ACM device
[   69.546874] usb 1-1.4.3: new full-speed USB device number 22 using dwc_otg
[   69.680037] usb 1-1.4.3: New USB device found, idVendor=15a2, idProduct=0300
[   69.680050] usb 1-1.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   69.680058] usb 1-1.4.3: Product: IO BOARD
[   69.680066] usb 1-1.4.3: Manufacturer: ZIP HYPERION.
[   69.682200] cdc_acm 1-1.4.3:1.0: ttyACM12: USB ACM device
[   69.776875] usb 1-1.4.4: new full-speed USB device number 23 using dwc_otg
[   69.910039] usb 1-1.4.4: New USB device found, idVendor=15a2, idProduct=0300
[   69.910051] usb 1-1.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   69.910060] usb 1-1.4.4: Product: IO BOARD
[   69.910068] usb 1-1.4.4: Manufacturer: ZIP HYPERION.
[   69.913429] cdc_acm 1-1.4.4:1.0: ttyACM13: USB ACM device
[   70.006882] usb 1-1.4.5: new full-speed USB device number 24 using dwc_otg
[   70.140036] usb 1-1.4.5: New USB device found, idVendor=15a2, idProduct=0300
[   70.140048] usb 1-1.4.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   70.140057] usb 1-1.4.5: Product: IO BOARD
[   70.140065] usb 1-1.4.5: Manufacturer: ZIP HYPERION.
[   70.142274] cdc_acm 1-1.4.5:1.0: ttyACM14: USB ACM device
[   70.236872] usb 1-1.4.6: new full-speed USB device number 25 using dwc_otg
[   70.370032] usb 1-1.4.6: New USB device found, idVendor=15a2, idProduct=0300
[   70.370045] usb 1-1.4.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   70.370053] usb 1-1.4.6: Product: IO BOARD
[   70.370061] usb 1-1.4.6: Manufacturer: ZIP HYPERION.
[   70.372399] cdc_acm 1-1.4.6:1.0: ttyACM15: USB ACM device
[   70.476889] usb 1-1.4.7: new high-speed USB device number 26 using dwc_otg
[   70.607316] usb 1-1.4.7: New USB device found, idVendor=1a40, idProduct=0101
[   70.607328] usb 1-1.4.7: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[   70.607336] usb 1-1.4.7: Product: USB 2.0 Hub
[   70.608245] hub 1-1.4.7:1.0: USB hub found
[   70.608351] hub 1-1.4.7:1.0: 4 ports detected
[   70.926875] usb 1-1.4.7.1: new full-speed USB device number 27 using dwc_otg
[   71.060034] usb 1-1.4.7.1: New USB device found, idVendor=15a2, idProduct=0300
[   71.060046] usb 1-1.4.7.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   71.060055] usb 1-1.4.7.1: Product: IO BOARD
[   71.060064] usb 1-1.4.7.1: Manufacturer: ZIP HYPERION.
[   71.062370] cdc_acm 1-1.4.7.1:1.0: ttyACM16: USB ACM device
[   71.062514] ERROR::assign_and_init_hc:1377: assign_and_init_hc: Failed to allocate memory to handle non-dword aligned buffer case

[   72.511695] bcm2835-cpufreq:bcm2835_cpufreq_set_clock:76: Failed to set clock: 1200000 (-12)
[   72.511702] bcm2835-cpufreq:bcm2835_cpufreq_driver_target_index:175: Error occurred setting a new frequency (1200000)
[   72.511706] cpufreq: __target_index: Failed to change cpu frequency: -22
[   73.216894] bcm2835-cpufreq:bcm2835_cpufreq_set_clock:76: Failed to set clock: 1200000 (-12)
[   73.216900] bcm2835-cpufreq:bcm2835_cpufreq_driver_target_index:175: Error occurred setting a new frequency (1200000)
[   73.216905] cpufreq: __target_index: Failed to change cpu frequency: -22
[   73.926904] bcm2835-cpufreq:bcm2835_cpufreq_set_clock:76: Failed to set clock: 1200000 (-12)
[   73.926910] bcm2835-cpufreq:bcm2835_cpufreq_driver_target_index:175: Error occurred setting a new frequency (1200000)
[   73.926914] cpufreq: __target_index: Failed to change cpu frequency: -22
[   74.636902] bcm2835-cpufreq:bcm2835_cpufreq_set_clock:76: Failed to set clock: 1200000 (-12)
[   74.636909] bcm2835-cpufreq:bcm2835_cpufreq_driver_target_index:175: Error occurred setting a new frequency (1200000)
[   74.636914] cpufreq: __target_index: Failed to change cpu frequency: -22
[   75.346904] bcm2835-cpufreq:bcm2835_cpufreq_set_clock:76: Failed to set clock: 1200000 (-12)
[   75.346911] bcm2835-cpufreq:bcm2835_cpufreq_driver_target_index:175: Error occurred setting a new frequency (1200000)
[   75.346916] cpufreq: __target_index: Failed to change cpu frequency: -22
[   76.056917] bcm2835-cpufreq:bcm2835_cpufreq_set_clock:76: Failed to set clock: 1200000 (-12)
[   76.056924] bcm2835-cpufreq:bcm2835_cpufreq_driver_target_index:175: Error occurred setting a new frequency (1200000)
[   76.056929] cpufreq: __target_index: Failed to change cpu frequency: -22
[   76.406927] usb 1-1.4.7.2: new full-speed USB device number 28 using dwc_otg
[   76.540037] usb 1-1.4.7.2: New USB device found, idVendor=15a2, idProduct=0300
[   76.540050] usb 1-1.4.7.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   76.540059] usb 1-1.4.7.2: Product: IO BOARD
[   76.540067] usb 1-1.4.7.2: Manufacturer: ZIP HYPERION.
[   76.542555] cdc_acm 1-1.4.7.2:1.0: ttyACM17: USB ACM device
[   76.542644] ERROR::assign_and_init_hc:1377: assign_and_init_hc: Failed to allocate memory to handle non-dword aligned buffer case
@slaadvak slaadvak changed the title Problem when plugging several USNB Problem when plugging several USB devices at once Jul 4, 2017
@P33M
Copy link
Contributor

P33M commented Jul 12, 2017

My setup is made of two independently powered USB hubs and a keyboard. Each hub have 10 ports and each port is filled with a USB ACM device.

This is unlikely to be supportable due to the inherent limitations of the DWC USB host on Pi. That said, what is the first firmware revision that fails in a worse way than previously?

Run sudo rpi-update <HASH> where hash is from this repository's commits:

https://github.com/Hexxeh/rpi-firmware/commits/master

and report back with the first "bad" version.

@slaadvak
Copy link
Author

This is the firmware version of the first "bad" version, corresponding to Kernel version 4.4.50-v7+:
sudo rpi-update 1fdc3a06af325159cf1ed88b5bbd1bae85346d0a

https://github.com/hexxeh/rpi-firmware/tree/1fdc3a06af325159cf1ed88b5bbd1bae85346d0a

With this one, I am able to poll up to 30 devices for around 20 hours, once every minute. The longer between polling, the longer the rpi will run correctly. After that, I encounter the issue #830 (I guess!). Here is a screenshot of a typical kernel stack trace that I get when this situation occurs:
img_20170628_181444076

@slaadvak
Copy link
Author

Sorry, I misunderstood what you asked me. I'm trying to find the first commit where it fails in the worse way, as described at the top of this issue...

@JamesH65
Copy link
Contributor

@slaadvak Did you have a chance to determine which commit caused a performance regression? Or is the issue solved?

@JamesH65 JamesH65 added the Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. label Sep 13, 2017
@JamesH65
Copy link
Contributor

JamesH65 commented Dec 4, 2017

Closing due to lack of activity. Reopen if you feel this issue is still relevant.

@JamesH65 JamesH65 closed this as completed Dec 4, 2017
@PocketSam
Copy link

In my case the problem was caused by a USB keyboard. I've disconnected it and everything became fine. Active USB hub and USB-modem wasn't a problem for rPi3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.
Projects
None yet
Development

No branches or pull requests

4 participants