Bug 230659 - xhci(4) devices cannot attach after warm boot (Intel Braswell)
Summary: xhci(4) devices cannot attach after warm boot (Intel Braswell)
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 11.1-STABLE
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-15 22:10 UTC by Maxim Sobolev
Modified: 2018-08-16 18:40 UTC (History)
2 users (show)

See Also:


Attachments
debug with hw.usb.xhci.debug=16 after warm boot (436.95 KB, text/plain)
2018-08-15 22:10 UTC, Maxim Sobolev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Sobolev freebsd_committer 2018-08-15 22:10:09 UTC
Created attachment 196233 [details]
debug with hw.usb.xhci.debug=16 after warm boot

Hi, we've observed this issue with several different kinds of small board computers based off Intel Atom x5-Z8350 chipset. It has number of peripherals connected via USB3 bus.

Nornal USB-related output looks like the following:

xhci0: <Intel Braswell USB 3.0 controller> mem 0x91800000-0x9180ffff at device 20.0 on pci0
xhci0: 32 bytes context size, 64-bit DMA
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
ugen0.1: <0x8086 XHCI root HUB> at usbus0
uhub0: <0x8086 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
uhub0: 13 ports with 13 removable, self powered
ugen0.2: <Lite-On Technology Corp. USB Multimedia Keyboard> at usbus0
ukbd0 on uhub0
ukbd0: <Lite-On Technology Corp. USB Multimedia Keyboard, class 0/0, rev 1.10/1.15, addr 1> on usbus0
ugen0.3: <vendor 0x05e3 USB2.0 Hub> at usbus0
uhub1 on uhub0
uhub1: <vendor 0x05e3 USB2.0 Hub, class 9/0, rev 2.00/85.37, addr 2> on usbus0
uhub1: 4 ports with 2 removable, self powered
ugen0.4: <Arduino LLC Arduino Leonardo> at usbus0
ugen0.5: <Realtek USB 10100 LAN> at usbus0
ure0 on uhub0
ure0: <Realtek USB 10100 LAN, class 0/0, rev 2.10/20.00, addr 4> on usbus0
uhid0 on uhub0
uhid0: <Lite-On Technology Corp. USB Multimedia Keyboard, class 0/0, rev 1.10/1.15, addr 1> on usbus0
umodem0 on uhub1
umodem0: <Arduino LLC Arduino Leonardo, class 2/0, rev 2.00/1.00, addr 3> on usbus0
umodem0: data interface 1, has no CM over data, has break
uhid1 on uhub1
uhid1: <Arduino LLC Arduino Leonardo, class 2/0, rev 2.00/1.00, addr 3> on usbus0
ue0: <USB Ethernet> on ure0
ue0: Ethernet address: 00:e0:4c:36:ed:f0
ue0: link state changed to DOWN
ue0: link state changed to UP

Everything works fine after a cold boot, but when the system is rebooted without taking power down, number of USB devices including network controller fail to attach with the following error message(s):

Jul 17 14:18:10 alx20 kernel: usb_alloc_device: set address 5 failed (USB_ERR_IOERROR, ignored)
Jul 17 14:18:10 alx20 kernel: usbd_setup_device_desc: getting device descriptor at addr 5 failed, USB_ERR_IOERROR
Jul 17 14:18:10 alx20 kernel: usbd_req_re_enumerate: addr=5, set address failed! (USB_ERR_IOERROR, ignored)
Jul 17 14:18:10 alx20 kernel: usbd_setup_device_desc: getting device descriptor at addr 5 failed, USB_ERR_IOERROR
Jul 17 14:18:10 alx20 kernel: usbd_req_re_enumerate: addr=5, set address failed! (USB_ERR_IOERROR, ignored)
Jul 17 14:18:10 alx20 kernel: usbd_setup_device_desc: getting device descriptor at addr 5 failed, USB_ERR_IOERROR
Jul 17 14:18:10 alx20 kernel: usbd_req_re_enumerate: addr=5, set address failed! (USB_ERR_IOERROR, ignored)
Jul 17 14:18:10 alx20 kernel: usbd_setup_device_desc: getting device descriptor at addr 5 failed, USB_ERR_IOERROR
Jul 17 14:18:11 alx20 kernel: usbd_req_re_enumerate: addr=5, set address failed! (USB_ERR_IOERROR, ignored)
Jul 17 14:18:11 alx20 kernel: usbd_setup_device_desc: getting device descriptor at addr 5 failed, USB_ERR_IOERROR
Jul 17 14:18:11 alx20 kernel: ugen0.5: <Unknown > at usbus0 (disconnected)
Jul 17 14:18:11 alx20 kernel: uhub_reattach_port: could not allocate new device

Full debug with hw.usb.xhci.debug=16 after warm boot is attached.
Comment 1 Hans Petter Selasky freebsd_committer 2018-08-16 07:09:43 UTC
Is USB support enabled in the BIOS? Can you try switching ON/OFF?
Comment 2 Maxim Sobolev freebsd_committer 2018-08-16 16:16:33 UTC
(In reply to Hans Petter Selasky from comment #1)

Yes it is enabled. If I switch it off then I have no way to switch it on, as USB keyboard is the only way to access the BIOS. I've tried to set XHCI mode to "OFF", but it has the same effect as disabling USB altogether, i.e. blocking further access to BIOS and none of the USB peripherals are working after that after FreeBSD boots. The board has no way to do "factory reset" so that this is very painful experiment as the only way to recover it after that change is to re-flash the BIOS with an external programmer. Apparently it stores settings in the same EEPROM as the rest of the BIOS code.

This is Lattepanda board in question:

https://www.dfrobot.com/product-1404.html?gclid=EAIaIQobChMI_NHk3fvx3AIVgcpkCh07nwi9EAAYAiAAEgJNB_D_BwE

If it helps in any way we can send you one for investigation. We also see this issue with this box built on the same chipset.

https://www.aliexpress.com/item/Original-Cenovo-Mini-PC-2-Intel-X5-Z8300-Quad-Core-Windows-10-2GB-4GB-RAM-32GB/32657584443.html