aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-hcd.c
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2009-07-27 15:03:46 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-07-28 17:31:12 -0400
commit66e49d8774fa03539713e8f91169c37c05df1e94 (patch)
treee513ccdc346d7ff2d3e4c838c3023e6d73a49d53 /drivers/usb/host/xhci-hcd.c
parent2d83109be62edd9647c45d7ed2b916b03974a7ec (diff)
USB: xhci: Make debugging more verbose.
Add more debugging to the irq handler, slot context initialization, ring operations, URB cancellation, and MMIO writes. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci-hcd.c')
-rw-r--r--drivers/usb/host/xhci-hcd.c47
1 files changed, 33 insertions, 14 deletions
diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c
index 2e8e5bf6b6ca..764995fd59ef 100644
--- a/drivers/usb/host/xhci-hcd.c
+++ b/drivers/usb/host/xhci-hcd.c
@@ -267,8 +267,10 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
267{ 267{
268 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 268 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
269 u32 temp, temp2; 269 u32 temp, temp2;
270 union xhci_trb *trb;
270 271
271 spin_lock(&xhci->lock); 272 spin_lock(&xhci->lock);
273 trb = xhci->event_ring->dequeue;
272 /* Check if the xHC generated the interrupt, or the irq is shared */ 274 /* Check if the xHC generated the interrupt, or the irq is shared */
273 temp = xhci_readl(xhci, &xhci->op_regs->status); 275 temp = xhci_readl(xhci, &xhci->op_regs->status);
274 temp2 = xhci_readl(xhci, &xhci->ir_set->irq_pending); 276 temp2 = xhci_readl(xhci, &xhci->ir_set->irq_pending);
@@ -276,6 +278,15 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
276 spin_unlock(&xhci->lock); 278 spin_unlock(&xhci->lock);
277 return IRQ_NONE; 279 return IRQ_NONE;
278 } 280 }
281 xhci_dbg(xhci, "op reg status = %08x\n", temp);
282 xhci_dbg(xhci, "ir set irq_pending = %08x\n", temp2);
283 xhci_dbg(xhci, "Event ring dequeue ptr:\n");
284 xhci_dbg(xhci, "@%llx %08x %08x %08x %08x\n",
285 (unsigned long long)xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, trb),
286 lower_32_bits(trb->link.segment_ptr),
287 upper_32_bits(trb->link.segment_ptr),
288 (unsigned int) trb->link.intr_target,
289 (unsigned int) trb->link.control);
279 290
280 if (temp & STS_FATAL) { 291 if (temp & STS_FATAL) {
281 xhci_warn(xhci, "WARNING: Host System Error\n"); 292 xhci_warn(xhci, "WARNING: Host System Error\n");
@@ -385,6 +396,20 @@ int xhci_run(struct usb_hcd *hcd)
385 add_timer(&xhci->event_ring_timer); 396 add_timer(&xhci->event_ring_timer);
386#endif 397#endif
387 398
399 xhci_dbg(xhci, "Command ring memory map follows:\n");
400 xhci_debug_ring(xhci, xhci->cmd_ring);
401 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
402 xhci_dbg_cmd_ptrs(xhci);
403
404 xhci_dbg(xhci, "ERST memory map follows:\n");
405 xhci_dbg_erst(xhci, &xhci->erst);
406 xhci_dbg(xhci, "Event ring:\n");
407 xhci_debug_ring(xhci, xhci->event_ring);
408 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
409 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
410 temp_64 &= ~ERST_PTR_MASK;
411 xhci_dbg(xhci, "ERST deq = 64'h%0lx\n", (long unsigned int) temp_64);
412
388 xhci_dbg(xhci, "// Set the interrupt modulation register\n"); 413 xhci_dbg(xhci, "// Set the interrupt modulation register\n");
389 temp = xhci_readl(xhci, &xhci->ir_set->irq_control); 414 temp = xhci_readl(xhci, &xhci->ir_set->irq_control);
390 temp &= ~ER_IRQ_INTERVAL_MASK; 415 temp &= ~ER_IRQ_INTERVAL_MASK;
@@ -409,20 +434,6 @@ int xhci_run(struct usb_hcd *hcd)
409 if (NUM_TEST_NOOPS > 0) 434 if (NUM_TEST_NOOPS > 0)
410 doorbell = xhci_setup_one_noop(xhci); 435 doorbell = xhci_setup_one_noop(xhci);
411 436
412 xhci_dbg(xhci, "Command ring memory map follows:\n");
413 xhci_debug_ring(xhci, xhci->cmd_ring);
414 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
415 xhci_dbg_cmd_ptrs(xhci);
416
417 xhci_dbg(xhci, "ERST memory map follows:\n");
418 xhci_dbg_erst(xhci, &xhci->erst);
419 xhci_dbg(xhci, "Event ring:\n");
420 xhci_debug_ring(xhci, xhci->event_ring);
421 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
422 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
423 temp_64 &= ~ERST_PTR_MASK;
424 xhci_dbg(xhci, "ERST deq = 64'h%0lx\n", (long unsigned int) temp_64);
425
426 temp = xhci_readl(xhci, &xhci->op_regs->command); 437 temp = xhci_readl(xhci, &xhci->op_regs->command);
427 temp |= (CMD_RUN); 438 temp |= (CMD_RUN);
428 xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n", 439 xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n",
@@ -665,8 +676,12 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
665 goto done; 676 goto done;
666 677
667 xhci_dbg(xhci, "Cancel URB %p\n", urb); 678 xhci_dbg(xhci, "Cancel URB %p\n", urb);
679 xhci_dbg(xhci, "Event ring:\n");
680 xhci_debug_ring(xhci, xhci->event_ring);
668 ep_index = xhci_get_endpoint_index(&urb->ep->desc); 681 ep_index = xhci_get_endpoint_index(&urb->ep->desc);
669 ep_ring = xhci->devs[urb->dev->slot_id]->ep_rings[ep_index]; 682 ep_ring = xhci->devs[urb->dev->slot_id]->ep_rings[ep_index];
683 xhci_dbg(xhci, "Endpoint ring:\n");
684 xhci_debug_ring(xhci, ep_ring);
670 td = (struct xhci_td *) urb->hcpriv; 685 td = (struct xhci_td *) urb->hcpriv;
671 686
672 ep_ring->cancels_pending++; 687 ep_ring->cancels_pending++;
@@ -1178,6 +1193,8 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1178 if (!udev->config) 1193 if (!udev->config)
1179 xhci_setup_addressable_virt_dev(xhci, udev); 1194 xhci_setup_addressable_virt_dev(xhci, udev);
1180 /* Otherwise, assume the core has the device configured how it wants */ 1195 /* Otherwise, assume the core has the device configured how it wants */
1196 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
1197 xhci_dbg_ctx(xhci, virt_dev->in_ctx, virt_dev->in_ctx_dma, 2);
1181 1198
1182 spin_lock_irqsave(&xhci->lock, flags); 1199 spin_lock_irqsave(&xhci->lock, flags);
1183 ret = xhci_queue_address_device(xhci, virt_dev->in_ctx_dma, 1200 ret = xhci_queue_address_device(xhci, virt_dev->in_ctx_dma,
@@ -1221,6 +1238,8 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1221 default: 1238 default:
1222 xhci_err(xhci, "ERROR: unexpected command completion " 1239 xhci_err(xhci, "ERROR: unexpected command completion "
1223 "code 0x%x.\n", virt_dev->cmd_status); 1240 "code 0x%x.\n", virt_dev->cmd_status);
1241 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);
1242 xhci_dbg_ctx(xhci, virt_dev->out_ctx, virt_dev->out_ctx_dma, 2);
1224 ret = -EINVAL; 1243 ret = -EINVAL;
1225 break; 1244 break;
1226 } 1245 }