aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2017-04-07 10:57:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-08 06:17:41 -0400
commitcd12fd9f6d05d1b2b9ff2630802c55b5fd2e534c (patch)
tree750fb1964b7c9e42a46d9a11008c29e28f234301
parent74e0b5649c26428a4b87f496cef0df8307eff364 (diff)
usb: xhci: remove enq_updates and deq_updates from ring
enq_updates and deq_updates were introduced in the first place to check whether an xhci hardware is able to respond to trbs enqueued in the ring. We now have trb tracers to trace every single enqueue/dequeue trb. It's time to remove them and the associated debugging code. 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.c8
-rw-r--r--drivers/usb/host/xhci-mem.c3
-rw-r--r--drivers/usb/host/xhci-ring.c3
-rw-r--r--drivers/usb/host/xhci.h2
4 files changed, 0 insertions, 16 deletions
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index f6d30314348d..21c563f9a98d 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -347,14 +347,10 @@ void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring)
347 ring->dequeue, 347 ring->dequeue,
348 (unsigned long long)xhci_trb_virt_to_dma(ring->deq_seg, 348 (unsigned long long)xhci_trb_virt_to_dma(ring->deq_seg,
349 ring->dequeue)); 349 ring->dequeue));
350 xhci_dbg(xhci, "Ring deq updated %u times\n",
351 ring->deq_updates);
352 xhci_dbg(xhci, "Ring enq = %p (virt), 0x%llx (dma)\n", 350 xhci_dbg(xhci, "Ring enq = %p (virt), 0x%llx (dma)\n",
353 ring->enqueue, 351 ring->enqueue,
354 (unsigned long long)xhci_trb_virt_to_dma(ring->enq_seg, 352 (unsigned long long)xhci_trb_virt_to_dma(ring->enq_seg,
355 ring->enqueue)); 353 ring->enqueue));
356 xhci_dbg(xhci, "Ring enq updated %u times\n",
357 ring->enq_updates);
358} 354}
359 355
360/** 356/**
@@ -373,10 +369,6 @@ void xhci_debug_ring(struct xhci_hcd *xhci, struct xhci_ring *ring)
373 struct xhci_segment *first_seg = ring->first_seg; 369 struct xhci_segment *first_seg = ring->first_seg;
374 xhci_debug_segment(xhci, first_seg); 370 xhci_debug_segment(xhci, first_seg);
375 371
376 if (!ring->enq_updates && !ring->deq_updates) {
377 xhci_dbg(xhci, " Ring has not been updated\n");
378 return;
379 }
380 for (seg = first_seg->next; seg != first_seg; seg = seg->next) 372 for (seg = first_seg->next; seg != first_seg; seg = seg->next)
381 xhci_debug_segment(xhci, seg); 373 xhci_debug_segment(xhci, seg);
382} 374}
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 70501312f5e0..b88ec9ae5d4c 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -315,9 +315,6 @@ static void xhci_initialize_ring_info(struct xhci_ring *ring,
315 * handling ring expansion, set the cycle state equal to the old ring. 315 * handling ring expansion, set the cycle state equal to the old ring.
316 */ 316 */
317 ring->cycle_state = cycle_state; 317 ring->cycle_state = cycle_state;
318 /* Not necessary for new rings, but needed for re-initialized rings */
319 ring->enq_updates = 0;
320 ring->deq_updates = 0;
321 318
322 /* 319 /*
323 * Each segment has a link TRB, and leave an extra TRB for SW 320 * Each segment has a link TRB, and leave an extra TRB for SW
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index deb318e0c679..b382cf071562 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -167,8 +167,6 @@ static void next_trb(struct xhci_hcd *xhci,
167 */ 167 */
168static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring) 168static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring)
169{ 169{
170 ring->deq_updates++;
171
172 /* event ring doesn't have link trbs, check for last trb */ 170 /* event ring doesn't have link trbs, check for last trb */
173 if (ring->type == TYPE_EVENT) { 171 if (ring->type == TYPE_EVENT) {
174 if (!last_trb_on_seg(ring->deq_seg, ring->dequeue)) { 172 if (!last_trb_on_seg(ring->deq_seg, ring->dequeue)) {
@@ -226,7 +224,6 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring,
226 ring->num_trbs_free--; 224 ring->num_trbs_free--;
227 next = ++(ring->enqueue); 225 next = ++(ring->enqueue);
228 226
229 ring->enq_updates++;
230 /* Update the dequeue pointer further if that was a link TRB */ 227 /* Update the dequeue pointer further if that was a link TRB */
231 while (trb_is_link(next)) { 228 while (trb_is_link(next)) {
232 229
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index dc69d3ca2659..1a6446647ede 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1566,10 +1566,8 @@ struct xhci_ring {
1566 struct xhci_segment *last_seg; 1566 struct xhci_segment *last_seg;
1567 union xhci_trb *enqueue; 1567 union xhci_trb *enqueue;
1568 struct xhci_segment *enq_seg; 1568 struct xhci_segment *enq_seg;
1569 unsigned int enq_updates;
1570 union xhci_trb *dequeue; 1569 union xhci_trb *dequeue;
1571 struct xhci_segment *deq_seg; 1570 struct xhci_segment *deq_seg;
1572 unsigned int deq_updates;
1573 struct list_head td_list; 1571 struct list_head td_list;
1574 /* 1572 /*
1575 * Write the cycle state into the TRB cycle field to give ownership of 1573 * Write the cycle state into the TRB cycle field to give ownership of