Skip to content

Commit 7919407

Browse files
Su Huigregkh
authored andcommitted
usb: xhci: print xhci->xhc_state when queue_command failed
When encounters some errors like these: xhci_hcd 0000:4a:00.2: xHCI dying or halted, can't queue_command xhci_hcd 0000:4a:00.2: FIXME: allocate a command ring segment usb usb5-port6: couldn't allocate usb_device It's hard to know whether xhc_state is dying or halted. So it's better to print xhc_state's value which can help locate the resaon of the bug. Signed-off-by: Su Hui <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ea83bf0 commit 7919407

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4375,7 +4375,8 @@ static int queue_command(struct xhci_hcd *xhci, struct xhci_command *cmd,
43754375

43764376
if ((xhci->xhc_state & XHCI_STATE_DYING) ||
43774377
(xhci->xhc_state & XHCI_STATE_HALTED)) {
4378-
xhci_dbg(xhci, "xHCI dying or halted, can't queue_command\n");
4378+
xhci_dbg(xhci, "xHCI dying or halted, can't queue_command. state: 0x%x\n",
4379+
xhci->xhc_state);
43794380
return -ESHUTDOWN;
43804381
}
43814382

0 commit comments

Comments
 (0)