linux
linux copied to clipboard
usb: xhci-hcd: add a gratuitous doorbell read
This may assist in debugging https://github.com/raspberrypi/linux/issues/6141
The symptom is that the Interrupt endpoint for the dongle sometimes has one outstanding TRB, but the lack of USB bus activity suggests that the xHC didn't correctly register the TRB as valid when the doorbell ring happened.
Adding this dummy read seems to fix it.
--
There are probably less-bad ways to ensure consistency of memory before issuing a doorbell write, but this blunt instrument seems to work for me.
I can't tell if the root cause is the same as the gpio bitbash compression (RC swallowing writes), or some peculiarity of the xHC TRB fetch engine making this type of transfer vulnerable to stalling.