Summary: | xhci fails on Cavium ThunderX | ||
---|---|---|---|
Product: | Base System | Reporter: | Ed Maste <emaste> |
Component: | usb | Assignee: | freebsd-usb (Nobody) <usb> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | Andrew, hselasky |
Priority: | --- | Keywords: | ThunderX |
Version: | CURRENT | ||
Hardware: | arm64 | ||
OS: | Any | ||
URL: | https://reviews.freebsd.org/D4698 | ||
Bug Depends on: | |||
Bug Blocks: | 203349 |
Description
Ed Maste
![]() ![]() Hi, This looks like a problem in the PCI subsystem for ARM? Or the "rid" is not correct for MSI? Referring to sys/dev/usb/controller/xhci_pci.c. Can you boot with bootverbose on? --HPS A full boot -v log is at https://people.freebsd.org/~emaste/arm64/thunderx-verbose-boot-xhci.log Hi, I see the MSIX is working with the AHCI. in xhci_pci.c, can you try to change: (rid != 0 ? 0 : RF_SHAREABLE) Into simply: RF_SHAREABLE ? Same behaviour with that change, xhci0: <Cavium ThunderX USB 3.0 controller> mem 0x968000000000-0x9680001fffff,0x 968000200000-0x9680002fffff at device 16.0 on pci8 xhci0: 64 bytes context size, 64-bit DMA xhci0: Could not allocate IRQ device_attach: xhci0 attach returned 6 xhci0: <Cavium ThunderX USB 3.0 controller> mem 0x969000000000-0x9690001fffff,0x 969000200000-0x9690002fffff at device 17.0 on pci8 xhci0: 64 bytes context size, 64-bit DMA xhci0: Could not allocate IRQ The failing case is (pci_do_msi is 1): /* MSI capability present? */ if (cfg->msi.msi_location == 0 || !pci_do_msi) That is, we have only MSI support in xhci, not MSI-X Capabilities from my x86 desktop xhci: cap 01[70] = powerspec 2 supports D0 D3 current D0 cap 05[80] = MSI supports 8 messages, 64 bit enabled with 1 message Capabilities from the ThunderX: cap 10[70] = PCI-Express 2 endpoint max data 128(128) link x0(x0) cap 11[b0] = MSI-X supports 4 messages Table in map 0x20[0x0], PBA in map 0x20[0xf0000] ecap 000e[100] = ARI 1 ecap 000b[108] = Vendor 1 ID 160 If you in the XHCI pci attach routine set: uint8_t usemsi = 0; /* was: 1 */ --HPS Or set: hw.usb.xhci.msi=0 before booting the kernel. --HPS I added minimal support for MSI-X interrupts and found with them I don't get any xhci error messages on boot. It looks like we will need MSI-X support for ThunderX. A commit references this bug: Author: andrew Date: Thu Dec 24 09:40:29 UTC 2015 New revision: 292683 URL: https://svnweb.freebsd.org/changeset/base/292683 Log: Ads support to the xhci pci attachment to use MSI-X interrupts when available. As with MSI interrupts these can be disabled by setting hw.usb.xhci.msix to 0 in the loader. MSI-X interrupts are needed on some hardware, for example the Cavium ThunderX only supports them, and with this we don't fall back to polling. PR: 204378 Reviewed by: hselasky, jhb MFC after: 1 week (after r292669) Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D4698 Changes: head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c |