[RFC 09/10] xhci: More command debugging.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add debugging for Set Address and No-op commands.

Signed-off-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>
---
 drivers/usb/host/xhci-ring.c |    4 ++++
 drivers/usb/host/xhci.c      |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index eda2d7fd..3601cdf 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1517,6 +1517,9 @@ bandwidth_change:
 		complete(&xhci->devs[slot_id]->cmd_completion);
 		break;
 	case TRB_TYPE(TRB_ADDR_DEV):
+		xhci_dbg(xhci, "Set Address command completion for %016llx, comp code %u.\n",
+				(unsigned long long) cmd_dma,
+				GET_COMP_CODE(le32_to_cpu(event->status)));
 		xhci->devs[slot_id]->cmd_status = GET_COMP_CODE(le32_to_cpu(event->status));
 		complete(&xhci->addr_dev);
 		break;
@@ -1527,6 +1530,7 @@ bandwidth_change:
 		handle_set_deq_completion(xhci, event, xhci->cmd_ring->dequeue);
 		break;
 	case TRB_TYPE(TRB_CMD_NOOP):
+		xhci_dbg(xhci, "Noop command completed.\n");
 		break;
 	case TRB_TYPE(TRB_RESET_EP):
 		handle_reset_ep_completion(xhci, event, xhci->cmd_ring->dequeue);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 6d75bbe..51a8c55 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3756,6 +3756,12 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
 	case COMP_EBADSLT:
 		xhci_err(xhci, "Setup ERROR: address device command for slot %d.\n",
 				udev->slot_id);
+		xhci_dbg(xhci, "Command ring.\n");
+		xhci_debug_ring(xhci, xhci->cmd_ring);
+		xhci_dbg(xhci, "Event ring.\n");
+		xhci_debug_ring(xhci, xhci->event_ring);
+		xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);
+		xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2);
 		ret = -EINVAL;
 		break;
 	case COMP_TX_ERR:
-- 
1.7.9

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux