>From 0261dcd2711c010d786dcd940803a44e1bc19512 Mon Sep 17 00:00:00 2001 From: Sarah Sharp Date: Mon, 6 Jan 2014 16:06:27 -0800 Subject: [PATCH 1/3] TD fragment debugging Signed-off-by: Sarah Sharp --- drivers/usb/host/xhci-ring.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 55fc0c39b7e1..d05f61dc8359 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -982,6 +982,14 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg) * doesn't touch the memory. */ } + + xhci_dbg(xhci, "Command ring:\n"); + xhci_debug_ring(xhci, xhci->cmd_ring); + xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring); + xhci_dbg(xhci, "Event ring:\n"); + xhci_debug_ring(xhci, xhci->event_ring); + xhci_dbg_ring_ptrs(xhci, xhci->event_ring); + for (i = 0; i < MAX_HC_SLOTS; i++) { if (!xhci->devs[i]) continue; @@ -1003,6 +1011,12 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg) xhci_giveback_urb_in_irq(xhci, cur_td, -ESHUTDOWN, "killed"); } + if (!list_empty(&temp_ep->cancelled_td_list)) { + xhci_dbg(xhci, "Dev %i Ep 0x%x:\n", i, + xhci_get_endpoint_address(j)); + xhci_debug_ring(xhci, ring); + xhci_dbg_ring_ptrs(xhci, ring); + } while (!list_empty(&temp_ep->cancelled_td_list)) { cur_td = list_first_entry( &temp_ep->cancelled_td_list, @@ -2966,6 +2980,10 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring, num_trbs, TRBS_PER_SEGMENT - 1); return -ENOMEM; } + xhci_dbg(xhci, "Insert no-op TRBs at 0x%llx\n", + (unsigned long long) + xhci_trb_virt_to_dma(ep_ring->enq_seg, + ep_ring->enqueue)); nop_cmd = cpu_to_le32(TRB_TYPE(TRB_TR_NOOP) | ep_ring->cycle_state); -- 1.8.3.3