diff options
author | Xenia Ragiadakou <burzalodowa@gmail.com> | 2013-07-31 00:35:27 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-08-13 19:05:39 -0400 |
commit | 3a7fa5bef06e1757d1aded8d78afd041b4552e11 (patch) | |
tree | 924b372520502e54e296be99f8f1069c88ed0717 | |
parent | 84a99f6fc5d4a2b7583aa287979268a8bb926367 (diff) |
xhci: add trace for debug messages related to changing contexts
This patch defines a new trace event, which is called xhci_dbg_context_change
and belongs in the event class xhci_log_msg, and adds tracepoints for tracing
the debug messages related to context updates performed with Configure Endpoint
and Evaluate Context commands.
Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/xhci-trace.h | 5 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 24 |
4 files changed, 27 insertions, 10 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index b881bc1697f9..b1bb59b58b25 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/dmapool.h> | 26 | #include <linux/dmapool.h> |
27 | 27 | ||
28 | #include "xhci.h" | 28 | #include "xhci.h" |
29 | #include "xhci-trace.h" | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * Allocates a generic ring segment from the ring pool, sets the dma address, | 32 | * Allocates a generic ring segment from the ring pool, sets the dma address, |
@@ -661,7 +662,8 @@ void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci, | |||
661 | * fls(0) = 0, fls(0x1) = 1, fls(0x10) = 2, fls(0x100) = 3, etc. | 662 | * fls(0) = 0, fls(0x1) = 1, fls(0x10) = 2, fls(0x100) = 3, etc. |
662 | */ | 663 | */ |
663 | max_primary_streams = fls(stream_info->num_stream_ctxs) - 2; | 664 | max_primary_streams = fls(stream_info->num_stream_ctxs) - 2; |
664 | xhci_dbg(xhci, "Setting number of stream ctx array entries to %u\n", | 665 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, |
666 | "Setting number of stream ctx array entries to %u", | ||
665 | 1 << (max_primary_streams + 1)); | 667 | 1 << (max_primary_streams + 1)); |
666 | ep_ctx->ep_info &= cpu_to_le32(~EP_MAXPSTREAMS_MASK); | 668 | ep_ctx->ep_info &= cpu_to_le32(~EP_MAXPSTREAMS_MASK); |
667 | ep_ctx->ep_info |= cpu_to_le32(EP_MAXPSTREAMS(max_primary_streams) | 669 | ep_ctx->ep_info |= cpu_to_le32(EP_MAXPSTREAMS(max_primary_streams) |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 5b08cd85f8e7..ba5fd5a8c9bc 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -67,6 +67,7 @@ | |||
67 | #include <linux/scatterlist.h> | 67 | #include <linux/scatterlist.h> |
68 | #include <linux/slab.h> | 68 | #include <linux/slab.h> |
69 | #include "xhci.h" | 69 | #include "xhci.h" |
70 | #include "xhci-trace.h" | ||
70 | 71 | ||
71 | static int handle_cmd_in_cmd_wait_list(struct xhci_hcd *xhci, | 72 | static int handle_cmd_in_cmd_wait_list(struct xhci_hcd *xhci, |
72 | struct xhci_virt_device *virt_dev, | 73 | struct xhci_virt_device *virt_dev, |
@@ -1454,7 +1455,8 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, | |||
1454 | break; | 1455 | break; |
1455 | } | 1456 | } |
1456 | bandwidth_change: | 1457 | bandwidth_change: |
1457 | xhci_dbg(xhci, "Completed config ep cmd\n"); | 1458 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, |
1459 | "Completed config ep cmd"); | ||
1458 | xhci->devs[slot_id]->cmd_status = | 1460 | xhci->devs[slot_id]->cmd_status = |
1459 | GET_COMP_CODE(le32_to_cpu(event->status)); | 1461 | GET_COMP_CODE(le32_to_cpu(event->status)); |
1460 | complete(&xhci->devs[slot_id]->cmd_completion); | 1462 | complete(&xhci->devs[slot_id]->cmd_completion); |
diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h index 432aa675966c..628624306f38 100644 --- a/drivers/usb/host/xhci-trace.h +++ b/drivers/usb/host/xhci-trace.h | |||
@@ -36,6 +36,11 @@ DEFINE_EVENT(xhci_log_msg, xhci_dbg_address, | |||
36 | TP_ARGS(vaf) | 36 | TP_ARGS(vaf) |
37 | ); | 37 | ); |
38 | 38 | ||
39 | DEFINE_EVENT(xhci_log_msg, xhci_dbg_context_change, | ||
40 | TP_PROTO(struct va_format *vaf), | ||
41 | TP_ARGS(vaf) | ||
42 | ); | ||
43 | |||
39 | #endif /* __XHCI_TRACE_H */ | 44 | #endif /* __XHCI_TRACE_H */ |
40 | 45 | ||
41 | /* this part must be outside header guard */ | 46 | /* this part must be outside header guard */ |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index d57dc6cbd428..fa7b6f43642f 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -1153,12 +1153,16 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id, | |||
1153 | hw_max_packet_size = MAX_PACKET_DECODED(le32_to_cpu(ep_ctx->ep_info2)); | 1153 | hw_max_packet_size = MAX_PACKET_DECODED(le32_to_cpu(ep_ctx->ep_info2)); |
1154 | max_packet_size = usb_endpoint_maxp(&urb->dev->ep0.desc); | 1154 | max_packet_size = usb_endpoint_maxp(&urb->dev->ep0.desc); |
1155 | if (hw_max_packet_size != max_packet_size) { | 1155 | if (hw_max_packet_size != max_packet_size) { |
1156 | xhci_dbg(xhci, "Max Packet Size for ep 0 changed.\n"); | 1156 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, |
1157 | xhci_dbg(xhci, "Max packet size in usb_device = %d\n", | 1157 | "Max Packet Size for ep 0 changed."); |
1158 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, | ||
1159 | "Max packet size in usb_device = %d", | ||
1158 | max_packet_size); | 1160 | max_packet_size); |
1159 | xhci_dbg(xhci, "Max packet size in xHCI HW = %d\n", | 1161 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, |
1162 | "Max packet size in xHCI HW = %d", | ||
1160 | hw_max_packet_size); | 1163 | hw_max_packet_size); |
1161 | xhci_dbg(xhci, "Issuing evaluate context command.\n"); | 1164 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, |
1165 | "Issuing evaluate context command."); | ||
1162 | 1166 | ||
1163 | /* Set up the input context flags for the command */ | 1167 | /* Set up the input context flags for the command */ |
1164 | /* FIXME: This won't work if a non-default control endpoint | 1168 | /* FIXME: This won't work if a non-default control endpoint |
@@ -1776,7 +1780,8 @@ static int xhci_configure_endpoint_result(struct xhci_hcd *xhci, | |||
1776 | ret = -ENODEV; | 1780 | ret = -ENODEV; |
1777 | break; | 1781 | break; |
1778 | case COMP_SUCCESS: | 1782 | case COMP_SUCCESS: |
1779 | dev_dbg(&udev->dev, "Successful Endpoint Configure command\n"); | 1783 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, |
1784 | "Successful Endpoint Configure command"); | ||
1780 | ret = 0; | 1785 | ret = 0; |
1781 | break; | 1786 | break; |
1782 | default: | 1787 | default: |
@@ -1822,7 +1827,8 @@ static int xhci_evaluate_context_result(struct xhci_hcd *xhci, | |||
1822 | ret = -EINVAL; | 1827 | ret = -EINVAL; |
1823 | break; | 1828 | break; |
1824 | case COMP_SUCCESS: | 1829 | case COMP_SUCCESS: |
1825 | dev_dbg(&udev->dev, "Successful evaluate context command\n"); | 1830 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, |
1831 | "Successful evaluate context command"); | ||
1826 | ret = 0; | 1832 | ret = 0; |
1827 | break; | 1833 | break; |
1828 | default: | 1834 | default: |
@@ -2583,7 +2589,8 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci, | |||
2583 | if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) | 2589 | if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) |
2584 | xhci_free_host_resources(xhci, ctrl_ctx); | 2590 | xhci_free_host_resources(xhci, ctrl_ctx); |
2585 | spin_unlock_irqrestore(&xhci->lock, flags); | 2591 | spin_unlock_irqrestore(&xhci->lock, flags); |
2586 | xhci_dbg(xhci, "FIXME allocate a new ring segment\n"); | 2592 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, |
2593 | "FIXME allocate a new ring segment"); | ||
2587 | return -ENOMEM; | 2594 | return -ENOMEM; |
2588 | } | 2595 | } |
2589 | xhci_ring_cmd_db(xhci); | 2596 | xhci_ring_cmd_db(xhci); |
@@ -3865,7 +3872,8 @@ static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci, | |||
3865 | slot_ctx->dev_info2 &= cpu_to_le32(~((u32) MAX_EXIT)); | 3872 | slot_ctx->dev_info2 &= cpu_to_le32(~((u32) MAX_EXIT)); |
3866 | slot_ctx->dev_info2 |= cpu_to_le32(max_exit_latency); | 3873 | slot_ctx->dev_info2 |= cpu_to_le32(max_exit_latency); |
3867 | 3874 | ||
3868 | xhci_dbg(xhci, "Set up evaluate context for LPM MEL change.\n"); | 3875 | xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, |
3876 | "Set up evaluate context for LPM MEL change."); | ||
3869 | xhci_dbg(xhci, "Slot %u Input Context:\n", udev->slot_id); | 3877 | xhci_dbg(xhci, "Slot %u Input Context:\n", udev->slot_id); |
3870 | xhci_dbg_ctx(xhci, command->in_ctx, 0); | 3878 | xhci_dbg_ctx(xhci, command->in_ctx, 0); |
3871 | 3879 | ||