Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248791
b: refs/heads/master
c: 9dee9a2
h: refs/heads/master
i:
  248789: c19441a
  248787: 4dfdac5
  248783: da3bc08
v: v3
  • Loading branch information
Matt Evans authored and Sarah Sharp committed May 2, 2011
1 parent 10704e2 commit aee591b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8
refs/heads/master: 9dee9a213cb90fdc13118ab221f65c9fa6944f7a
18 changes: 11 additions & 7 deletions trunk/drivers/usb/host/xhci-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2171,8 +2171,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
/*
* 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).
* 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;
int update_ptrs = 1;
Expand All @@ -2181,15 +2183,15 @@ static void xhci_handle_event(struct xhci_hcd *xhci)
xhci_dbg(xhci, "In %s\n", __func__);
if (!xhci->event_ring || !xhci->event_ring->dequeue) {
xhci->error_bitmask |= 1 << 1;
return;
return 0;
}

event = xhci->event_ring->dequeue;
/* Does the HC or OS own the TRB? */
if ((le32_to_cpu(event->event_cmd.flags) & TRB_CYCLE) !=
xhci->event_ring->cycle_state) {
xhci->error_bitmask |= 1 << 2;
return;
return 0;
}
xhci_dbg(xhci, "%s - OS owns TRB\n", __func__);

Expand Down Expand Up @@ -2233,15 +2235,17 @@ static void xhci_handle_event(struct xhci_hcd *xhci)
if (xhci->xhc_state & XHCI_STATE_DYING) {
xhci_dbg(xhci, "xHCI host dying, returning from "
"event handler.\n");
return;
return 0;
}

if (update_ptrs)
/* Update SW event ring dequeue pointer */
inc_deq(xhci, xhci->event_ring, true);

/* Are there more items on the event ring? */
xhci_handle_event(xhci);
/* Are there more items on the event ring? Caller will call us again to
* check.
*/
return 1;
}

/*
Expand Down Expand Up @@ -2323,7 +2327,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
/* FIXME this should be a delayed service routine
* 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);
/* If necessary, update the HW's version of the event ring deq ptr. */
Expand Down

0 comments on commit aee591b

Please sign in to comment.