Bug 243612 - xhci controller sometimes stuck in an endless error loop
Summary: xhci controller sometimes stuck in an endless error loop
Status: Closed Not Enough Information
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-26 12:19 UTC by Martin Birgmeier
Modified: 2020-05-30 11:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2020-01-26 12:19:48 UTC
Scenario:
- Lenovo W520 laptop
- grep -i xhci /var/run/dmesg.boot:

xhci0: <NEC uPD720200 USB 3.0 controller> mem 0xd4100000-0xd4101fff irq 18 at device 0.0 on pci5
xhci0: 32 bytes context size, 32-bit DMA
xhci0: Unable to map MSI-X table 
usbus1 on xhci0
ugen1.1: <0x1033 XHCI root HUB> at usbus1
uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1

- Trying to connect USB 3.0 devices; in this case, WD My Book 25EE 4007 7630885MB

Result:
- Sometimes, instead of normally probing and attaching the USB devices, the controller gets into an endless loop; here the result (from /var/log/messages) with leaving the external devices in for some seconds, then removing it, then trying to plug it again, the removing it:

Jan 26 12:52:19 mizar kernel: xhci0: Resetting controller
Jan 26 12:52:58 mizar kernel: ugen1.2: <Western Digital My Book 25EE> at usbus1
Jan 26 12:52:59 mizar kernel: ugen1.3: <Unknown > at usbus1 (disconnected)
Jan 26 12:52:59 mizar kernel: uhub2: at usbus1, port 1, addr 1 (disconnected)
Jan 26 12:52:59 mizar kernel: ugen1.2: <Western Digital My Book 25EE> at usbus1 (disconnected)
Jan 26 12:53:01 mizar kernel: xhci0: Controller halt timeout.
Jan 26 12:53:02 mizar kernel: xhci0: Controller reset timeout.
Jan 26 12:53:03 mizar syslogd: last message repeated 1 times
Jan 26 12:53:03 mizar kernel: uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
Jan 26 12:53:03 mizar kernel: uhub2: 4 ports with 4 removable, self powered
Jan 26 12:53:05 mizar kernel: xhci0: Resetting controller
Jan 26 12:53:05 mizar kernel: ugen1.2: <Unknown > at usbus1 (disconnected)
Jan 26 12:53:07 mizar syslogd: last message repeated 2 times
Jan 26 12:53:07 mizar kernel: uhub2: at usbus1, port 1, addr 1 (disconnected)
Jan 26 12:53:08 mizar kernel: xhci0: Controller halt timeout.
Jan 26 12:53:09 mizar kernel: xhci0: Controller reset timeout.
Jan 26 12:53:10 mizar syslogd: last message repeated 1 times
Jan 26 12:53:10 mizar kernel: uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
Jan 26 12:53:11 mizar kernel: uhub2: 4 ports with 4 removable, self powered
Jan 26 12:53:12 mizar kernel: xhci0: Resetting controller
Jan 26 12:53:12 mizar kernel: ugen1.2: <Unknown > at usbus1 (disconnected)
Jan 26 12:53:13 mizar syslogd: last message repeated 1 times
Jan 26 12:53:13 mizar kernel: uhub2: at usbus1, port 1, addr 1 (disconnected)
Jan 26 12:53:15 mizar kernel: xhci0: Controller halt timeout.
Jan 26 12:53:16 mizar kernel: xhci0: Controller reset timeout.
Jan 26 12:53:17 mizar syslogd: last message repeated 1 times
Jan 26 12:53:17 mizar kernel: uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
Jan 26 12:53:17 mizar kernel: uhub2: 4 ports with 4 removable, self powered
Jan 26 12:54:28 mizar kernel: xhci0: Resetting controller
Jan 26 12:54:28 mizar kernel: ugen1.2: <Unknown > at usbus1 (disconnected)
Jan 26 12:54:28 mizar kernel: uhub2: at usbus1, port 1, addr 1 (disconnected)
Jan 26 12:54:30 mizar kernel: xhci0: Controller halt timeout.
Jan 26 12:54:31 mizar kernel: xhci0: Controller reset timeout.
Jan 26 12:54:32 mizar syslogd: last message repeated 1 times
Jan 26 12:54:32 mizar kernel: uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
Jan 26 12:54:32 mizar kernel: uhub2: 4 ports with 4 removable, self powered
Jan 26 12:54:34 mizar kernel: xhci0: Resetting controller
Jan 26 12:54:34 mizar kernel: ugen1.2: <Unknown > at usbus1 (disconnected)
Jan 26 12:54:34 mizar kernel: uhub2: at usbus1, port 1, addr 1 (disconnected)
Jan 26 12:54:35 mizar kernel: xhci0: Controller halt timeout.
Jan 26 12:54:36 mizar kernel: xhci0: Controller reset timeout.
Jan 26 12:54:37 mizar syslogd: last message repeated 1 times
Jan 26 12:54:37 mizar kernel: uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
Jan 26 12:54:38 mizar kernel: uhub2: 4 ports with 4 removable, self powered
Jan 26 12:55:49 mizar wpa_supplicant[395]: wlan0: WPA: Group rekeying completed with 00:18:e7:e0:80:7d [GTK=TKIP]
Jan 26 12:55:49 mizar syslogd: last message repeated 1 times
Jan 26 13:11:16 mizar kernel: xhci0: Resetting controller
Jan 26 13:11:16 mizar kernel: ugen1.2: <Unknown > at usbus1 (disconnected)
Jan 26 13:11:16 mizar kernel: uhub2: at usbus1, port 1, addr 1 (disconnected)
Jan 26 13:11:18 mizar kernel: xhci0: Controller halt timeout.
Jan 26 13:11:19 mizar kernel: xhci0: Controller reset timeout.
Jan 26 13:11:20 mizar syslogd: last message repeated 1 times
Jan 26 13:11:20 mizar kernel: uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
Jan 26 13:11:20 mizar kernel: uhub2: 4 ports with 4 removable, self powered
Jan 26 13:11:22 mizar kernel: xhci0: Resetting controller
Jan 26 13:11:22 mizar kernel: ugen1.2: <Unknown > at usbus1 (disconnected)
Jan 26 13:11:22 mizar kernel: uhub2: at usbus1, port 1, addr 1 (disconnected)
Jan 26 13:11:23 mizar kernel: xhci0: Controller halt timeout.
Jan 26 13:11:24 mizar kernel: xhci0: Controller reset timeout.
Jan 26 13:11:25 mizar syslogd: last message repeated 1 times
Jan 26 13:11:25 mizar kernel: uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
Jan 26 13:11:26 mizar kernel: uhub2: 4 ports with 4 removable, self powered
Jan 26 13:11:27 mizar kernel: xhci0: Resetting controller
Jan 26 13:11:27 mizar kernel: ugen1.2: <Unknown > at usbus1 (disconnected)
Jan 26 13:11:27 mizar kernel: uhub2: at usbus1, port 1, addr 1 (disconnected)
Jan 26 13:11:29 mizar kernel: xhci0: Controller halt timeout.
Jan 26 13:11:30 mizar kernel: xhci0: Controller reset timeout.
Jan 26 13:11:31 mizar syslogd: last message repeated 1 times
Jan 26 13:11:31 mizar kernel: uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
Jan 26 13:11:31 mizar kernel: uhub2: 4 ports with 4 removable, self powered

