xhci: Remove recursive call to xhci_handle_event
Make the caller loop while there are events to handle, instead. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
This commit is contained in:
@@ -2171,8 +2171,10 @@ cleanup:
|
|||||||
/*
|
/*
|
||||||
* This function handles all OS-owned events on the event ring. It may drop
|
* This function handles all OS-owned events on the event ring. It may drop
|
||||||
* xhci->lock between event processing (e.g. to pass up port status changes).
|
* xhci->lock between event processing (e.g. to pass up port status changes).
|
||||||
|
* Returns >0 for "possibly more events to process" (caller should call again),
|
||||||
|
* otherwise 0 if done. In future, <0 returns should indicate error code.
|
||||||
*/
|
*/
|
||||||
static void xhci_handle_event(struct xhci_hcd *xhci)
|
static int xhci_handle_event(struct xhci_hcd *xhci)
|
||||||
{
|
{
|
||||||
union xhci_trb *event;
|
union xhci_trb *event;
|
||||||
int update_ptrs = 1;
|
int update_ptrs = 1;
|
||||||
@@ -2181,7 +2183,7 @@ static void xhci_handle_event(struct xhci_hcd *xhci)
|
|||||||
xhci_dbg(xhci, "In %s\n", __func__);
|
xhci_dbg(xhci, "In %s\n", __func__);
|
||||||
if (!xhci->event_ring || !xhci->event_ring->dequeue) {
|
if (!xhci->event_ring || !xhci->event_ring->dequeue) {
|
||||||
xhci->error_bitmask |= 1 << 1;
|
xhci->error_bitmask |= 1 << 1;
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
event = xhci->event_ring->dequeue;
|
event = xhci->event_ring->dequeue;
|
||||||
@@ -2189,7 +2191,7 @@ static void xhci_handle_event(struct xhci_hcd *xhci)
|
|||||||
if ((le32_to_cpu(event->event_cmd.flags) & TRB_CYCLE) !=
|
if ((le32_to_cpu(event->event_cmd.flags) & TRB_CYCLE) !=
|
||||||
xhci->event_ring->cycle_state) {
|
xhci->event_ring->cycle_state) {
|
||||||
xhci->error_bitmask |= 1 << 2;
|
xhci->error_bitmask |= 1 << 2;
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
xhci_dbg(xhci, "%s - OS owns TRB\n", __func__);
|
xhci_dbg(xhci, "%s - OS owns TRB\n", __func__);
|
||||||
|
|
||||||
@@ -2233,15 +2235,17 @@ static void xhci_handle_event(struct xhci_hcd *xhci)
|
|||||||
if (xhci->xhc_state & XHCI_STATE_DYING) {
|
if (xhci->xhc_state & XHCI_STATE_DYING) {
|
||||||
xhci_dbg(xhci, "xHCI host dying, returning from "
|
xhci_dbg(xhci, "xHCI host dying, returning from "
|
||||||
"event handler.\n");
|
"event handler.\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update_ptrs)
|
if (update_ptrs)
|
||||||
/* Update SW event ring dequeue pointer */
|
/* Update SW event ring dequeue pointer */
|
||||||
inc_deq(xhci, xhci->event_ring, true);
|
inc_deq(xhci, xhci->event_ring, true);
|
||||||
|
|
||||||
/* Are there more items on the event ring? */
|
/* Are there more items on the event ring? Caller will call us again to
|
||||||
xhci_handle_event(xhci);
|
* check.
|
||||||
|
*/
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2323,7 +2327,7 @@ hw_died:
|
|||||||
/* FIXME this should be a delayed service routine
|
/* FIXME this should be a delayed service routine
|
||||||
* that clears the EHB.
|
* that clears the EHB.
|
||||||
*/
|
*/
|
||||||
xhci_handle_event(xhci);
|
while (xhci_handle_event(xhci) > 0) {}
|
||||||
|
|
||||||
temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
|
temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
|
||||||
/* If necessary, update the HW's version of the event ring deq ptr. */
|
/* If necessary, update the HW's version of the event ring deq ptr. */
|
||||||
|
Reference in New Issue
Block a user