Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xhci: add helper that checks for unhandled events on a event ring

Add unhandled_event_trb() that returns true in case xHC hardware has
written new event trbs to the event ring that driver has not yet handled.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20240217001017.29969-8-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mathias Nyman and committed by
Greg Kroah-Hartman
fbaf1889 84ac5e4f

+8 -3
+8 -3
drivers/usb/host/xhci-ring.c
··· 113 113 return urb_priv->num_tds_done == urb_priv->num_tds; 114 114 } 115 115 116 + static bool unhandled_event_trb(struct xhci_ring *ring) 117 + { 118 + return ((le32_to_cpu(ring->dequeue->event_cmd.flags) & TRB_CYCLE) == 119 + ring->cycle_state); 120 + } 121 + 116 122 static void inc_td_cnt(struct urb *urb) 117 123 { 118 124 struct urb_priv *urb_priv = urb->hcpriv; ··· 2979 2973 } 2980 2974 2981 2975 event = ir->event_ring->dequeue; 2982 - /* Does the HC or OS own the TRB? */ 2983 - if ((le32_to_cpu(event->event_cmd.flags) & TRB_CYCLE) != 2984 - ir->event_ring->cycle_state) 2976 + 2977 + if (!unhandled_event_trb(ir->event_ring)) 2985 2978 return 0; 2986 2979 2987 2980 trace_xhci_handle_event(ir->event_ring, &event->generic);