When passing through a TUSB7340 PCIe USB 3.0 controller on a PowerNV POWER9 
host using qemu, the controller initially appears to function but is unstable, 
leading to increasing errors / data corruption and an eventual disconnect of 
the attached USB device(s).  This is with Linux 6.18.38 on both host and guest, 
however the same instability also appears with Debian Stable (6.12) kernels.

With an Empia USB device, an example of the instability in dmesg is a series of 
errors which repeats sporadically every few hours:

em28xx 1-4:1.0: reading from i2c device at 0x1c failed (error=-5)
em28xx 1-4:1.0: failed to get i2c transfer status from bridge register 
(error=-5)
em28xx 1-4:1.0: writing to i2c device at 0x1c failed (error=-5)
em28xx 1-4:1.0: failed to get i2c transfer status from bridge register 
(error=-5)

These errors eventually culminate in a device failure after 2-3 days of guest 
uptime:

usb 1-4: USB disconnect, device number 2
em28xx 1-4:1.0: Disconnecting em28xx #1
em28xx 1-4:1.0: Disconnecting em28xx

Any attempt to reset the guest at this point will not bring the device back 
online, likely because data corruption has caused the device to lock up (i.e. 
writing bad data to control registers).  Note this issue persists across 
multiple different systems and devices, it is *not* a device specific hardware 
failure or a power problem.

My suspicion is either data corruption in DMA between guest and host or lost 
interrupts from the XHCI controller to the guest.  It should be relatively easy 
to reproduce using an off the shelf TUSB7340 EVM card and one of the 
inexpensive Empia-based ATSC USB tuner sticks; though it is likely that other 
EHCI devices will also experience data corruption, it will be harder to detect 
e.g. a handful of corrupt bytes on a USB mass storage device vs. the very 
obvious bridge failures on the tuner sticks.

Reply via email to