xhci: show fault reason for a failed enable slot command
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 21 Sep 2022 12:34:48 +0000 (15:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Sep 2022 13:52:29 +0000 (15:52 +0200)
Show the completion code of a unsuccessful "enable slot" command.
Add it in a human readable form to the existing error message.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220921123450.671459-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c

index 9f6b552..5176765 100644 (file)
@@ -4096,7 +4096,8 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
        slot_id = command->slot_id;
 
        if (!slot_id || command->status != COMP_SUCCESS) {
-               xhci_err(xhci, "Error while assigning device slot ID\n");
+               xhci_err(xhci, "Error while assigning device slot ID: %s\n",
+                        xhci_trb_comp_code_string(command->status));
                xhci_err(xhci, "Max number of devices this xHCI host supports is %u.\n",
                                HCS_MAX_SLOTS(
                                        readl(&xhci->cap_regs->hcs_params1)));