]> git.baikalelectronics.ru Git - kernel.git/commitdiff
xhci: add trace for debug messages related to endpoint reset
authorXenia Ragiadakou <burzalodowa@gmail.com>
Tue, 6 Aug 2013 04:52:46 +0000 (07:52 +0300)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 13 Aug 2013 23:05:43 +0000 (16:05 -0700)
This patch defines a new trace event, which is called xhci_dbg_reset_ep
and belongs in the event class xhci_log_msg, and adds tracepoints that
trace the debug messages associated with resetting an endpoint after
the reception of a STALL packet.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci-trace.h
drivers/usb/host/xhci.c

index e88e8772ab5d96f8216294cbc61720f98a0047c9..3393ce755b15ac3c51c9fc0320317b7d24d19130 100644 (file)
@@ -1151,7 +1151,8 @@ static void handle_reset_ep_completion(struct xhci_hcd *xhci,
        /* This command will only fail if the endpoint wasn't halted,
         * but we don't care.
         */
-       xhci_dbg(xhci, "Ignoring reset ep completion code of %u\n",
+       xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
+               "Ignoring reset ep completion code of %u",
                 GET_COMP_CODE(le32_to_cpu(event->status)));
 
        /* HW with the reset endpoint quirk needs to have a configure endpoint
index f0447c6cb29b5d79c786ded99cac8a5e9f3dd8d0..757b26f6e37b6ea71e76e1c69556e3c2b35ffd3e 100644 (file)
@@ -46,6 +46,11 @@ DEFINE_EVENT(xhci_log_msg, xhci_dbg_quirks,
        TP_ARGS(vaf)
 );
 
+DEFINE_EVENT(xhci_log_msg, xhci_dbg_reset_ep,
+       TP_PROTO(struct va_format *vaf),
+       TP_ARGS(vaf)
+);
+
 #endif /* __XHCI_TRACE_H */
 
 /* this part must be outside header guard */
index ffb3ed09eb0d610737d8048ed3044f7a6e133445..18c710dc68dc55f9aad9cf955ae449ccf19b2ddf 100644 (file)
@@ -2818,7 +2818,8 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
        struct xhci_dequeue_state deq_state;
        struct xhci_virt_ep *ep;
 
-       xhci_dbg(xhci, "Cleaning up stalled endpoint ring\n");
+       xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
+                       "Cleaning up stalled endpoint ring");
        ep = &xhci->devs[udev->slot_id]->eps[ep_index];
        /* We need to move the HW's dequeue pointer past this TD,
         * or it will attempt to resend it on the next doorbell ring.
@@ -2831,7 +2832,8 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
         * issue a configure endpoint command later.
         */
        if (!(xhci->quirks & XHCI_RESET_EP_QUIRK)) {
-               xhci_dbg(xhci, "Queueing new dequeue state\n");
+               xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
+                               "Queueing new dequeue state");
                xhci_queue_new_dequeue_state(xhci, udev->slot_id,
                                ep_index, ep->stopped_stream, &deq_state);
        } else {
@@ -2874,16 +2876,19 @@ void xhci_endpoint_reset(struct usb_hcd *hcd,
        ep_index = xhci_get_endpoint_index(&ep->desc);
        virt_ep = &xhci->devs[udev->slot_id]->eps[ep_index];
        if (!virt_ep->stopped_td) {
-               xhci_dbg(xhci, "Endpoint 0x%x not halted, refusing to reset.\n",
-                               ep->desc.bEndpointAddress);
+               xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
+                       "Endpoint 0x%x not halted, refusing to reset.",
+                       ep->desc.bEndpointAddress);
                return;
        }
        if (usb_endpoint_xfer_control(&ep->desc)) {
-               xhci_dbg(xhci, "Control endpoint stall already handled.\n");
+               xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
+                               "Control endpoint stall already handled.");
                return;
        }
 
-       xhci_dbg(xhci, "Queueing reset endpoint command\n");
+       xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
+                       "Queueing reset endpoint command");
        spin_lock_irqsave(&xhci->lock, flags);
        ret = xhci_queue_reset_ep(xhci, udev->slot_id, ep_index);
        /*