Re: Poor USB performance on ASUS 520 motherboard (no IRQ?)

From: Daniel O'Connor via freebsd-usb <freebsd-usb_at_freebsd.org>
Date: Mon, 06 Dec 2021 06:34:29 UTC
Hi,
Thanks, I discovered that if I connect the device to xhci0 it exhibits poor performance (and only shows 1000 IRQ/sec), however if I connect it to xhci1 it works fine (8kHz).

They show up slightly differently in dmesg:
xhci0: <XHCI (generic) USB 3.0 controller> mem 0xfcfa0000-0xfcfa7fff at device 0.0 on pci1
xhci0: 32 bytes context size, 64-bit DMA
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0

xhci1: <XHCI (generic) USB 3.0 controller> mem 0xfcb00000-0xfcbfffff at device 0.3 on pci7
xhci1: 64 bytes context size, 64-bit DMA
usbus1 on xhci1
usbus1: 5.0Gbps Super Speed USB v3.0

However I don't know what the "context size" means, they are different PCI IDs too:

xhci0@pci0:1:0:0:       class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1022 device=0x43ec subvendor=0x1b21 subdevice=0x1142
    vendor     = 'Advanced Micro Devices, Inc. [AMD]'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Memory, range 64, base 0xfcfa0000, size 32768, enabled
  PCI-e errors = Correctable Error Detected
                 Unsupported Request Detected
     Corrected = Advisory Non-Fatal Error

xhci1@pci0:7:0:3:       class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15e0 subvendor=0x1043 subdevice=0x876b
    vendor     = 'Advanced Micro Devices, Inc. [AMD]'
    device     = 'Raven USB 3.1'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Memory, range 64, base 0xfcb00000, size 1048576, enabled

I tried changing the imod value from 500 to 125 but it had no impact on the IRQ rate so I guess perhaps that controller is broken in some way..

> On 4 Dec 2021, at 16:32, Hans Petter Selasky <hps@selasky.org> wrote:
> 
> On 12/4/21 03:12, Daniel O'Connor via freebsd-usb wrote:
>> How can I change it?
> 
> Please refer to this:
> 
>        /* set up interrupt rate */
>        XWRITE4(sc, runt, XHCI_IMOD(0), sc->sc_imod_default);
> 
> --HPS

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum