提交 284d2055 编写于 作者: M Mathias Nyman 提交者: Sarah Sharp

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 b92cc66c "xHCI: add aborting
command ring function"
Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Reported-by: NGiovanni <giovanni.nervi@yahoo.com>
Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
上级 9d23108d
...@@ -1414,6 +1414,12 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, ...@@ -1414,6 +1414,12 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
inc_deq(xhci, xhci->cmd_ring); inc_deq(xhci, xhci->cmd_ring);
return; return;
} }
/* There is no command to handle if we get a stop event when the
* command ring is empty, event->cmd_trb points to the next
* unset command
*/
if (xhci->cmd_ring->dequeue == xhci->cmd_ring->enqueue)
return;
} }
switch (le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3]) switch (le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册