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: Don't check if the event ring is valid before every event TRB

Check if the event ring exists and is valid once when the event handler
is called, not before every individual event TRB.

At this point the interrupter is valid, so no need to check that.

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-9-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mathias Nyman and committed by
Greg Kroah-Hartman
84008be8 fbaf1889

+6 -6
+6 -6
drivers/usb/host/xhci-ring.c
··· 2972 2972 union xhci_trb *event; 2973 2973 u32 trb_type; 2974 2974 2975 - /* Event ring hasn't been allocated yet. */ 2976 - if (!ir || !ir->event_ring || !ir->event_ring->dequeue) { 2977 - xhci_err(xhci, "ERROR interrupter not ready\n"); 2978 - return -ENOMEM; 2979 - } 2980 - 2981 2975 event = ir->event_ring->dequeue; 2982 2976 2983 2977 if (!unhandled_event_trb(ir->event_ring)) ··· 3074 3080 u64 temp; 3075 3081 3076 3082 xhci_clear_interrupt_pending(xhci, ir); 3083 + 3084 + /* Event ring hasn't been allocated yet. */ 3085 + if (!ir->event_ring || !ir->event_ring->dequeue) { 3086 + xhci_err(xhci, "ERROR interrupter event ring not ready\n"); 3087 + return -ENOMEM; 3088 + } 3077 3089 3078 3090 if (xhci->xhc_state & XHCI_STATE_DYING || 3079 3091 xhci->xhc_state & XHCI_STATE_HALTED) {