mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
usb: dwc3: core: Add ipc logs when sg lists are used
Currently ipc_logging will capture the usb request's dma address but when sg list is used usb request's dma address is not populated. This change adds start_sg's dma address which is populated when sg list is used for usb transfers. Also increase the number of log pages to capture more ep events. Change-Id: I36ada11429e168e2d3d09cf3427b1f3bcdacc285 Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
This commit is contained in:
parent
6998de7d04
commit
1b64983eb0
2 changed files with 30 additions and 10 deletions
|
|
@ -1681,7 +1681,7 @@ static int dwc3_probe(struct platform_device *pdev)
|
|||
|
||||
snprintf(dma_ipc_log_ctx_name, sizeof(dma_ipc_log_ctx_name),
|
||||
"%s.ep_events", dev_name(dwc->dev));
|
||||
dwc->dwc_dma_ipc_log_ctxt = ipc_log_context_create(NUM_LOG_PAGES,
|
||||
dwc->dwc_dma_ipc_log_ctxt = ipc_log_context_create(2 * NUM_LOG_PAGES,
|
||||
dma_ipc_log_ctx_name, 0);
|
||||
if (!dwc->dwc_dma_ipc_log_ctxt)
|
||||
dev_err(dwc->dev, "Error getting ipc_log_ctxt for ep_events\n");
|
||||
|
|
|
|||
|
|
@ -140,19 +140,39 @@ void dwc3_dbg_print_reg(struct dwc3 *dwc, const char *name, int reg)
|
|||
|
||||
void dwc3_dbg_dma_unmap(struct dwc3 *dwc, u8 ep_num, struct dwc3_request *req)
|
||||
{
|
||||
ipc_log_string(dwc->dwc_dma_ipc_log_ctxt,
|
||||
"%02X-%-3.3s %-25.25s 0x%pK 0x%lx %u 0x%lx %d", ep_num >> 1,
|
||||
ep_num & 1 ? "IN":"OUT", "UNMAP", &req->request,
|
||||
req->request.dma, req->request.length, req->trb_dma,
|
||||
req->trb->ctrl & DWC3_TRB_CTRL_HWO);
|
||||
if (req->request.num_sgs > 0) {
|
||||
ipc_log_string(dwc->dwc_dma_ipc_log_ctxt,
|
||||
"%02X-%-3.3s %-25.25s 0x%pK 0x%lx %u 0x%lx mapped_sgs:%d queued_sgs:%d %d",
|
||||
ep_num >> 1, ep_num & 1 ? "IN":"OUT", "UNMAP",
|
||||
&req->request, sg_dma_address(req->start_sg),
|
||||
sg_dma_len(req->start_sg), req->trb_dma,
|
||||
req->request.num_mapped_sgs, req->num_queued_sgs,
|
||||
req->trb->ctrl & DWC3_TRB_CTRL_HWO);
|
||||
} else {
|
||||
ipc_log_string(dwc->dwc_dma_ipc_log_ctxt,
|
||||
"%02X-%-3.3s %-25.25s 0x%pK 0x%lx %u 0x%lx %d",
|
||||
ep_num >> 1, ep_num & 1 ? "IN":"OUT", "UNMAP",
|
||||
&req->request, req->request.dma, req->request.length,
|
||||
req->trb_dma, req->trb->ctrl & DWC3_TRB_CTRL_HWO);
|
||||
}
|
||||
}
|
||||
|
||||
void dwc3_dbg_dma_map(struct dwc3 *dwc, u8 ep_num, struct dwc3_request *req)
|
||||
{
|
||||
ipc_log_string(dwc->dwc_dma_ipc_log_ctxt,
|
||||
"%02X-%-3.3s %-25.25s 0x%pK 0x%lx %u 0x%lx", ep_num >> 1,
|
||||
ep_num & 1 ? "IN":"OUT", "MAP", &req->request, req->request.dma,
|
||||
req->request.length, req->trb_dma);
|
||||
if (req->request.num_sgs > 0) {
|
||||
ipc_log_string(dwc->dwc_dma_ipc_log_ctxt,
|
||||
"%02X-%-3.3s %-25.25s 0x%pK 0x%lx %u 0x%lx mapped_sgs:%d queued_sgs:%d",
|
||||
ep_num >> 1, ep_num & 1 ? "IN":"OUT", "MAP",
|
||||
&req->request, sg_dma_address(req->start_sg),
|
||||
sg_dma_len(req->start_sg), req->trb_dma,
|
||||
req->request.num_mapped_sgs, req->num_queued_sgs);
|
||||
} else {
|
||||
ipc_log_string(dwc->dwc_dma_ipc_log_ctxt,
|
||||
"%02X-%-3.3s %-25.25s 0x%pK 0x%lx %u 0x%lx",
|
||||
ep_num >> 1, ep_num & 1 ? "IN":"OUT", "MAP",
|
||||
&req->request, req->request.dma, req->request.length,
|
||||
req->trb_dma);
|
||||
}
|
||||
}
|
||||
|
||||
void dwc3_dbg_dma_dequeue(struct dwc3 *dwc, u8 ep_num, struct dwc3_request *req)
|
||||
|
|
|
|||
Loading…
Reference in a new issue