[RFC PATCH 0/3] Try to fix XHCI console on AMD systems (help needed)

Marek Marczykowski-Górecki posted 3 patches 1 year, 5 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.932f486c1b08268190342f8918b09fa6a7c3f149.1670724490.git-series.marmarek@invisiblethingslab.com
xen/arch/x86/include/asm/fixmap.h |   4 +-
xen/drivers/char/xhci-dbc.c       | 116 +++++++++++++++++++++++++------
2 files changed, 98 insertions(+), 22 deletions(-)
[RFC PATCH 0/3] Try to fix XHCI console on AMD systems (help needed)
Posted by Marek Marczykowski-Górecki 1 year, 5 months ago
This series has two fixes to the xhci console for AMD systems. But it isn't
enough to get it working. The third patch allows collecting some debug info.

It got me this:

    (XEN) dbc error: timeout 2
    (XEN) dbc debug: XHCI DBC DUMP:
    (XEN) dbc debug:     ctrl: 0x800f0000 stat: 0x6000000 psc: 0x621063
    (XEN) dbc debug:     id: 0xf000a, db: 0x0
    (XEN) dbc debug:     erstsz: 1, erstba: 0xcbebb000
    (XEN) dbc debug:     erdp: 0xcbe7b000, cp: 0xcbebb010
    (XEN) dbc debug:     ddi1: 0x1d6b0000, ddi2: 0x10
    (XEN) dbc debug:     erstba == virt_to_dma(erst): 1
    (XEN) dbc debug:     erdp == virt_to_dma(erst[0].base): 1
    (XEN) dbc debug:     cp == virt_to_dma(ctx): 1

On the other side of the cable I got:

    usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    usb 2-2: Device not responding to setup address.
    usb 2-2: Device not responding to setup address.
    usb 2-2: device not accepting address 92, error -71
    usb usb2-port2: attempt power cycle
    usb 2-2: Device not responding to setup address.
    usb 2-2: Device not responding to setup address.
    usb 2-2: device not accepting address 93, error -71
    usb 2-2: Device not responding to setup address.
    usb 2-2: Device not responding to setup address.
    usb 2-2: device not accepting address 94, error -71
    usb usb2-port2: unable to enumerate USB device

Linux seems to reset the port only for Intel, so I tried to disable that part,
but it still didn't work - I got this instead:

    (XEN) dbc error: timeout 2
    (XEN) dbc debug: XHCI DBC DUMP:
    (XEN) dbc debug:     ctrl: 0x800f0000 stat: 0x0 psc: 0xa0
    (XEN) dbc debug:     id: 0xf000a, db: 0x0
    (XEN) dbc debug:     erstsz: 1, erstba: 0xcbebb000
    (XEN) dbc debug:     erdp: 0xcbe7b000, cp: 0xcbebb010
    (XEN) dbc debug:     ddi1: 0x1d6b0000, ddi2: 0x10
    (XEN) dbc debug:     erstba == virt_to_dma(erst): 1
    (XEN) dbc debug:     erdp == virt_to_dma(erst[0].base): 1
    (XEN) dbc debug:     cp == virt_to_dma(ctx): 1

And then on the other side of the cable, I got:

    [16773160.618004] usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    [16773164.850055] usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    [16773168.938085] usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    [16773168.938380] usb usb2-port2: attempt power cycle
    [16773173.102097] usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    [16773177.190139] usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    [16773177.190431] usb usb2-port2: unable to enumerate USB device
    [16773181.262176] usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    [16773185.494221] usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    [16773189.582247] usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    [16773189.582542] usb usb2-port2: attempt power cycle

The xhci console works fine from within native Linux, when enabled with:

    echo enable > /sys/bus/pci/devices/0000:04:00.3/dbc

I did not managed to get it working via earlyprintk=xhci (but I'm not sure if
that's specific to this hardware, or something else - haven't tried
earlyprintk=xhci anywhere else).

Info about the xhci from native linux:
    04:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1 (prog-if 30 [XHCI])
        Subsystem: Hewlett-Packard Company Device 8730
        Flags: bus master, fast devsel, latency 0, IRQ 44, IOMMU group 5
        Memory at e0300000 (64-bit, non-prefetchable) [size=1M]
        Capabilities: [48] Vendor Specific Information: Len=08 <?>
        Capabilities: [50] Power Management version 3
        Capabilities: [64] Express Endpoint, MSI 00
        Capabilities: [a0] MSI: Enable- Count=1/8 Maskable- 64bit+
        Capabilities: [c0] MSI-X: Enable+ Count=8 Masked-
        Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
        Kernel driver in use: xhci_hcd

I tried to find AMD's equivalet of
https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf
to see if there are any differences (shouldn't be...), but I haven't found
anything like this.

Any ideas what is wrong?

Marek Marczykowski-Górecki (3):
  drivers/char: support up to 1M BAR0 of xhci
  drivers/char: search all buses for xhci
  DEBUG: dump xhci state on connection timeout

 xen/arch/x86/include/asm/fixmap.h |   4 +-
 xen/drivers/char/xhci-dbc.c       | 116 +++++++++++++++++++++++++------
 2 files changed, 98 insertions(+), 22 deletions(-)

base-commit: f86d0a1ff200264aaf80b65d7d200a3ba19c7845
-- 
git-series 0.9.1