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

Skip to content
Commit b9f443d5 authored by Jack Pham's avatar Jack Pham
Browse files

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: default avatarJack Pham <jackp@codeaurora.org>
parent 21f25e45
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment