aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2011-04-05 18:53:47 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2011-05-25 19:03:14 -0400
commitf444ff27e9b8c953eef49da65c649fdcd202165a (patch)
tree2741ff07ed418641a075a66354a216627fe6e84a /drivers/usb
parent5153b7b39105d8beb38e1c3f26ab4b877960d8e1 (diff)
xhci: STFU: Be quieter during URB submission and completion.
Unsurprisingly, URBs get submitted and completed a lot in the xHCI driver. If we have to print 10 lines of debug for every URB submitted or completed, then that can cause the whole system to stay in the interrupt handler too long, and can cause Missed Service completion codes for isochronous transfers. Cut down the debugging in the URB submission and completion paths: - Don't squawk about successful transfers, only unsuccessful ones. - Only print the number of bytes transferred if this was a short transfer. - Don't print the endpoint index for successful transfers (will add more debug to failed transfers to show endpoint index there later). - Stop printing MMIO writes. This debugging shows up when the endpoint doorbell is rung a to start a transfer (basically for every URB). - Don't print out the ring enqueue and dequeue pointers - Stop printing when we're pointing to a link TRB. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/xhci-ring.c46
-rw-r--r--drivers/usb/host/xhci.h6
2 files changed, 15 insertions, 37 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index f1ae17234032..d1498c03c4cb 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -167,10 +167,6 @@ static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer
167 next = ring->dequeue; 167 next = ring->dequeue;
168 } 168 }
169 addr = (unsigned long long) xhci_trb_virt_to_dma(ring->deq_seg, ring->dequeue); 169 addr = (unsigned long long) xhci_trb_virt_to_dma(ring->deq_seg, ring->dequeue);
170 if (ring == xhci->cmd_ring)
171 xhci_dbg(xhci, "Command ring deq = 0x%llx (DMA)\n", addr);
172 else
173 xhci_dbg(xhci, "Ring deq = 0x%llx (DMA)\n", addr);
174} 170}
175 171
176/* 172/*
@@ -246,12 +242,6 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring,
246 next = ring->enqueue; 242 next = ring->enqueue;
247 } 243 }
248 addr = (unsigned long long) xhci_trb_virt_to_dma(ring->enq_seg, ring->enqueue); 244 addr = (unsigned long long) xhci_trb_virt_to_dma(ring->enq_seg, ring->enqueue);
249 if (ring == xhci->event_ring)
250 xhci_dbg(xhci, "Event ring enq = 0x%llx (DMA)\n", addr);
251 else if (ring == xhci->cmd_ring)
252 xhci_dbg(xhci, "Command ring enq = 0x%llx (DMA)\n", addr);
253 else
254 xhci_dbg(xhci, "Ring enq = 0x%llx (DMA)\n", addr);
255} 245}
256 246
257/* 247/*
@@ -634,13 +624,11 @@ static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci,
634 } 624 }
635 } 625 }
636 usb_hcd_unlink_urb_from_ep(hcd, urb); 626 usb_hcd_unlink_urb_from_ep(hcd, urb);
637 xhci_dbg(xhci, "Giveback %s URB %p\n", adjective, urb);
638 627
639 spin_unlock(&xhci->lock); 628 spin_unlock(&xhci->lock);
640 usb_hcd_giveback_urb(hcd, urb, status); 629 usb_hcd_giveback_urb(hcd, urb, status);
641 xhci_urb_free_priv(xhci, urb_priv); 630 xhci_urb_free_priv(xhci, urb_priv);
642 spin_lock(&xhci->lock); 631 spin_lock(&xhci->lock);
643 xhci_dbg(xhci, "%s URB given back\n", adjective);
644 } 632 }
645} 633}
646 634
@@ -1630,7 +1618,6 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
1630 "without IOC set??\n"); 1618 "without IOC set??\n");
1631 *status = -ESHUTDOWN; 1619 *status = -ESHUTDOWN;
1632 } else { 1620 } else {
1633 xhci_dbg(xhci, "Successful control transfer!\n");
1634 *status = 0; 1621 *status = 0;
1635 } 1622 }
1636 break; 1623 break;
@@ -1727,7 +1714,6 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
1727 switch (trb_comp_code) { 1714 switch (trb_comp_code) {
1728 case COMP_SUCCESS: 1715 case COMP_SUCCESS:
1729 frame->status = 0; 1716 frame->status = 0;
1730 xhci_dbg(xhci, "Successful isoc transfer!\n");
1731 break; 1717 break;
1732 case COMP_SHORT_TX: 1718 case COMP_SHORT_TX:
1733 frame->status = td->urb->transfer_flags & URB_SHORT_NOT_OK ? 1719 frame->status = td->urb->transfer_flags & URB_SHORT_NOT_OK ?
@@ -1837,12 +1823,6 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td,
1837 else 1823 else
1838 *status = 0; 1824 *status = 0;
1839 } else { 1825 } else {
1840 if (usb_endpoint_xfer_bulk(&td->urb->ep->desc))
1841 xhci_dbg(xhci, "Successful bulk "
1842 "transfer!\n");
1843 else
1844 xhci_dbg(xhci, "Successful interrupt "
1845 "transfer!\n");
1846 *status = 0; 1826 *status = 0;
1847 } 1827 }
1848 break; 1828 break;
@@ -1856,11 +1836,12 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td,
1856 /* Others already handled above */ 1836 /* Others already handled above */
1857 break; 1837 break;
1858 } 1838 }
1859 xhci_dbg(xhci, "ep %#x - asked for %d bytes, " 1839 if (trb_comp_code == COMP_SHORT_TX)
1860 "%d bytes untransferred\n", 1840 xhci_dbg(xhci, "ep %#x - asked for %d bytes, "
1861 td->urb->ep->desc.bEndpointAddress, 1841 "%d bytes untransferred\n",
1862 td->urb->transfer_buffer_length, 1842 td->urb->ep->desc.bEndpointAddress,
1863 TRB_LEN(le32_to_cpu(event->transfer_len))); 1843 td->urb->transfer_buffer_length,
1844 TRB_LEN(le32_to_cpu(event->transfer_len)));
1864 /* Fast path - was this the last TRB in the TD for this URB? */ 1845 /* Fast path - was this the last TRB in the TD for this URB? */
1865 if (event_trb == td->last_trb) { 1846 if (event_trb == td->last_trb) {
1866 if (TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) { 1847 if (TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {
@@ -1954,7 +1935,6 @@ static int handle_tx_event(struct xhci_hcd *xhci,
1954 1935
1955 /* Endpoint ID is 1 based, our index is zero based */ 1936 /* Endpoint ID is 1 based, our index is zero based */
1956 ep_index = TRB_TO_EP_ID(le32_to_cpu(event->flags)) - 1; 1937 ep_index = TRB_TO_EP_ID(le32_to_cpu(event->flags)) - 1;
1957 xhci_dbg(xhci, "%s - ep index = %d\n", __func__, ep_index);
1958 ep = &xdev->eps[ep_index]; 1938 ep = &xdev->eps[ep_index];
1959 ep_ring = xhci_dma_to_transfer_ring(ep, le64_to_cpu(event->buffer)); 1939 ep_ring = xhci_dma_to_transfer_ring(ep, le64_to_cpu(event->buffer));
1960 ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index); 1940 ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index);
@@ -2149,9 +2129,15 @@ cleanup:
2149 xhci_urb_free_priv(xhci, urb_priv); 2129 xhci_urb_free_priv(xhci, urb_priv);
2150 2130
2151 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb); 2131 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);
2152 xhci_dbg(xhci, "Giveback URB %p, len = %d, " 2132 if ((urb->actual_length != urb->transfer_buffer_length &&
2153 "status = %d\n", 2133 (urb->transfer_flags &
2154 urb, urb->actual_length, status); 2134 URB_SHORT_NOT_OK)) ||
2135 status != 0)
2136 xhci_dbg(xhci, "Giveback URB %p, len = %d, "
2137 "expected = %x, status = %d\n",
2138 urb, urb->actual_length,
2139 urb->transfer_buffer_length,
2140 status);
2155 spin_unlock(&xhci->lock); 2141 spin_unlock(&xhci->lock);
2156 usb_hcd_giveback_urb(bus_to_hcd(urb->dev->bus), urb, status); 2142 usb_hcd_giveback_urb(bus_to_hcd(urb->dev->bus), urb, status);
2157 spin_lock(&xhci->lock); 2143 spin_lock(&xhci->lock);
@@ -2379,7 +2365,6 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
2379 u32 ep_state, unsigned int num_trbs, gfp_t mem_flags) 2365 u32 ep_state, unsigned int num_trbs, gfp_t mem_flags)
2380{ 2366{
2381 /* Make sure the endpoint has been added to xHC schedule */ 2367 /* Make sure the endpoint has been added to xHC schedule */
2382 xhci_dbg(xhci, "Endpoint state = 0x%x\n", ep_state);
2383 switch (ep_state) { 2368 switch (ep_state) {
2384 case EP_STATE_DISABLED: 2369 case EP_STATE_DISABLED:
2385 /* 2370 /*
@@ -2416,7 +2401,6 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
2416 struct xhci_ring *ring = ep_ring; 2401 struct xhci_ring *ring = ep_ring;
2417 union xhci_trb *next; 2402 union xhci_trb *next;
2418 2403
2419 xhci_dbg(xhci, "prepare_ring: pointing to link trb\n");
2420 next = ring->enqueue; 2404 next = ring->enqueue;
2421 2405
2422 while (last_trb(xhci, ring, ring->enq_seg, next)) { 2406 while (last_trb(xhci, ring, ring->enq_seg, next)) {
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index e12db7cfb9bb..0772a8cfea23 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1338,9 +1338,6 @@ static inline unsigned int xhci_readl(const struct xhci_hcd *xhci,
1338static inline void xhci_writel(struct xhci_hcd *xhci, 1338static inline void xhci_writel(struct xhci_hcd *xhci,
1339 const unsigned int val, __le32 __iomem *regs) 1339 const unsigned int val, __le32 __iomem *regs)
1340{ 1340{
1341 xhci_dbg(xhci,
1342 "`MEM_WRITE_DWORD(3'b000, 32'h%p, 32'h%0x, 4'hf);\n",
1343 regs, val);
1344 writel(val, regs); 1341 writel(val, regs);
1345} 1342}
1346 1343
@@ -1368,9 +1365,6 @@ static inline void xhci_write_64(struct xhci_hcd *xhci,
1368 u32 val_lo = lower_32_bits(val); 1365 u32 val_lo = lower_32_bits(val);
1369 u32 val_hi = upper_32_bits(val); 1366 u32 val_hi = upper_32_bits(val);
1370 1367
1371 xhci_dbg(xhci,
1372 "`MEM_WRITE_DWORD(3'b000, 64'h%p, 64'h%0lx, 4'hf);\n",
1373 regs, (long unsigned int) val);
1374 writel(val_lo, ptr); 1368 writel(val_lo, ptr);
1375 writel(val_hi, ptr + 1); 1369 writel(val_hi, ptr + 1);
1376} 1370}