Commit d6214592 authored by Felipe Balbi's avatar Felipe Balbi

usb: dwc3: gadget: always unmap EP0 requests

commit 0416e494 ("usb: dwc3: ep0: correct cache
sync issue in case of ep0_bounced") introduced a bug
where we would leak DMA resources which would cause
us to starve the system of them resulting in failing
DMA transfers.

Fix the bug by making sure that we always unmap EP0
requests since those are *always* mapped.

Fixes: 0416e494 ("usb: dwc3: ep0: correct cache
	sync issue in case of ep0_bounced")
Cc: <stable@vger.kernel.org>
Tested-by: default avatarTomasz Medrek <tomaszx.medrek@intel.com>
Reported-by: default avatarJanusz Dziedzic <januszx.dziedzic@linux.intel.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 19ec3123
...@@ -180,11 +180,11 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, ...@@ -180,11 +180,11 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
if (req->request.status == -EINPROGRESS) if (req->request.status == -EINPROGRESS)
req->request.status = status; req->request.status = status;
if (dwc->ep0_bounced && dep->number == 0) if (dwc->ep0_bounced && dep->number <= 1)
dwc->ep0_bounced = false; dwc->ep0_bounced = false;
else
usb_gadget_unmap_request_by_dev(dwc->sysdev, usb_gadget_unmap_request_by_dev(dwc->sysdev,
&req->request, req->direction); &req->request, req->direction);
trace_dwc3_gadget_giveback(req); trace_dwc3_gadget_giveback(req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment