diff options
author | Xenia Ragiadakou <burzalodowa@gmail.com> | 2013-08-06 00:52:46 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-08-13 19:05:43 -0400 |
commit | a0254324eeea3b00676eeb54ba80774a46cb8afb (patch) | |
tree | 69b73e4bea25d9e12d0348a11d411c31575e1e66 /drivers | |
parent | 4bdfe4c38fd5b06da558050a3288a0a48825a3e7 (diff) |
xhci: add trace for debug messages related to endpoint reset
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/xhci-trace.h | 5 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 17 |
3 files changed, 18 insertions, 7 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index e88e8772ab5d..3393ce755b15 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -1151,7 +1151,8 @@ static void handle_reset_ep_completion(struct xhci_hcd *xhci, | |||
1151 | /* This command will only fail if the endpoint wasn't halted, | 1151 | /* This command will only fail if the endpoint wasn't halted, |
1152 | * but we don't care. | 1152 | * but we don't care. |
1153 | */ | 1153 | */ |
1154 | xhci_dbg(xhci, "Ignoring reset ep completion code of %u\n", | 1154 | xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, |
1155 | "Ignoring reset ep completion code of %u", | ||
1155 | GET_COMP_CODE(le32_to_cpu(event->status))); | 1156 | GET_COMP_CODE(le32_to_cpu(event->status))); |
1156 | 1157 | ||
1157 | /* HW with the reset endpoint quirk needs to have a configure endpoint | 1158 | /* HW with the reset endpoint quirk needs to have a configure endpoint |
diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h index f0447c6cb29b..757b26f6e37b 100644 --- a/drivers/usb/host/xhci-trace.h +++ b/drivers/usb/host/xhci-trace.h | |||
@@ -46,6 +46,11 @@ DEFINE_EVENT(xhci_log_msg, xhci_dbg_quirks, | |||
46 | TP_ARGS(vaf) | 46 | TP_ARGS(vaf) |
47 | ); | 47 | ); |
48 | 48 | ||
49 | DEFINE_EVENT(xhci_log_msg, xhci_dbg_reset_ep, | ||
50 | TP_PROTO(struct va_format *vaf), | ||
51 | TP_ARGS(vaf) | ||
52 | ); | ||
53 | |||
49 | #endif /* __XHCI_TRACE_H */ | 54 | #endif /* __XHCI_TRACE_H */ |
50 | 55 | ||
51 | /* this part must be outside header guard */ | 56 | /* this part must be outside header guard */ |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index ffb3ed09eb0d..18c710dc68dc 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2818,7 +2818,8 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, | |||
2818 | struct xhci_dequeue_state deq_state; | 2818 | struct xhci_dequeue_state deq_state; |
2819 | struct xhci_virt_ep *ep; | 2819 | struct xhci_virt_ep *ep; |
2820 | 2820 | ||
2821 | xhci_dbg(xhci, "Cleaning up stalled endpoint ring\n"); | 2821 | xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, |
2822 | "Cleaning up stalled endpoint ring"); | ||
2822 | ep = &xhci->devs[udev->slot_id]->eps[ep_index]; | 2823 | ep = &xhci->devs[udev->slot_id]->eps[ep_index]; |
2823 | /* We need to move the HW's dequeue pointer past this TD, | 2824 | /* We need to move the HW's dequeue pointer past this TD, |
2824 | * or it will attempt to resend it on the next doorbell ring. | 2825 | * 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, | |||
2831 | * issue a configure endpoint command later. | 2832 | * issue a configure endpoint command later. |
2832 | */ | 2833 | */ |
2833 | if (!(xhci->quirks & XHCI_RESET_EP_QUIRK)) { | 2834 | if (!(xhci->quirks & XHCI_RESET_EP_QUIRK)) { |
2834 | xhci_dbg(xhci, "Queueing new dequeue state\n"); | 2835 | xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, |
2836 | "Queueing new dequeue state"); | ||
2835 | xhci_queue_new_dequeue_state(xhci, udev->slot_id, | 2837 | xhci_queue_new_dequeue_state(xhci, udev->slot_id, |
2836 | ep_index, ep->stopped_stream, &deq_state); | 2838 | ep_index, ep->stopped_stream, &deq_state); |
2837 | } else { | 2839 | } else { |
@@ -2874,16 +2876,19 @@ void xhci_endpoint_reset(struct usb_hcd *hcd, | |||
2874 | ep_index = xhci_get_endpoint_index(&ep->desc); | 2876 | ep_index = xhci_get_endpoint_index(&ep->desc); |
2875 | virt_ep = &xhci->devs[udev->slot_id]->eps[ep_index]; | 2877 | virt_ep = &xhci->devs[udev->slot_id]->eps[ep_index]; |
2876 | if (!virt_ep->stopped_td) { | 2878 | if (!virt_ep->stopped_td) { |
2877 | xhci_dbg(xhci, "Endpoint 0x%x not halted, refusing to reset.\n", | 2879 | xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, |
2878 | ep->desc.bEndpointAddress); | 2880 | "Endpoint 0x%x not halted, refusing to reset.", |
2881 | ep->desc.bEndpointAddress); | ||
2879 | return; | 2882 | return; |
2880 | } | 2883 | } |
2881 | if (usb_endpoint_xfer_control(&ep->desc)) { | 2884 | if (usb_endpoint_xfer_control(&ep->desc)) { |
2882 | xhci_dbg(xhci, "Control endpoint stall already handled.\n"); | 2885 | xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, |
2886 | "Control endpoint stall already handled."); | ||
2883 | return; | 2887 | return; |
2884 | } | 2888 | } |
2885 | 2889 | ||
2886 | xhci_dbg(xhci, "Queueing reset endpoint command\n"); | 2890 | xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, |
2891 | "Queueing reset endpoint command"); | ||
2887 | spin_lock_irqsave(&xhci->lock, flags); | 2892 | spin_lock_irqsave(&xhci->lock, flags); |
2888 | ret = xhci_queue_reset_ep(xhci, udev->slot_id, ep_index); | 2893 | ret = xhci_queue_reset_ep(xhci, udev->slot_id, ep_index); |
2889 | /* | 2894 | /* |