aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2014-06-24 10:14:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-24 12:29:35 -0400
commit6fcfb0d682a8212d321a6131adc94daf0905992a (patch)
tree92c42c45ff79599d505b0a86c601662f47701ad8
parent135e7d0d4a488df06c2301c74e190a8aff6f75ab (diff)
xhci: Use correct SLOT ID when handling a reset device command
Command completion events normally include command completion status, SLOT_ID, and a pointer to the original command. Reset device command completion SLOT_ID may be zero according to xhci specs 4.6.11. VIA controllers set the SLOT_ID to zero, triggering a WARN_ON in the command completion handler. Use the SLOT ID found from the original command instead. This patch should be applied to stable kernels since 3.13 that contain the commit 20e7acb13ff48fbc884d5918c3697c27de63922a "xhci: use completion event's slot id rather than dig it out of command" Cc: stable@vger.kernel.org # 3.13 Reported-by: Saran Neti <sarannmr@gmail.com> Tested-by: Saran Neti <sarannmr@gmail.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci-ring.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index d67ff71209f5..71657d39a578 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1433,8 +1433,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
1433 xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code); 1433 xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code);
1434 break; 1434 break;
1435 case TRB_RESET_DEV: 1435 case TRB_RESET_DEV:
1436 WARN_ON(slot_id != TRB_TO_SLOT_ID( 1436 /* SLOT_ID field in reset device cmd completion event TRB is 0.
1437 le32_to_cpu(cmd_trb->generic.field[3]))); 1437 * Use the SLOT_ID from the command TRB instead (xhci 4.6.11)
1438 */
1439 slot_id = TRB_TO_SLOT_ID(
1440 le32_to_cpu(cmd_trb->generic.field[3]));
1438 xhci_handle_cmd_reset_dev(xhci, slot_id, event); 1441 xhci_handle_cmd_reset_dev(xhci, slot_id, event);
1439 break; 1442 break;
1440 case TRB_NEC_GET_FW: 1443 case TRB_NEC_GET_FW: