diff options
author | Bin Liu <b-liu@ti.com> | 2016-06-30 13:12:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-07-16 19:23:57 -0400 |
commit | 19ca682e03fbf0349e6c6ef76c786136176d3ca6 (patch) | |
tree | c069f92d63ba128a2611dc13ed0a0e250e87cfea /drivers/usb/musb/musb_host.c | |
parent | cfb9a1bc6e65c6093ed5ac4f1c0cc20a9f25d597 (diff) |
usb: musb: host: add urb tracepoints
Add urb tracepoints for host mode.
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb/musb_host.c')
-rw-r--r-- | drivers/usb/musb/musb_host.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 7601adae1ecc..53bc4ceefe89 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -44,6 +44,7 @@ | |||
44 | 44 | ||
45 | #include "musb_core.h" | 45 | #include "musb_core.h" |
46 | #include "musb_host.h" | 46 | #include "musb_host.h" |
47 | #include "musb_trace.h" | ||
47 | 48 | ||
48 | /* MUSB HOST status 22-mar-2006 | 49 | /* MUSB HOST status 22-mar-2006 |
49 | * | 50 | * |
@@ -225,8 +226,6 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) | |||
225 | void *buf = urb->transfer_buffer; | 226 | void *buf = urb->transfer_buffer; |
226 | u32 offset = 0; | 227 | u32 offset = 0; |
227 | struct musb_hw_ep *hw_ep = qh->hw_ep; | 228 | struct musb_hw_ep *hw_ep = qh->hw_ep; |
228 | unsigned pipe = urb->pipe; | ||
229 | u8 address = usb_pipedevice(pipe); | ||
230 | int epnum = hw_ep->epnum; | 229 | int epnum = hw_ep->epnum; |
231 | 230 | ||
232 | /* initialize software qh state */ | 231 | /* initialize software qh state */ |
@@ -254,16 +253,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) | |||
254 | len = urb->transfer_buffer_length - urb->actual_length; | 253 | len = urb->transfer_buffer_length - urb->actual_length; |
255 | } | 254 | } |
256 | 255 | ||
257 | musb_dbg(musb, "qh %p urb %p dev%d ep%d%s%s, hw_ep %d, %p/%d", | 256 | trace_musb_urb_start(musb, urb); |
258 | qh, urb, address, qh->epnum, | ||
259 | is_in ? "in" : "out", | ||
260 | ({char *s; switch (qh->type) { | ||
261 | case USB_ENDPOINT_XFER_CONTROL: s = ""; break; | ||
262 | case USB_ENDPOINT_XFER_BULK: s = "-bulk"; break; | ||
263 | case USB_ENDPOINT_XFER_ISOC: s = "-iso"; break; | ||
264 | default: s = "-intr"; break; | ||
265 | } s; }), | ||
266 | epnum, buf + offset, len); | ||
267 | 257 | ||
268 | /* Configure endpoint */ | 258 | /* Configure endpoint */ |
269 | musb_ep_set_qh(hw_ep, is_in, qh); | 259 | musb_ep_set_qh(hw_ep, is_in, qh); |
@@ -314,13 +304,7 @@ static void musb_giveback(struct musb *musb, struct urb *urb, int status) | |||
314 | __releases(musb->lock) | 304 | __releases(musb->lock) |
315 | __acquires(musb->lock) | 305 | __acquires(musb->lock) |
316 | { | 306 | { |
317 | musb_dbg(musb, "complete %p %pF (%d), dev%d ep%d%s, %d/%d", | 307 | trace_musb_urb_gb(musb, urb); |
318 | urb, urb->complete, status, | ||
319 | usb_pipedevice(urb->pipe), | ||
320 | usb_pipeendpoint(urb->pipe), | ||
321 | usb_pipein(urb->pipe) ? "in" : "out", | ||
322 | urb->actual_length, urb->transfer_buffer_length | ||
323 | ); | ||
324 | 308 | ||
325 | usb_hcd_unlink_urb_from_ep(musb->hcd, urb); | 309 | usb_hcd_unlink_urb_from_ep(musb->hcd, urb); |
326 | spin_unlock(&musb->lock); | 310 | spin_unlock(&musb->lock); |
@@ -1296,6 +1280,7 @@ void musb_host_tx(struct musb *musb, u8 epnum) | |||
1296 | 1280 | ||
1297 | pipe = urb->pipe; | 1281 | pipe = urb->pipe; |
1298 | dma = is_dma_capable() ? hw_ep->tx_channel : NULL; | 1282 | dma = is_dma_capable() ? hw_ep->tx_channel : NULL; |
1283 | trace_musb_urb_tx(musb, urb); | ||
1299 | musb_dbg(musb, "OUT/TX%d end, csr %04x%s", epnum, tx_csr, | 1284 | musb_dbg(musb, "OUT/TX%d end, csr %04x%s", epnum, tx_csr, |
1300 | dma ? ", dma" : ""); | 1285 | dma ? ", dma" : ""); |
1301 | 1286 | ||
@@ -1853,9 +1838,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1853 | 1838 | ||
1854 | pipe = urb->pipe; | 1839 | pipe = urb->pipe; |
1855 | 1840 | ||
1856 | musb_dbg(musb, "<== hw %d rxcsr %04x, urb actual %d (+dma %zu)", | 1841 | trace_musb_urb_rx(musb, urb); |
1857 | epnum, rx_csr, urb->actual_length, | ||
1858 | dma ? dma->actual_len : 0); | ||
1859 | 1842 | ||
1860 | /* check for errors, concurrent stall & unlink is not really | 1843 | /* check for errors, concurrent stall & unlink is not really |
1861 | * handled yet! */ | 1844 | * handled yet! */ |
@@ -2208,6 +2191,8 @@ static int musb_urb_enqueue( | |||
2208 | if (!is_host_active(musb) || !musb->is_active) | 2191 | if (!is_host_active(musb) || !musb->is_active) |
2209 | return -ENODEV; | 2192 | return -ENODEV; |
2210 | 2193 | ||
2194 | trace_musb_urb_enq(musb, urb); | ||
2195 | |||
2211 | spin_lock_irqsave(&musb->lock, flags); | 2196 | spin_lock_irqsave(&musb->lock, flags); |
2212 | ret = usb_hcd_link_urb_to_ep(hcd, urb); | 2197 | ret = usb_hcd_link_urb_to_ep(hcd, urb); |
2213 | qh = ret ? NULL : hep->hcpriv; | 2198 | qh = ret ? NULL : hep->hcpriv; |
@@ -2444,10 +2429,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
2444 | int is_in = usb_pipein(urb->pipe); | 2429 | int is_in = usb_pipein(urb->pipe); |
2445 | int ret; | 2430 | int ret; |
2446 | 2431 | ||
2447 | musb_dbg(musb, "urb=%p, dev%d ep%d%s", urb, | 2432 | trace_musb_urb_deq(musb, urb); |
2448 | usb_pipedevice(urb->pipe), | ||
2449 | usb_pipeendpoint(urb->pipe), | ||
2450 | is_in ? "in" : "out"); | ||
2451 | 2433 | ||
2452 | spin_lock_irqsave(&musb->lock, flags); | 2434 | spin_lock_irqsave(&musb->lock, flags); |
2453 | ret = usb_hcd_check_unlink_urb(hcd, urb, status); | 2435 | ret = usb_hcd_check_unlink_urb(hcd, urb, status); |