提交 6fcfb0d6 编写于 作者: M Mathias Nyman 提交者: Greg Kroah-Hartman

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 20e7acb1
"xhci: use completion event's slot id rather than dig it out of command"

Cc: stable@vger.kernel.org # 3.13
Reported-by: NSaran Neti <sarannmr@gmail.com>
Tested-by: NSaran Neti <sarannmr@gmail.com>
Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 135e7d0d
...@@ -1433,8 +1433,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, ...@@ -1433,8 +1433,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code); xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code);
break; break;
case TRB_RESET_DEV: case TRB_RESET_DEV:
WARN_ON(slot_id != TRB_TO_SLOT_ID( /* SLOT_ID field in reset device cmd completion event TRB is 0.
le32_to_cpu(cmd_trb->generic.field[3]))); * 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); xhci_handle_cmd_reset_dev(xhci, slot_id, event);
break; break;
case TRB_NEC_GET_FW: case TRB_NEC_GET_FW:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册