Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5c32594 authored by Pratham Pratap's avatar Pratham Pratap Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 3fc748c6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1590,7 +1590,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");
+29 −9
Original line number Diff line number Diff line
@@ -139,19 +139,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)
{
	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 %d", ep_num >> 1,
		ep_num & 1 ? "IN":"OUT", "UNMAP", &req->request,
		req->request.dma, req->request.length, req->trb_dma,
			"%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)
{
	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", ep_num >> 1,
		ep_num & 1 ? "IN":"OUT", "MAP", &req->request, req->request.dma,
		req->request.length, req->trb_dma);
			"%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)