Raspberry Pi 4: USB disconnect causes failure on other USB devices

Open
#5,192 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
28/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, linux

Research direction

Start by reproducing the setup with a Raspberry Pi 4, Mass Storage device, and mt7921au wireless device while generating traffic. Read the xhci_hcd and mt7921u failure sequence in the supplied kernel logs; done means identifying why one USB disconnect disrupts the other device and verifying the fix with the same unplugging test.

Written by the indexing model from the issue text.

Description

Describe the bug

With a Mass Storage and a Wireless device (mt7921au CF-953AX) connected to the two USB-3 ports of the Raspberry Pi 4, unplugging the mass storage device triggers internal errors in the kernel mt7921au driver and in the Wireless device's firmware causing the wireless device firmware to reset, indicating that the unplugging of one device interfered with the transmission of messages to the other device.

Steps to reproduce the behaviour

With both devices plugged in, run a speedtest (or otherwise generate traffic) and plug out the Mass Storage device. Observe the failures of the Wireless device.

Device (s)

Raspberry Pi 4 Mod. B

System

Raspberry Pi reference 2021-05-07
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, dcfd74d7d1fa293065ac6d565711e9ff891fe2b8, stage2

Firmware:
Aug 26 2022 14:03:16
Copyright (c) 2012 Broadcom
version 102f1e848393c2112206fadffaaf86db04e98326 (clean) (release) (start)

Kernel: Linux raspberrypi 6.0.0-rc7-v8+ #4 SMP PREEMPT Wed Sep 28 02:12:59 UTC 2022 aarch64 GNU/Linux
built from rpi-6.0.y https://github.com/raspberrypi/linux/commit/3fb5ca89c844eb9fda924a5e76ffab9e8c068675 which includes the https://github.com/raspberrypi/linux/pull/5173 USB fixes. (This issue also happened with earlier kernels that did not include the #5173 fixes)

Logs
[  347.921685] usb 2-2: USB disconnect, device number 3
[  347.957699] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[  348.173668] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=0x07 driverbyte=DRIVER_OK
[  348.653651] usb 2-1: USB disconnect, device number 2
[  348.682609] wlxe0e1a934a6a9: failed to remove key (0, 8c:fd:f0:4f:4f:1c) from hardware (-19)
[  348.688160] wlxe0e1a934a6a9: failed to remove key (0, 2c:71:ff:8e:bd:7f) from hardware (-19)
[  348.695264] wlxe0e1a934a6a9: failed to remove key (0, 94:3a:91:52:e8:11) from hardware (-19)
[  348.700769] wlxe0e1a934a6a9: failed to remove key (0, 2c:71:ff:ae:dc:cc) from hardware (-19)
[  348.706256] wlxe0e1a934a6a9: failed to remove key (1, ff:ff:ff:ff:ff:ff) from hardware (-19)
[  349.661627] mt7921u 2-1:1.3: timed out waiting for pending tx
[  350.009917] usb 2-1: new SuperSpeed USB device number 4 using xhci_hcd
[  350.032007] usb 2-1: New USB device found, idVendor=0e8d, idProduct=7961, bcdDevice= 1.00
[  350.032026] usb 2-1: New USB device strings: Mfr=6, Product=7, SerialNumber=8
[  350.032033] usb 2-1: Product: Wireless_Device
[  350.032038] usb 2-1: Manufacturer: MediaTek Inc.
[  350.032043] usb 2-1: SerialNumber: 000000000
[  352.065633] Bluetooth: hci0: Opcode 0x c03 failed: -110
[  352.195642] usb 2-1: reset SuperSpeed USB device number 4 using xhci_hcd
[  352.360257] mt7921u 2-1:1.3: HW/SW Version: 0x8a108a10, Build Time: 20220908210919a

[  352.374794] mt7921u 2-1:1.3: WM Firmware Version: ____010000, Build Time: 20220908211021
[  354.020290] mt7921u 2-1:1.3 wlxe0e1a934a6a9: renamed from wlan1
[  354.241576] Bluetooth: hci0: Opcode 0x c03 failed: -110
[  374.455254] IPv6: ADDRCONF(NETDEV_CHANGE): wlxe0e1a934a6a9: link becomes ready
Additional context

No response

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.