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

Commit d7d6352f authored by Mayank Rana's avatar Mayank Rana
Browse files

dwc3: gagdet: remove usage of PM runtime API with request handling



Currently code uses pm_runtime_get() to increment dwc3 usage count while
queueing USB request, and decrement same using pm_runtime_put() once
queued USB request is completed or aborted. Remove usage of these APIs
due to below reasons:
1. dwc3-msm is being parent device to dwc3. It makes sure not to allow
USB LPM until VBUS/ID notification. Also USB function driver (like ffs/
msc/bam/gsi) are incrementing dwc3 gadget device's PM usage count. So
incrementing and decrementing dwc3 device's PM usage count for each USB
request is little overkill.

2. ep_queue() API is not decrementing in case if it encounters any error
case before queueing USB request.

Change-Id: I6fbcdc4997cf65db3a4897136f1a06e7bf03eb82
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent a66b9ffd
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -319,9 +319,6 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
	if (unmap_after_complete)
		usb_gadget_unmap_request(&dwc->gadget,
				&req->request, req->direction);

	if (dep->number > 1)
		pm_runtime_put(dwc->dev);
}

int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param)
@@ -1241,7 +1238,6 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
		return ret;
	}

	pm_runtime_get(dwc->dev);
	req->request.actual	= 0;
	req->request.status	= -EINPROGRESS;
	req->direction		= dep->direction;