Commit 78c58a53 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Felipe Balbi

usb: dwc3: gadget: do not map/unmap ZLP transfers

If the gadget drivers sends a ZLP we are trying to map this this request
which does not work on all implementations. So we simply skip mapping
it.
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 42077b0a
...@@ -61,6 +61,11 @@ void dwc3_map_buffer_to_dma(struct dwc3_request *req) ...@@ -61,6 +61,11 @@ void dwc3_map_buffer_to_dma(struct dwc3_request *req)
{ {
struct dwc3 *dwc = req->dep->dwc; struct dwc3 *dwc = req->dep->dwc;
if (req->request.length == 0) {
/* req->request.dma = dwc->setup_buf_addr; */
return;
}
if (req->request.dma == DMA_ADDR_INVALID) { if (req->request.dma == DMA_ADDR_INVALID) {
req->request.dma = dma_map_single(dwc->dev, req->request.buf, req->request.dma = dma_map_single(dwc->dev, req->request.buf,
req->request.length, req->direction req->request.length, req->direction
...@@ -78,6 +83,11 @@ void dwc3_unmap_buffer_from_dma(struct dwc3_request *req) ...@@ -78,6 +83,11 @@ void dwc3_unmap_buffer_from_dma(struct dwc3_request *req)
{ {
struct dwc3 *dwc = req->dep->dwc; struct dwc3 *dwc = req->dep->dwc;
if (req->request.length == 0) {
req->request.dma = DMA_ADDR_INVALID;
return;
}
if (req->mapped) { if (req->mapped) {
dma_unmap_single(dwc->dev, req->request.dma, dma_unmap_single(dwc->dev, req->request.dma,
req->request.length, req->direction req->request.length, req->direction
......
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