raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.06k stars 4.97k forks source link

USB Touchscreen kills xHCI Controller #6079

Open s-dinda opened 6 months ago

s-dinda commented 6 months ago

Describe the bug

On Pi5 Bookworm an external usb touchscreens seems to kill the xHCI controller. The same device worked fine with a previous Pi4B (Bullseye).

I am trying to connect a touchscreen via USB and HDMI, unfortunately connecting the USB device seems to kill some of the other connected USB devices - until a reboot.

Thanks in advance!

Steps to reproduce the behaviour

  1. Boot with all devices connected except the touchscreen.
  2. Connect the USB touchscreen (with or without an additional powered USB Hub)
  3. The touchscreen doesn't work at all. Instead the xHCI Controller died.

Device (s)

Raspberry Pi 5

System

$ cat /etc/rpi-issue
Raspberry Pi reference 2024-03-15
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f19ee211ddafcae300827f953d143de92a5c6624, stage4
$ vcgencmd version
2024/02/16 15:28:41
Copyright (c) 2012 Broadcom
version 4c845bd3 (release) (embedded)
$ uname -a
Linux fotobox 6.6.20+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux

Logs

dmesg

...
[  855.080358] usb 1-2: new full-speed USB device number 3 using xhci-hcd
[  855.229606] usb 1-2: New USB device found, idVendor=0416, idProduct=c168, bcdDevice= 0.00
[  855.229611] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  855.229614] usb 1-2: Product: MTouch
[  855.229617] usb 1-2: Manufacturer: TSTP
[  855.229619] usb 1-2: SerialNumber: CMTP_1.0
[  865.656274] xhci-hcd xhci-hcd.0: xHCI host not responding to stop endpoint command
[  865.676453] xhci-hcd xhci-hcd.0: xHCI host controller not responding, assume dead
[  865.676464] xhci-hcd xhci-hcd.0: HC died; cleaning up
[  865.677182] usb 1-1: USB disconnect, device number 2
[  865.736634] usb 1-2: USB disconnect, device number 3

Additional context

No response

pelwell commented 6 months ago
  1. Which power supply are you using on the Pi?
  2. What devices are attached to it?
  3. Are any of those devices independently powered?
s-dinda commented 6 months ago

I'm using the official 27W Power Supply

The other devices are a printer, a DSLR and a mouse:

$ lsusb -tv
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Printer, Driver=, 480M
        ID 06d3:3b36 Mitsubishi Electric Corp. CP-D80DW
    |__ Port 2: Dev 3, If 0, Class=Imaging, Driver=, 480M
        ID 04a9:32b4 Canon, Inc. EOS Rebel T6
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        ID 046a:b091 CHERRY Mouse

The touchscreen and all of them (except the mouse) are independently powered.

x130844 commented 6 months ago

Same problem here, with the Canakit 45W usb-c PD power supply. the usb sees mtouch, then destroys the all USBs. Another touch driver (I have a 2nd screen) using the elecrow. ads7846. has issues as well, it sees SOME touch inputs, once every 20 seconds or so. If I set the exact same OS (raspbian) with same settings, same literal displays on the rpi4 everything works as expected. I have no idea what's happening.

6by9 commented 6 months ago

ads7846 is totally unrelated as it is an I2C touchscreen. Should already be fixed via #6029.

x130844 commented 6 months ago

ads7846 is totally unrelated as it is an I2C touchscreen. Should already be fixed via #6029.

I can confirm that the ads7846 display works now, thx!
Sadly the USB one still is not (mtouch one)

Winor commented 5 months ago

I'm having the same problem with Mtouch on bookworm and latest stable firmware on pi5, seems like there is no solution. I was using Ubuntu before on the same pi5 and the touchscreen was working

EDIT: I reinstalled Ubuntu 24.04LTS server and it seems like I am now getting the same xHCI host controller not responding, assume dead error when connecteing the touch screen. I'm pretty sure I had Ubuntu 23.10 desktop installed on the Pi5 when it was working.

Winor commented 5 months ago

So I had (a lot) of free time to play with this issue and I think I just found something interesting!

What did I do?

When I first got this rpi few good months ago I definitely installed Ubuntu 23.10 (luckily Ubuntu is changing its default background every release making it easy to know what version was installed even after wiping the sd card) and the mtouch screen was working wonderfully, until...

Was it the EEPROM all along?

What could have changed on the EEPROM side that could effect this?

timg236 commented 5 months ago

https://github.com/raspberrypi/rpi-eeprom/blob/master/firmware-2712/release-notes.md

This is possibly a duplicate of this issue although the symptoms don't sound identical

2024-04-18: Update RP1 firmware to extend PCIe L1 entry timeout to 32 us (latest)

Extend PCIe L1 entry timeout to 32us Fix xhci soft reset on link-down Set useful xhci compatibility bits in GUCTL See https://github.com/raspberrypi/firmware/issues/1877

If it is the RP1 firmware change then it should work in Ubuntu 24.04 LTS now since the rpi-eeprom-update service never automatically downgrades

Winor commented 5 months ago

It appears that you are correct, I tested and the latest working release from github releases is 2024-04-17-2712 and with the 2024-04-20 EEPROM release the touch screen no longer works. So I assume the RP1 firmware change is what broke my mtouch display. now the other folks on this thread reported this issue on March 27 so maybe it's a different issue for them?

Winor commented 5 months ago

For now I went back to 2024-04-17-2712, installed latest bookworm and disabled rpi-eeprom-update service with sudo systemctl mask rpi-eeprom-update and my mtouch screen works perfectly !