Bug 212725 - USB CDC ACM device stop working
Summary: USB CDC ACM device stop working
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: x86-64 Linux
: P1 high
Assignee: Default virtual assignee for Drivers/USB
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-19 21:18 UTC by Stefan Agner
Modified: 2021-04-28 21:39 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.11.15
Subsystem:
Regression: No
Bisected commit-id:


Attachments
fix a poison/unpoison imbalance (1.07 KB, patch)
2021-04-20 09:58 UTC, Oliver Neukum
Details | Diff

Description Stefan Agner 2021-04-19 21:18:02 UTC
When trying to use USB CDC ACM devices (open using screen) opening fails and the kernel dmesg shows the following error:

kernel: cdc_acm 1-3.3.3:1.0: acm_port_activate - usb_submit_urb(ctrl irq) failed

This happens with STM32 microcontroller based device as well as a Segger JTAG adapter, so it seems not device related. The issue must have been introduced recently (within the last month) as those devices used to work previously. I can reproduce the issue also with latest LTS kernel release 5.10.31.

Builds:
- 5.10.31-1-lts
- 5.11.15-arch1-2
Comment 1 Stefan Agner 2021-04-19 21:26:03 UTC
I went back and installed some older LTS kernel I had at hand. It seems that 5.10.26 was still working and 5.10.29 is broken. I don't have kernels at hand inbetween, but hopefully this narrows it down already sufficently.

This is on a AMD Ryzen 9 3900X platform using a AMD X570 motherboard. The USB 2.0 devices are connected through USB 3.0 hub, but also connecting them directly to the root port seems to exhibit the issue.
Comment 3 Oliver Neukum 2021-04-20 09:58:12 UTC
Created attachment 296439 [details]
fix a poison/unpoison imbalance

Please test this patch
Comment 4 Stefan Agner 2021-04-20 13:35:53 UTC
Thanks for the quick response!

Applied and built a 5.11.15 kernel with that patch. It indeed seems to fix the issue!

It did not apply cleanly on 5.11.15 or master, there is a `spin_lock_irq` in that area. I just moved the acm_unpoison_urbs after the suspend counter decrement, not sure if that is the correct fix though.
Comment 6 Stefan Agner 2021-04-28 21:39:21 UTC
FWIW, the issue is now fixed in kernels v5.11.17/v5.10.33. I guess it will make it into v5.12.1 (at this point not yet released).

Note You need to log in before you can comment on or make changes to this bug.