aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2017-04-07 10:57:09 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-08 06:17:42 -0400
commitc8844f2ddb0d2bc42a813c567ad4240759f373bd (patch)
tree39721b35ee8249d0e4eb7ec596c26eaa627271cd
parent8c10152ec52b850f9806c5c2f5a93ebe38838959 (diff)
usb: xhci: remove xhci_dbg_ctx()
XHCI context changes have already been traced by the trace events. It's unnecessary to put the same message in kernel log. This patch removes the use of xhci_dbg_ctx(). Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci-dbg.c143
-rw-r--r--drivers/usb/host/xhci.c37
-rw-r--r--drivers/usb/host/xhci.h1
3 files changed, 0 insertions, 181 deletions
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index dc0194b87b74..2c83b37ae8f2 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -283,19 +283,6 @@ void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci)
283 upper_32_bits(val)); 283 upper_32_bits(val));
284} 284}
285 285
286/* Print the last 32 bytes for 64-byte contexts */
287static void dbg_rsvd64(struct xhci_hcd *xhci, u64 *ctx, dma_addr_t dma)
288{
289 int i;
290 for (i = 0; i < 4; i++) {
291 xhci_dbg(xhci, "@%p (virt) @%08llx "
292 "(dma) %#08llx - rsvd64[%d]\n",
293 &ctx[4 + i], (unsigned long long)dma,
294 ctx[4 + i], i);
295 dma += 8;
296 }
297}
298
299char *xhci_get_slot_state(struct xhci_hcd *xhci, 286char *xhci_get_slot_state(struct xhci_hcd *xhci,
300 struct xhci_container_ctx *ctx) 287 struct xhci_container_ctx *ctx)
301{ 288{
@@ -305,136 +292,6 @@ char *xhci_get_slot_state(struct xhci_hcd *xhci,
305 return xhci_slot_state_string(state); 292 return xhci_slot_state_string(state);
306} 293}
307 294
308static void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx)
309{
310 /* Fields are 32 bits wide, DMA addresses are in bytes */
311 int field_size = 32 / 8;
312 int i;
313
314 struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
315 dma_addr_t dma = ctx->dma +
316 ((unsigned long)slot_ctx - (unsigned long)ctx->bytes);
317 int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
318
319 xhci_dbg(xhci, "Slot Context:\n");
320 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info\n",
321 &slot_ctx->dev_info,
322 (unsigned long long)dma, slot_ctx->dev_info);
323 dma += field_size;
324 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info2\n",
325 &slot_ctx->dev_info2,
326 (unsigned long long)dma, slot_ctx->dev_info2);
327 dma += field_size;
328 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tt_info\n",
329 &slot_ctx->tt_info,
330 (unsigned long long)dma, slot_ctx->tt_info);
331 dma += field_size;
332 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_state\n",
333 &slot_ctx->dev_state,
334 (unsigned long long)dma, slot_ctx->dev_state);
335 dma += field_size;
336 for (i = 0; i < 4; i++) {
337 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
338 &slot_ctx->reserved[i], (unsigned long long)dma,
339 slot_ctx->reserved[i], i);
340 dma += field_size;
341 }
342
343 if (csz)
344 dbg_rsvd64(xhci, (u64 *)slot_ctx, dma);
345}
346
347static void xhci_dbg_ep_ctx(struct xhci_hcd *xhci,
348 struct xhci_container_ctx *ctx,
349 unsigned int last_ep)
350{
351 int i, j;
352 int last_ep_ctx = 31;
353 /* Fields are 32 bits wide, DMA addresses are in bytes */
354 int field_size = 32 / 8;
355 int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
356
357 if (last_ep < 31)
358 last_ep_ctx = last_ep + 1;
359 for (i = 0; i < last_ep_ctx; i++) {
360 unsigned int epaddr = xhci_get_endpoint_address(i);
361 struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci, ctx, i);
362 dma_addr_t dma = ctx->dma +
363 ((unsigned long)ep_ctx - (unsigned long)ctx->bytes);
364
365 xhci_dbg(xhci, "%s Endpoint %02d Context (ep_index %02d):\n",
366 usb_endpoint_out(epaddr) ? "OUT" : "IN",
367 epaddr & USB_ENDPOINT_NUMBER_MASK, i);
368 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info\n",
369 &ep_ctx->ep_info,
370 (unsigned long long)dma, ep_ctx->ep_info);
371 dma += field_size;
372 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info2\n",
373 &ep_ctx->ep_info2,
374 (unsigned long long)dma, ep_ctx->ep_info2);
375 dma += field_size;
376 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08llx - deq\n",
377 &ep_ctx->deq,
378 (unsigned long long)dma, ep_ctx->deq);
379 dma += 2*field_size;
380 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tx_info\n",
381 &ep_ctx->tx_info,
382 (unsigned long long)dma, ep_ctx->tx_info);
383 dma += field_size;
384 for (j = 0; j < 3; j++) {
385 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
386 &ep_ctx->reserved[j],
387 (unsigned long long)dma,
388 ep_ctx->reserved[j], j);
389 dma += field_size;
390 }
391
392 if (csz)
393 dbg_rsvd64(xhci, (u64 *)ep_ctx, dma);
394 }
395}
396
397void xhci_dbg_ctx(struct xhci_hcd *xhci,
398 struct xhci_container_ctx *ctx,
399 unsigned int last_ep)
400{
401 int i;
402 /* Fields are 32 bits wide, DMA addresses are in bytes */
403 int field_size = 32 / 8;
404 dma_addr_t dma = ctx->dma;
405 int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
406
407 if (ctx->type == XHCI_CTX_TYPE_INPUT) {
408 struct xhci_input_control_ctx *ctrl_ctx =
409 xhci_get_input_control_ctx(ctx);
410 if (!ctrl_ctx) {
411 xhci_warn(xhci, "Could not get input context, bad type.\n");
412 return;
413 }
414
415 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n",
416 &ctrl_ctx->drop_flags, (unsigned long long)dma,
417 ctrl_ctx->drop_flags);
418 dma += field_size;
419 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - add flags\n",
420 &ctrl_ctx->add_flags, (unsigned long long)dma,
421 ctrl_ctx->add_flags);
422 dma += field_size;
423 for (i = 0; i < 6; i++) {
424 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd2[%d]\n",
425 &ctrl_ctx->rsvd2[i], (unsigned long long)dma,
426 ctrl_ctx->rsvd2[i], i);
427 dma += field_size;
428 }
429
430 if (csz)
431 dbg_rsvd64(xhci, (u64 *)ctrl_ctx, dma);
432 }
433
434 xhci_dbg_slot_ctx(xhci, ctx);
435 xhci_dbg_ep_ctx(xhci, ctx, last_ep);
436}
437
438void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *), 295void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
439 const char *fmt, ...) 296 const char *fmt, ...)
440{ 297{
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 245ed40ea864..ba0e0e44c031 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1305,11 +1305,6 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id,
1305 ctrl_ctx->add_flags = cpu_to_le32(EP0_FLAG); 1305 ctrl_ctx->add_flags = cpu_to_le32(EP0_FLAG);
1306 ctrl_ctx->drop_flags = 0; 1306 ctrl_ctx->drop_flags = 0;
1307 1307
1308 xhci_dbg(xhci, "Slot %d input context\n", slot_id);
1309 xhci_dbg_ctx(xhci, command->in_ctx, ep_index);
1310 xhci_dbg(xhci, "Slot %d output context\n", slot_id);
1311 xhci_dbg_ctx(xhci, out_ctx, ep_index);
1312
1313 ret = xhci_configure_endpoint(xhci, urb->dev, command, 1308 ret = xhci_configure_endpoint(xhci, urb->dev, command,
1314 true, false); 1309 true, false);
1315 1310
@@ -1857,7 +1852,6 @@ static int xhci_evaluate_context_result(struct xhci_hcd *xhci,
1857 struct usb_device *udev, u32 *cmd_status) 1852 struct usb_device *udev, u32 *cmd_status)
1858{ 1853{
1859 int ret; 1854 int ret;
1860 struct xhci_virt_device *virt_dev = xhci->devs[udev->slot_id];
1861 1855
1862 switch (*cmd_status) { 1856 switch (*cmd_status) {
1863 case COMP_COMMAND_ABORTED: 1857 case COMP_COMMAND_ABORTED:
@@ -1878,7 +1872,6 @@ static int xhci_evaluate_context_result(struct xhci_hcd *xhci,
1878 case COMP_CONTEXT_STATE_ERROR: 1872 case COMP_CONTEXT_STATE_ERROR:
1879 dev_warn(&udev->dev, 1873 dev_warn(&udev->dev,
1880 "WARN: invalid context state for evaluate context command.\n"); 1874 "WARN: invalid context state for evaluate context command.\n");
1881 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 1);
1882 ret = -EINVAL; 1875 ret = -EINVAL;
1883 break; 1876 break;
1884 case COMP_INCOMPATIBLE_DEVICE_ERROR: 1877 case COMP_INCOMPATIBLE_DEVICE_ERROR:
@@ -2757,9 +2750,6 @@ static int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
2757 break; 2750 break;
2758 } 2751 }
2759 } 2752 }
2760 xhci_dbg(xhci, "New Input Control Context:\n");
2761 xhci_dbg_ctx(xhci, virt_dev->in_ctx,
2762 LAST_CTX_TO_EP_NUM(le32_to_cpu(slot_ctx->dev_info)));
2763 2753
2764 ret = xhci_configure_endpoint(xhci, udev, command, 2754 ret = xhci_configure_endpoint(xhci, udev, command,
2765 false, false); 2755 false, false);
@@ -2767,10 +2757,6 @@ static int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
2767 /* Callee should call reset_bandwidth() */ 2757 /* Callee should call reset_bandwidth() */
2768 goto command_cleanup; 2758 goto command_cleanup;
2769 2759
2770 xhci_dbg(xhci, "Output context after successful config ep cmd:\n");
2771 xhci_dbg_ctx(xhci, virt_dev->out_ctx,
2772 LAST_CTX_TO_EP_NUM(le32_to_cpu(slot_ctx->dev_info)));
2773
2774 /* Free any rings that were dropped, but not changed. */ 2760 /* Free any rings that were dropped, but not changed. */
2775 for (i = 1; i < 31; i++) { 2761 for (i = 1; i < 31; i++) {
2776 if ((le32_to_cpu(ctrl_ctx->drop_flags) & (1 << (i + 1))) && 2762 if ((le32_to_cpu(ctrl_ctx->drop_flags) & (1 << (i + 1))) &&
@@ -2837,9 +2823,6 @@ static void xhci_setup_input_ctx_for_config_ep(struct xhci_hcd *xhci,
2837 ctrl_ctx->drop_flags = cpu_to_le32(drop_flags); 2823 ctrl_ctx->drop_flags = cpu_to_le32(drop_flags);
2838 xhci_slot_copy(xhci, in_ctx, out_ctx); 2824 xhci_slot_copy(xhci, in_ctx, out_ctx);
2839 ctrl_ctx->add_flags |= cpu_to_le32(SLOT_FLAG); 2825 ctrl_ctx->add_flags |= cpu_to_le32(SLOT_FLAG);
2840
2841 xhci_dbg(xhci, "Input Context:\n");
2842 xhci_dbg_ctx(xhci, in_ctx, xhci_last_valid_endpoint(add_flags));
2843} 2826}
2844 2827
2845static void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci, 2828static void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci,
@@ -3552,9 +3535,6 @@ static int xhci_discover_or_reset_device(struct usb_hcd *hcd,
3552 } 3535 }
3553 /* If necessary, update the number of active TTs on this root port */ 3536 /* If necessary, update the number of active TTs on this root port */
3554 xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps); 3537 xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps);
3555
3556 xhci_dbg(xhci, "Output context after successful reset device cmd:\n");
3557 xhci_dbg_ctx(xhci, virt_dev->out_ctx, last_freed_endpoint);
3558 ret = 0; 3538 ret = 0;
3559 3539
3560command_cleanup: 3540command_cleanup:
@@ -3854,8 +3834,6 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
3854 ctrl_ctx->add_flags = cpu_to_le32(SLOT_FLAG | EP0_FLAG); 3834 ctrl_ctx->add_flags = cpu_to_le32(SLOT_FLAG | EP0_FLAG);
3855 ctrl_ctx->drop_flags = 0; 3835 ctrl_ctx->drop_flags = 0;
3856 3836
3857 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
3858 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
3859 trace_xhci_address_ctx(xhci, virt_dev->in_ctx, 3837 trace_xhci_address_ctx(xhci, virt_dev->in_ctx,
3860 le32_to_cpu(slot_ctx->dev_info) >> 27); 3838 le32_to_cpu(slot_ctx->dev_info) >> 27);
3861 3839
@@ -3908,8 +3886,6 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
3908 xhci_err(xhci, 3886 xhci_err(xhci,
3909 "ERROR: unexpected setup %s command completion code 0x%x.\n", 3887 "ERROR: unexpected setup %s command completion code 0x%x.\n",
3910 act, command->status); 3888 act, command->status);
3911 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);
3912 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2);
3913 trace_xhci_address_ctx(xhci, virt_dev->out_ctx, 1); 3889 trace_xhci_address_ctx(xhci, virt_dev->out_ctx, 1);
3914 ret = -EINVAL; 3890 ret = -EINVAL;
3915 break; 3891 break;
@@ -3928,12 +3904,8 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
3928 xhci_dbg_trace(xhci, trace_xhci_dbg_address, 3904 xhci_dbg_trace(xhci, trace_xhci_dbg_address,
3929 "Output Context DMA address = %#08llx", 3905 "Output Context DMA address = %#08llx",
3930 (unsigned long long)virt_dev->out_ctx->dma); 3906 (unsigned long long)virt_dev->out_ctx->dma);
3931 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
3932 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
3933 trace_xhci_address_ctx(xhci, virt_dev->in_ctx, 3907 trace_xhci_address_ctx(xhci, virt_dev->in_ctx,
3934 le32_to_cpu(slot_ctx->dev_info) >> 27); 3908 le32_to_cpu(slot_ctx->dev_info) >> 27);
3935 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);
3936 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2);
3937 /* 3909 /*
3938 * USB core uses address 1 for the roothubs, so we add one to the 3910 * USB core uses address 1 for the roothubs, so we add one to the
3939 * address given back to us by the HC. 3911 * address given back to us by the HC.
@@ -4038,14 +4010,10 @@ static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci,
4038 4010
4039 xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, 4011 xhci_dbg_trace(xhci, trace_xhci_dbg_context_change,
4040 "Set up evaluate context for LPM MEL change."); 4012 "Set up evaluate context for LPM MEL change.");
4041 xhci_dbg(xhci, "Slot %u Input Context:\n", udev->slot_id);
4042 xhci_dbg_ctx(xhci, command->in_ctx, 0);
4043 4013
4044 /* Issue and wait for the evaluate context command. */ 4014 /* Issue and wait for the evaluate context command. */
4045 ret = xhci_configure_endpoint(xhci, udev, command, 4015 ret = xhci_configure_endpoint(xhci, udev, command,
4046 true, true); 4016 true, true);
4047 xhci_dbg(xhci, "Slot %u Output Context:\n", udev->slot_id);
4048 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 0);
4049 4017
4050 if (!ret) { 4018 if (!ret) {
4051 spin_lock_irqsave(&xhci->lock, flags); 4019 spin_lock_irqsave(&xhci->lock, flags);
@@ -4813,8 +4781,6 @@ static int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev,
4813 xhci_dbg(xhci, "Set up %s for hub device.\n", 4781 xhci_dbg(xhci, "Set up %s for hub device.\n",
4814 (xhci->hci_version > 0x95) ? 4782 (xhci->hci_version > 0x95) ?
4815 "configure endpoint" : "evaluate context"); 4783 "configure endpoint" : "evaluate context");
4816 xhci_dbg(xhci, "Slot %u Input Context:\n", hdev->slot_id);
4817 xhci_dbg_ctx(xhci, config_cmd->in_ctx, 0);
4818 4784
4819 /* Issue and wait for the configure endpoint or 4785 /* Issue and wait for the configure endpoint or
4820 * evaluate context command. 4786 * evaluate context command.
@@ -4826,9 +4792,6 @@ static int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev,
4826 ret = xhci_configure_endpoint(xhci, hdev, config_cmd, 4792 ret = xhci_configure_endpoint(xhci, hdev, config_cmd,
4827 true, false); 4793 true, false);
4828 4794
4829 xhci_dbg(xhci, "Slot %u Output Context:\n", hdev->slot_id);
4830 xhci_dbg_ctx(xhci, vdev->out_ctx, 0);
4831
4832 xhci_free_command(xhci, config_cmd); 4795 xhci_free_command(xhci, config_cmd);
4833 return ret; 4796 return ret;
4834} 4797}
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index aef4fd55f3dc..04e041feba3c 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1923,7 +1923,6 @@ void xhci_dbg_regs(struct xhci_hcd *xhci);
1923void xhci_print_run_regs(struct xhci_hcd *xhci); 1923void xhci_print_run_regs(struct xhci_hcd *xhci);
1924void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst); 1924void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst);
1925void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci); 1925void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci);
1926void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int last_ep);
1927char *xhci_get_slot_state(struct xhci_hcd *xhci, 1926char *xhci_get_slot_state(struct xhci_hcd *xhci,
1928 struct xhci_container_ctx *ctx); 1927 struct xhci_container_ctx *ctx);
1929void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *), 1928void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),