- This condition can only be remedied by rebooting the machine.
Comment 1 Hans Petter Selasky freebsd_committer 2020-01-26 22:50:25 UTC
Can you try a 12-stable kernel?

Might have something to do with:

PR 237666

--HPS
Comment 2 Martin Birgmeier 2020-01-27 17:46:37 UTC
I have a feeling that this might be similar to bug #196332 (which I also submitted), except that now I have different external devices connected.

It only occurs sporadically now, though.

Maybe it is a quirk of the XHCI chip?

-- Martin
Comment 3 Martin Birgmeier 2020-01-27 17:49:27 UTC
... the laptop is more than 8 years old
Comment 4 Hans Petter Selasky freebsd_committer 2020-01-27 18:02:37 UTC
Make sure there is good contact on the USB pins at the USB host.
Comment 5 Martin Birgmeier 2020-01-27 18:14:17 UTC
I am cleaning it regularly...

Furthermore, some issue seems to have existed for a long time (see the referenced PR).

Also, at the latest after unplugging and replugging it should recover, but it does not.

Finally, rebooting with the cables still plugged in corrects the issue.

... which is to say I am more leaning towards SW issues or a controller weakness - around 2011 XHCI must have been fairly new.

-- Martin
Comment 6 Martin Birgmeier 2020-05-30 11:16:44 UTC
Maybe this is caused by a HW latch-up due to high voltage differences when plugging in (cheap power supplies).

Let us close this for now.

-- Martin