diff options
author | Jack Pham <jackp@codeaurora.org> | 2014-06-28 00:36:38 -0700 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:23:37 -0700 |
commit | 28fabd5ee2b10fb07e2dae96492af2afe25ff466 (patch) | |
tree | 5380117f73e1bbc4afdce5b82563bb2358e7a6d9 /drivers | |
parent | 060b80f220497ec52a0f400d54087e9bd42e3f56 (diff) |
usb: dwc3: Ensure req->dma is initialized to DMA_ERROR_CODE
commit 269a1b78 "usb: gadget: Add support for DMA mapping
optimization of request buffers" added checks to
usb_gadget_{map,unmap}_request() to support the pre-mapped
DMA buffers that a function can map ahead of time before
enqueing the request. However, these routines check the
req->dma for a sentinel value, DMA_ERROR_CODE, in order to
determine whether or not to proceed with dma_map/unmap().
This means that UDC drivers should initialize to this value
when allocating each new request. Do this in the dwc3
gadget driver in order to properly support this. This fixes
an issue in which usb_gadget_unmap_request() was incorrectly
being called on an uninitialized (as 0) req->dma address,
and proceeds to call dma_unmap() which interprets it as
physical address 0x0.
Change-Id: I514d2b824e272c6c42c483febaa1c4084b0d09ee
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index a4ca2f62b740..377281662cd0 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -774,6 +774,7 @@ static struct usb_request *dwc3_gadget_ep_alloc_request(struct usb_ep *ep, req->epnum = dep->number; req->dep = dep; + req->request.dma = DMA_ERROR_CODE; trace_dwc3_alloc_request(req); |