summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2014-06-24 17:14:40 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-09 11:18:23 -0700
commita82d63ba320abc0e13b8354227918db3785c968c (patch)
tree38ad7fd732aacf0df5e181a62ee44e1ebff031fe /drivers/usb/host/xhci-ring.c
parent5b827636a4492d98c6cb66f68c567cd45f683264 (diff)
downloadlinux-stable-a82d63ba320abc0e13b8354227918db3785c968c.tar.gz
linux-stable-a82d63ba320abc0e13b8354227918db3785c968c.tar.bz2
linux-stable-a82d63ba320abc0e13b8354227918db3785c968c.zip
xhci: Use correct SLOT ID when handling a reset device command
commit 6fcfb0d682a8212d321a6131adc94daf0905992a upstream. 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" 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>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-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 dff9b5ead3b3..7ece1582efa7 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1578,8 +1578,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code);
break;
case TRB_RESET_DEV:
- WARN_ON(slot_id != TRB_TO_SLOT_ID(
- le32_to_cpu(cmd_trb->generic.field[3])));
+ /* SLOT_ID field in reset device cmd completion event TRB is 0.
+ * Use the SLOT_ID from the command TRB instead (xhci 4.6.11)
+ */
+ slot_id = TRB_TO_SLOT_ID(
+ le32_to_cpu(cmd_trb->generic.field[3]));
xhci_handle_cmd_reset_dev(xhci, slot_id, event);
break;
case TRB_NEC_GET_FW: