Solved USB 3.0 problems

Very similar to Thread usb-3-0-problem.49272, but on real hardware, USB3 has stopped working: an attached keyboard and mouse are unresponsive at the login prompt.

The OS version is 13.0-RELEASE-p7.

The boot log (from dmesg(8)) also contains
Code:
[...]
xhci0: <XHCI (generic) USB 3.0 controller> mem 0xfe400000-0xfe400fff irq 48 at device 0.0 on pci2
xhci0: 32 bytes context size, 64-bit DMA
xhci0: Controller halt timeout.
xhci0: XHCI halt/start/probe failed err=18
xhci0: Controller halt timeout.
xhci0: Controller reset timeout.
device_attach: xhci0 attach returned 6
[...]

The strange thing is that it did work yesterday (and everyday prior, for that matter) until today.
Keyboard and mouse are now attached to USB2 ports.

USB storage devices also do not work on the USB3 ports (a thumbdrive's LED shortly lights up then turns off again), no dmesg() output.

Can there be a software issue? Or did the USB3 hub die?
 
Your dmesg output indicates that there is a problem ... but you knew that already, it's not working. The debugging output it not particularly helpful: Error 18 is EXDEV, which seems like an unlikely error (why would the USB driver try to make a hard link). The final error 6 probably just indicates that xhci0 has been unconfigured, which seems likely given the error messages above.

What does the output from various flavors of the usbconfig command show?
 
Your dmesg output indicates that there is a problem ... but you knew that already, it's not working. The debugging output it not particularly helpful: Error 18 is EXDEV, which seems like an unlikely error (why would the USB driver try to make a hard link). The final error 6 probably just indicates that xhci0 has been unconfigured, which seems likely given the error messages above.

What does the output from various flavors of the usbconfig command show?
I've tried usbconfig list and usbconfig dump_all_desc. I don't see any USB3 controller (xHCI)

Code:
# usbconfig list
ugen2.1: <ATI OHCI root HUB> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen5.1: <ATI OHCI root HUB> at usbus5, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen0.1: <ATI OHCI root HUB> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen1.1: <ATI EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen3.1: <ATI EHCI root HUB> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen4.1: <ATI OHCI root HUB> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen6.1: <ATI EHCI root HUB> at usbus6, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen5.2: <Cherry wired keyboard> at usbus5, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (150mA)
ugen5.3: <Logitech USB-PS/2 Optical Mouse> at usbus5, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (98mA)

Code:
# usbconfig dump_all_desc
ugen2.1: <ATI OHCI root HUB> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0100
  bDeviceClass = 0x0009  <HUB>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <ATI>
  iProduct = 0x0002  <OHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0019
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0040
    bMaxPower = 0x0000

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0009  <HUB>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0020
        bInterval = 0x00ff
        bRefresh = 0x0000
        bSynchAddress = 0x0000



ugen5.1: <ATI OHCI root HUB> at usbus5, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0100
  bDeviceClass = 0x0009  <HUB>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <ATI>
  iProduct = 0x0002  <OHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0019
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0040
    bMaxPower = 0x0000

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0009  <HUB>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0020
        bInterval = 0x00ff
        bRefresh = 0x0000
        bSynchAddress = 0x0000



ugen0.1: <ATI OHCI root HUB> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0100
  bDeviceClass = 0x0009  <HUB>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <ATI>
  iProduct = 0x0002  <OHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0019
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0040
    bMaxPower = 0x0000

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0009  <HUB>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0020
        bInterval = 0x00ff
        bRefresh = 0x0000
        bSynchAddress = 0x0000



ugen1.1: <ATI EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0009  <HUB>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <ATI>
  iProduct = 0x0002  <EHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0019
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0040
    bMaxPower = 0x0000

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0009  <HUB>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008
        bInterval = 0x00ff
        bRefresh = 0x0000
        bSynchAddress = 0x0000



ugen3.1: <ATI EHCI root HUB> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0009  <HUB>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <ATI>
  iProduct = 0x0002  <EHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0019
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0040
    bMaxPower = 0x0000

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0009  <HUB>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008
        bInterval = 0x00ff
        bRefresh = 0x0000
        bSynchAddress = 0x0000



ugen4.1: <ATI OHCI root HUB> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0100
  bDeviceClass = 0x0009  <HUB>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <ATI>
  iProduct = 0x0002  <OHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0019
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0040
    bMaxPower = 0x0000

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0009  <HUB>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0020
        bInterval = 0x00ff
        bRefresh = 0x0000
        bSynchAddress = 0x0000



ugen6.1: <ATI EHCI root HUB> at usbus6, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0009  <HUB>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <ATI>
  iProduct = 0x0002  <EHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0019
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0040
    bMaxPower = 0x0000

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0009  <HUB>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008
        bInterval = 0x00ff
        bRefresh = 0x0000
        bSynchAddress = 0x0000



ugen5.2: <Cherry wired keyboard> at usbus5, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (150mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x046a
  idProduct = 0x007e
  bcdDevice = 0x0102
  iManufacturer = 0x0001  <Cherry>
  iProduct = 0x0002  <wired keyboard>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0022
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00a0
    bMaxPower = 0x004b

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0003  <HID device>
      bInterfaceSubClass = 0x0001
      bInterfaceProtocol = 0x0001
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x10
       RAW dump:
       0x00 | 0x09, 0x21, 0x10, 0x01, 0x00, 0x01, 0x22, 0x41,
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008
        bInterval = 0x000a
        bRefresh = 0x0000
        bSynchAddress = 0x0000



ugen5.3: <Logitech USB-PS/2 Optical Mouse> at usbus5, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (98mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x046d
  idProduct = 0xc050
  bcdDevice = 0x2720
  iManufacturer = 0x0001  <Logitech>
  iProduct = 0x0002  <USB-PS/2 Optical Mouse>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0022
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00a0
    bMaxPower = 0x0031

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0003  <HID device>
      bInterfaceSubClass = 0x0001
      bInterfaceProtocol = 0x0002
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x10
       RAW dump:
       0x00 | 0x09, 0x21, 0x10, 0x01, 0x00, 0x01, 0x22, 0x3b,
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0005
        bInterval = 0x000a
        bRefresh = 0x0000
        bSynchAddress = 0x0000

EDIT:

I should add that the controller seems to work (mouse and keyboard have lights on) until kernel loads.
So that would indicate to me that the controller itself is OK?
 
I should add that the controller seems to work (mouse and keyboard have lights on) until kernel loads.
So that would indicate to me that the controller itself is OK?
Well, it indicates that the controller is capable of delivering power. Doesn't mean that it works 100%. In theory, standard XHCI controllers should be supported by FreeBSD, so lack of support is probably not the problem. In practice ...

How to debug your system? Tricky question. First idea: You say keyboard works on the "sick" controller before booting, in the sense of light coming on. Try this: Connect only a keyboard using the sick controller's ports, and go into the BIOS. That allows you to do a few key strokes. Does that work? If yes, then not only power delivery works, but also communications (at very low speed with a simple protocol, but better than nothing).

For the next step, the easiest idea is differential diagnosis. And this is a lot of work: Install a different OS. You can try downloading a Linux version that can be booted and run from a memory stick, and then see whether the sick port works or not. There is no point testing a different instance of the same hardware (second motherboard), because the port used to work under FreeBSD.

Finally, you can enable debugging in the USB driver: If you look at the man page for the xhci(4) driver, you can enable debugging in loader.conf. But decoding and understanding that debug output is likely to be a difficult task.
 
Try this: Connect only a keyboard using the sick controller's ports, and go into the BIOS. That allows you to do a few key strokes.
Thank for the hints. I indeed did this prior to posting, since the whole thing left me wondering...

Even stranger is that it now seems to work: USB thumb drives are recognized again, as are mouse and keyboard.

usbconfig list now also lists the xHCI hub (again).

For the next step, the easiest idea is differential diagnosis. And this is a lot of work: Install a different OS. You can try downloading a Linux version that can be booted and run from a memory stick, and then see whether the sick port works or not. There is no point testing a different instance of the same hardware (second motherboard), because the port used to work under FreeBSD.

Finally, you can enable debugging in the USB driver: If you look at the man page for the xhci(4) driver, you can enable debugging in loader.conf. But decoding and understanding that debug output is likely to be a difficult task.
These are nice ideas that I will try out next time (which, hopefully, never happens :))

Well, again, strange that this seems to be an intermittent issue.

Thank you again, I'll mark this problem as solved.
 
Back
Top