Bug 276428 - NEC uPD720200 USB 3.0 Host Controller - Controller Halt/Reset
Summary: NEC uPD720200 USB 3.0 Host Controller - Controller Halt/Reset
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 14.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2024-01-18 16:10 UTC by Slawomir Wojciech Wojtczak
Modified: 2024-01-18 18:17 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 Slawomir Wojciech Wojtczak 2024-01-18 16:10:16 UTC
Hi,

this USB 3.0 controller from ThinkPad W520 often halts/resets itself rendering it unusable till next reboot.

# dmesg
xhci0: Controller halt timeout.
xhci0: Controller reset timeout.
xhci0: Controller reset timeout.
uhub2 on usbus1
uhub2: <(0x1033) XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
uhub2: 4 ports with 4 removable, self powered
xhci0: Resetting controller
usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored)
ugen1.2: <Unknown > at usbus1 (disconnected)
uhub_reattach_port: could not allocate new device
usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored)
ugen1.2: <Unknown > at usbus1 (disconnected)
uhub_reattach_port: could not allocate new device
uhub2: at usbus1, port 1, addr 1 (disconnected)
uhub2: detached
xhci0: Controller halt timeout.
xhci0: Controller reset timeout.

# pciconf -lv xhci0                                                   
xhci0@pci0:14:0:0:      class=0x0c0330 rev=0x04 hdr=0x00 vendor=0x1033 device=0x0194 subvendor=0x17aa subdevice=0x21cf
    vendor     = 'NEC Corporation'
    device     = 'uPD720200 USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB

Regards,
vermaden
Comment 1 Tomasz "CeDeROM" CEDRO 2024-01-18 16:54:02 UTC
Hey there :-) I have that controller in desktop as additional PCI-E card for USB access to bhyve vms. Works for me without a problem.

FreeBSD octagon 13.2-RELEASE-p8 FreeBSD 13.2-RELEASE-p8 GENERIC amd64

xhci1: <NEC uPD720200 USB 3.0 controller> mem 0xfe400000-0xfe401fff at device 0.0 on pci6
xhci1: 32 bytes context size, 32-bit DMA
usbus1 on xhci1
usbus1: 5.0Gbps Super Speed USB v3.0

xhci1@pci0:6:0:0:       class=0x0c0330 rev=0x03 hdr=0x00 vendor=0x1033 device=0x0194 subvendor=0x1028 subdevice=0x0498
    vendor     = 'NEC Corporation'
    device     = 'uPD720200 USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB

From the pciconf output I can see I have older revision rev=0x04 (you have rev=0x04) also the subvendor and subdevice differs.

Have you tried updating BIOS and controller firmware?

Have you tried using different USB cable?

Are you using USB HUB on the way?

Have you tried playing with sysctl values (man xhci)?

:-)
Comment 2 Tomasz "CeDeROM" CEDRO 2024-01-18 16:55:44 UTC
Also can you power_off / power_on / reset the hub with usbconfig ?
Comment 3 Slawomir Wojciech Wojtczak 2024-01-18 17:06:53 UTC
(In reply to Tomasz "CeDeROM" CEDRO from comment #2)

Thank You I will try all these suggestions.
Comment 4 Slawomir Wojciech Wojtczak 2024-01-18 17:14:51 UTC
(In reply to Tomasz "CeDeROM" CEDRO from comment #2)

The power on/off does not seem to work.

% usbconfig | grep -i xhci 
ugen1.1: <(0x1033) XHCI root HUB> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)

% doas usbconfig -u 1 -a 1 power_off
usbconfig: could not set power OFF: Invalid argument

doas usbconfig -u 1 -a 1 power_on 
usbconfig: could not set power ON: Invalid argument
Comment 5 Tomasz "CeDeROM" CEDRO 2024-01-18 17:32:00 UTC
usbconfig -d 1.1 reset :-)

also see the bios setup options on power saving etc :-)
Comment 6 Slawomir Wojciech Wojtczak 2024-01-18 17:37:47 UTC
(In reply to Tomasz "CeDeROM" CEDRO from comment #1)

> Have you tried updating BIOS and controller firmware?

Do you have any guide on that?

> Have you tried using different USB cable?

It it a USB drive - a working one - works fine on other controller/port.
Comment 7 Tomasz "CeDeROM" CEDRO 2024-01-18 18:07:43 UTC
Here is the BIOS update download page:

https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-w-series-laptops/thinkpad-w520/downloads/driver-list/component?name=BIOS%2FUEFI&id=5AC6A815-321D-440E-8833-B07A93E0428C

This is the original drivers page for W520 and it states Renesas USB 3.0 controller:

https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-w-series-laptops/thinkpad-w520/downloads/ds015025-usb-30-driver-for-windows-7-32-bit-64-bit-vista-32-bit-64-bit-xp-thinkpad?category=USB%20Device,%20FireWire,%20IEEE%201394,%20Thunderbolt

Or the newer one but it also says "This software is Renesas' original device driver for Sunix USB3.0 Add-in Card for Windows Operating System that operates USB 3.0 Host controllers uPD720200 and uPD720200A":

https://pcsupport.lenovo.com/us/en/downloads/ds013548-usb-30-host-controller-driver-for-windows-7-32-bit-and-64-bit-vista-32-bit-and-64-bit-xp-thinkcentre-m-series-edge-series-thinkstation

I found some github repo with similar controller firmwares + update utility. This may come from/with a driver package. This NEC controler may be also customized by Renesas / Sunix thus different behavior?
Comment 8 Slawomir Wojciech Wojtczak 2024-01-18 18:17:30 UTC
(In reply to Tomasz "CeDeROM" CEDRO from comment #7)

Thank You - will try that later.