Skip to content

Commit

Permalink
usb: xhci-hcd: add a gratuitous doorbell read
Browse files Browse the repository at this point in the history
This may assist in debugging #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.

Signed-off-by: Jonathan Bell <[email protected]>
  • Loading branch information
P33M committed Oct 22, 2024
1 parent 25b2b36 commit 29096b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/host/xhci-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ void xhci_ring_ep_doorbell(struct xhci_hcd *xhci,

trace_xhci_ring_ep_doorbell(slot_id, DB_VALUE(ep_index, stream_id));

/* Incurs ~1.2us round-trip time (and wakes the link) */
readl(db_addr);
writel(DB_VALUE(ep_index, stream_id), db_addr);
/* flush the write */
readl(db_addr);
Expand Down

0 comments on commit 29096b4

Please sign in to comment.