usb: xhci: remove ring debugging code
authorLu Baolu <baolu.lu@linux.intel.com>
Fri, 7 Apr 2017 14:57:07 +0000 (17:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 10:17:41 +0000 (12:17 +0200)
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>
drivers/usb/host/xhci-dbg.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h

index 21c563f9a98dba9b22b5317aaa189f7146730ce7..77f80ceeccab037d0204af383dfc43dbb887b74f 100644 (file)
@@ -311,68 +311,6 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
        }
 }
 
-/**
- * Debug a segment with an xHCI ring.
- *
- * @return The Link TRB of the segment, or NULL if there is no Link TRB
- * (which is a bug, since all segments must have a Link TRB).
- *
- * Prints out all TRBs in the segment, even those after the Link TRB.
- *
- * XXX: should we print out TRBs that the HC owns?  As long as we don't
- * write, that should be fine...  We shouldn't expect that the memory pointed to
- * by the TRB is valid at all.  Do we care about ones the HC owns?  Probably,
- * for HC debugging.
- */
-void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg)
-{
-       int i;
-       u64 addr = seg->dma;
-       union xhci_trb *trb = seg->trbs;
-
-       for (i = 0; i < TRBS_PER_SEGMENT; i++) {
-               trb = &seg->trbs[i];
-               xhci_dbg(xhci, "@%016llx %08x %08x %08x %08x\n", addr,
-                        lower_32_bits(le64_to_cpu(trb->link.segment_ptr)),
-                        upper_32_bits(le64_to_cpu(trb->link.segment_ptr)),
-                        le32_to_cpu(trb->link.intr_target),
-                        le32_to_cpu(trb->link.control));
-               addr += sizeof(*trb);
-       }
-}
-
-void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring)
-{
-       xhci_dbg(xhci, "Ring deq = %p (virt), 0x%llx (dma)\n",
-                       ring->dequeue,
-                       (unsigned long long)xhci_trb_virt_to_dma(ring->deq_seg,
-                                                           ring->dequeue));
-       xhci_dbg(xhci, "Ring enq = %p (virt), 0x%llx (dma)\n",
-                       ring->enqueue,
-                       (unsigned long long)xhci_trb_virt_to_dma(ring->enq_seg,
-                                                           ring->enqueue));
-}
-
-/**
- * Debugging for an xHCI ring, which is a queue broken into multiple segments.
- *
- * Print out each segment in the ring.  Check that the DMA address in
- * each link segment actually matches the segment's stored DMA address.
- * Check that the link end bit is only set at the end of the ring.
- * Check that the dequeue and enqueue pointers point to real data in this ring
- * (not some other ring).
- */
-void xhci_debug_ring(struct xhci_hcd *xhci, struct xhci_ring *ring)
-{
-       /* FIXME: Throw an error if any segment doesn't have a Link TRB */
-       struct xhci_segment *seg;
-       struct xhci_segment *first_seg = ring->first_seg;
-       xhci_debug_segment(xhci, first_seg);
-
-       for (seg = first_seg->next; seg != first_seg; seg = seg->next)
-               xhci_debug_segment(xhci, seg);
-}
-
 void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
 {
        u64 addr = erst->erst_dma_addr;
index b382cf0715627f5332be84be053071be1e952e1e..a2bfd75b1ae62d11cc5754e873261d7a29cf6f91 100644 (file)
@@ -2292,8 +2292,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
                         upper_32_bits(le64_to_cpu(event->buffer)),
                         le32_to_cpu(event->transfer_len),
                         le32_to_cpu(event->flags));
-               xhci_dbg(xhci, "Event ring:\n");
-               xhci_debug_segment(xhci, xhci->event_ring->deq_seg);
                return -ENODEV;
        }
 
@@ -2314,8 +2312,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
                         upper_32_bits(le64_to_cpu(event->buffer)),
                         le32_to_cpu(event->transfer_len),
                         le32_to_cpu(event->flags));
-               xhci_dbg(xhci, "Event ring:\n");
-               xhci_debug_segment(xhci, xhci->event_ring->deq_seg);
                return -ENODEV;
        }
 
index 9d4801a34b7d75bedaca007f60d168ca893845b0..245ed40ea8649a88352f4f046a63ea19ea223456 100644 (file)
@@ -622,16 +622,10 @@ int xhci_run(struct usb_hcd *hcd)
        if (ret)
                return ret;
 
-       xhci_dbg(xhci, "Command ring memory map follows:\n");
-       xhci_debug_ring(xhci, xhci->cmd_ring);
-       xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
        xhci_dbg_cmd_ptrs(xhci);
 
        xhci_dbg(xhci, "ERST memory map follows:\n");
        xhci_dbg_erst(xhci, &xhci->erst);
-       xhci_dbg(xhci, "Event ring:\n");
-       xhci_debug_ring(xhci, xhci->event_ring);
-       xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
        temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
        temp_64 &= ~ERST_PTR_MASK;
        xhci_dbg_trace(xhci, trace_xhci_dbg_init,
index 1a6446647ede0b611c33ecb1c1a7b10cfd67af0c..dca59095fbbe52f719471a7c530322d758129606 100644 (file)
@@ -1923,11 +1923,8 @@ void xhci_dbg_regs(struct xhci_hcd *xhci);
 void xhci_print_run_regs(struct xhci_hcd *xhci);
 void xhci_print_trb_offsets(struct xhci_hcd *xhci, union xhci_trb *trb);
 void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb);
-void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg);
-void xhci_debug_ring(struct xhci_hcd *xhci, struct xhci_ring *ring);
 void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst);
 void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci);
-void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring);
 void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int last_ep);
 char *xhci_get_slot_state(struct xhci_hcd *xhci,
                struct xhci_container_ctx *ctx);