usb: dwc3: Add logging for ep0 map/unmap requests

Log the ep0 dma map/unmap request  in the IPC log buffer
for debugging SMMU faults.

Logs can be accessed using below command
cat /sys/kernel/debug/ipc_logging/a600000.dwc3.ep_events/log.

Change-Id: If5587b8ba59451593968999b59cd61f2a469fe1c
Signed-off-by: Elson Roy Serrao <eserrao@codeaurora.org>
Signed-off-by: Udipto Goswami <ugoswami@codeaurora.org>
This commit is contained in:
Elson Roy Serrao 2019-11-20 11:29:24 -08:00 • committed by Udipto Goswami
commit fa52163c3a
2 changed files with 3 additions and 6 deletions

View file

@ -140,9 +140,6 @@ 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)
{
if (ep_num < 2)
return;
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,
@ -152,9 +149,6 @@ void dwc3_dbg_dma_unmap(struct dwc3 *dwc, u8 ep_num, struct dwc3_request *req)
void dwc3_dbg_dma_map(struct dwc3 *dwc, u8 ep_num, struct dwc3_request *req)
{
if (ep_num < 2)
return;
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,

View file

@ -1027,6 +1027,7 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
true);
req->trb = &dwc->ep0_trb[dep->trb_enqueue - 1];
dbg_ep_map(dep->number, req);
/* Now prepare one extra TRB to align transfer size */
dwc3_ep0_prepare_one_trb(dep, dwc->bounce_addr,
@ -1049,6 +1050,7 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
true);
req->trb = &dwc->ep0_trb[dep->trb_enqueue - 1];
dbg_ep_map(dep->number, req);
/* Now prepare one extra TRB to align transfer size */
dwc3_ep0_prepare_one_trb(dep, dwc->bounce_addr,
@ -1066,6 +1068,7 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
false);
req->trb = &dwc->ep0_trb[dep->trb_enqueue];
dbg_ep_map(dep->number, req);
ret = dwc3_ep0_start_trans(dep);
}