xhci: Regression for cdc_acm device (bisected)

Open
#4,061 28 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, linux, raspberry-pi

Research direction

Start with the bisected firmware commit f9a31df and the referenced xHCI quirk change in Raspberry Pi Linux pull request 3929, comparing it with last-good commit e530832. Reproduce the cdc_acm disconnect and reconnect sequence on the Raspberry Pi 4B using the reported dmesg output; done means unplugging is detected and /dev/ttyACM0 communication does not remain silently dead.

Written by the indexing model from the issue text.

Description

Hi,
I recently ran into issues with a serial USB device (cdc_acm driver) on a Raspberry Pi 4B 2GB Revision 1.1. I bisected this on the Hexxeh/rpi-firmware repository and f9a31df39c03911ae42e8b43b89313e25c30661c is the first bad commit (e530832 last good):

commit f9a31df39c03911ae42e8b43b89313e25c30661c (refs/bisect/bad)
Author: popcornmix <popcornmix@gmail.com>
Date:   Mon Oct 26 17:47:48 2020 +0000

    kernel: Switch to gcc-8
    See: https://github.com/raspberrypi/Raspberry-Pi-OS-64bit/issues/4

    kernel:  rpisense-fb: Set pseudo_pallete to prevent crash on fbcon takeover
    See: https://github.com/raspberrypi/linux/pull/3931

    kernel: xhci: quirks: add link TRB quirk for VL805
    See: https://github.com/raspberrypi/linux/pull/3929

    kernel: Allow the headphone output to be disabled
    See: https://github.com/raspberrypi/linux/pull/3928

As it's USB related, a strong candidate would be #3929 (pinging @P33M).

Steps to reproduce:

I have a piece of software that keeps the serial device /dev/ttyACM0 open for continuous communication. From time to time the other communication partner is resetted/restarted, which is normally detected as unplugging and replugging in dmesg:

usb 1-1.2.3: USB disconnect, device number 25
cdc_acm 1-1.2.3:1.0: failed to set dtr/rts
usb 1-1.2.3: new full-speed USB device number 27 using xhci_hcd
usb 1-1.2.3: New USB device found, idVendor=1234, idProduct=5678, bcdDevice= 1.00
usb 1-1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.2.3: Product: MyDevice
usb 1-1.2.3: Manufacturer: Dummy
cdc_acm 1-1.2.3:1.0: ttyACM0: USB ACM device

When upgrading to commit f9a31df or newer, no unplugging is detected and the communication just appears dead, but is not closed. The unplugging and replugging is logged in dmesg as soon as my piece of software closes /dev/ttyACM0 due to timeouts.

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.