aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2017-04-07 10:57:07 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-08 06:17:41 -0400
commit121dcf11908ecea252776c8268aab117f91aa1f5 (patch)
treecc2b2f08b415a02ca5e20ac84fdf0373470b05cd
parentcd12fd9f6d05d1b2b9ff2630802c55b5fd2e534c (diff)
usb: xhci: remove ring debugging code
XHCI ring changes have already been traced by the ring trace events. It's unnecessary to put the same messages in kernel log. This patch removes the debugging code for a ring. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci-dbg.c62
-rw-r--r--drivers/usb/host/xhci-ring.c4
-rw-r--r--drivers/usb/host/xhci.c6
-rw-r--r--drivers/usb/host/xhci.h3
4 files changed, 0 insertions, 75 deletions
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index 21c563f9a98d..77f80ceeccab 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -311,68 +311,6 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
311 } 311 }
312} 312}
313 313
314/**
315 * Debug a segment with an xHCI ring.
316 *
317 * @return The Link TRB of the segment, or NULL if there is no Link TRB
318 * (which is a bug, since all segments must have a Link TRB).
319 *
320 * Prints out all TRBs in the segment, even those after the Link TRB.
321 *
322 * XXX: should we print out TRBs that the HC owns? As long as we don't
323 * write, that should be fine... We shouldn't expect that the memory pointed to
324 * by the TRB is valid at all. Do we care about ones the HC owns? Probably,
325 * for HC debugging.
326 */
327void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg)
328{
329 int i;
330 u64 addr = seg->dma;
331 union xhci_trb *trb = seg->trbs;
332
333 for (i = 0; i < TRBS_PER_SEGMENT; i++) {
334 trb = &seg->trbs[i];
335 xhci_dbg(xhci, "@%016llx %08x %08x %08x %08x\n", addr,
336 lower_32_bits(le64_to_cpu(trb->link.segment_ptr)),
337 upper_32_bits(le64_to_cpu(trb->link.segment_ptr)),
338 le32_to_cpu(trb->link.intr_target),
339 le32_to_cpu(trb->link.control));
340 addr += sizeof(*trb);
341 }
342}
343
344void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring)
345{
346 xhci_dbg(xhci, "Ring deq = %p (virt), 0x%llx (dma)\n",
347 ring->dequeue,
348 (unsigned long long)xhci_trb_virt_to_dma(ring->deq_seg,
349 ring->dequeue));
350 xhci_dbg(xhci, "Ring enq = %p (virt), 0x%llx (dma)\n",
351 ring->enqueue,
352 (unsigned long long)xhci_trb_virt_to_dma(ring->enq_seg,
353 ring->enqueue));
354}
355
356/**
357 * Debugging for an xHCI ring, which is a queue broken into multiple segments.
358 *
359 * Print out each segment in the ring. Check that the DMA address in
360 * each link segment actually matches the segment's stored DMA address.
361 * Check that the link end bit is only set at the end of the ring.
362 * Check that the dequeue and enqueue pointers point to real data in this ring
363 * (not some other ring).
364 */
365void xhci_debug_ring(struct xhci_hcd *xhci, struct xhci_ring *ring)
366{
367 /* FIXME: Throw an error if any segment doesn't have a Link TRB */
368 struct xhci_segment *seg;
369 struct xhci_segment *first_seg = ring->first_seg;
370 xhci_debug_segment(xhci, first_seg);
371
372 for (seg = first_seg->next; seg != first_seg; seg = seg->next)
373 xhci_debug_segment(xhci, seg);
374}
375
376void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst) 314void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
377{ 315{
378 u64 addr = erst->erst_dma_addr; 316 u64 addr = erst->erst_dma_addr;
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index b382cf071562..a2bfd75b1ae6 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2292,8 +2292,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
2292 upper_32_bits(le64_to_cpu(event->buffer)), 2292 upper_32_bits(le64_to_cpu(event->buffer)),
2293 le32_to_cpu(event->transfer_len), 2293 le32_to_cpu(event->transfer_len),
2294 le32_to_cpu(event->flags)); 2294 le32_to_cpu(event->flags));
2295 xhci_dbg(xhci, "Event ring:\n");
2296 xhci_debug_segment(xhci, xhci->event_ring->deq_seg);
2297 return -ENODEV; 2295 return -ENODEV;
2298 } 2296 }
2299 2297
@@ -2314,8 +2312,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
2314 upper_32_bits(le64_to_cpu(event->buffer)), 2312 upper_32_bits(le64_to_cpu(event->buffer)),
2315 le32_to_cpu(event->transfer_len), 2313 le32_to_cpu(event->transfer_len),
2316 le32_to_cpu(event->flags)); 2314 le32_to_cpu(event->flags));
2317 xhci_dbg(xhci, "Event ring:\n");
2318 xhci_debug_segment(xhci, xhci->event_ring->deq_seg);
2319 return -ENODEV; 2315 return -ENODEV;
2320 } 2316 }
2321 2317
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 9d4801a34b7d..245ed40ea864 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -622,16 +622,10 @@ int xhci_run(struct usb_hcd *hcd)
622 if (ret) 622 if (ret)
623 return ret; 623 return ret;
624 624
625 xhci_dbg(xhci, "Command ring memory map follows:\n");
626 xhci_debug_ring(xhci, xhci->cmd_ring);
627 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
628 xhci_dbg_cmd_ptrs(xhci); 625 xhci_dbg_cmd_ptrs(xhci);
629 626
630 xhci_dbg(xhci, "ERST memory map follows:\n"); 627 xhci_dbg(xhci, "ERST memory map follows:\n");
631 xhci_dbg_erst(xhci, &xhci->erst); 628 xhci_dbg_erst(xhci, &xhci->erst);
632 xhci_dbg(xhci, "Event ring:\n");
633 xhci_debug_ring(xhci, xhci->event_ring);
634 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
635 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); 629 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
636 temp_64 &= ~ERST_PTR_MASK; 630 temp_64 &= ~ERST_PTR_MASK;
637 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 631 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 1a6446647ede..dca59095fbbe 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1923,11 +1923,8 @@ void xhci_dbg_regs(struct xhci_hcd *xhci);
1923void xhci_print_run_regs(struct xhci_hcd *xhci); 1923void xhci_print_run_regs(struct xhci_hcd *xhci);
1924void xhci_print_trb_offsets(struct xhci_hcd *xhci, union xhci_trb *trb); 1924void xhci_print_trb_offsets(struct xhci_hcd *xhci, union xhci_trb *trb);
1925void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb); 1925void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb);
1926void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg);
1927void xhci_debug_ring(struct xhci_hcd *xhci, struct xhci_ring *ring);
1928void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst); 1926void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst);
1929void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci); 1927void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci);
1930void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring);
1931void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int last_ep); 1928void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int last_ep);
1932char *xhci_get_slot_state(struct xhci_hcd *xhci, 1929char *xhci_get_slot_state(struct xhci_hcd *xhci,
1933 struct xhci_container_ctx *ctx); 1930 struct xhci_container_ctx *ctx);