aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2013-09-05 04:01:20 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-09-23 18:43:30 -0400
commit284d20552461466b04d6bfeafeb1c47a8891b591 (patch)
tree7b929fc25193a67c728614f417bd9cf0f437bb90
parent9d23108df359e572a0dca0b631bfee9f5e0fa9ea (diff)
xhci: Fix oops happening after address device timeout
When a command times out, the command ring is first aborted, and then stopped. If the command ring is empty when it is stopped the stop event will point to next command which is not yet set. xHCI tries to handle this next event often causing an oops. Don't handle command completion events on stopped cmd ring if ring is empty. This patch should be backported to kernels as old as 3.7, that contain the commit b92cc66c047ff7cf587b318fe377061a353c120f "xHCI: add aborting command ring function" Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Reported-by: Giovanni <giovanni.nervi@yahoo.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org
-rw-r--r--drivers/usb/host/xhci-ring.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 411da1fc7ae8..aaa2906f7b78 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1414,6 +1414,12 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
1414 inc_deq(xhci, xhci->cmd_ring); 1414 inc_deq(xhci, xhci->cmd_ring);
1415 return; 1415 return;
1416 } 1416 }
1417 /* There is no command to handle if we get a stop event when the
1418 * command ring is empty, event->cmd_trb points to the next
1419 * unset command
1420 */
1421 if (xhci->cmd_ring->dequeue == xhci->cmd_ring->enqueue)
1422 return;
1417 } 1423 }
1418 1424
1419 switch (le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3]) 1425 switch (le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3])