]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/host/xhci-dbg.c
drm/i915: quirk away phantom LVDS on Intel's D525MW mainboard
[karo-tx-linux.git] / drivers / usb / host / xhci-dbg.c
index 5f3a7c74aa8d39404212d342f6236fe1ea48d514..5d5e58fdeccc07604179a419c97414a71def5150 100644 (file)
@@ -503,11 +503,14 @@ static void xhci_dbg_ep_ctx(struct xhci_hcd *xhci,
        if (last_ep < 31)
                last_ep_ctx = last_ep + 1;
        for (i = 0; i < last_ep_ctx; ++i) {
+               unsigned int epaddr = xhci_get_endpoint_address(i);
                struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci, ctx, i);
                dma_addr_t dma = ctx->dma +
                        ((unsigned long)ep_ctx - (unsigned long)ctx->bytes);
 
-               xhci_dbg(xhci, "Endpoint %02d Context:\n", i);
+               xhci_dbg(xhci, "%s Endpoint %02d Context (ep_index %02d):\n",
+                               usb_endpoint_out(epaddr) ? "OUT" : "IN",
+                               epaddr & USB_ENDPOINT_NUMBER_MASK, i);
                xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info\n",
                                &ep_ctx->ep_info,
                                (unsigned long long)dma, ep_ctx->ep_info);
@@ -550,6 +553,11 @@ void xhci_dbg_ctx(struct xhci_hcd *xhci,
        if (ctx->type == XHCI_CTX_TYPE_INPUT) {
                struct xhci_input_control_ctx *ctrl_ctx =
                        xhci_get_input_control_ctx(xhci, ctx);
+               if (!ctrl_ctx) {
+                       xhci_warn(xhci, "Could not get input context, bad type.\n");
+                       return;
+               }
+
                xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n",
                         &ctrl_ctx->drop_flags, (unsigned long long)dma,
                         ctrl_ctx->drop_flags);