Fix memory issue in non-DMA mode for MUSB gadget
Quoted 20 lines · Bin Liu
Hi,
Quoted 17 lines · Alexey Spirkov
dma_mapping_errorfunction unable to works in PowerPC arch when MUSB do not use DMA (illegal memory access). Proposed patch replace its usage to usual define for checking DMA mapping.Signed-off-by Alexey Spirkov <[email protected]>--- drivers/usb/musb/musb_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/musb/musb_gadget.c +0
-0@@ -140,7 +140,7 @@ __acquires(ep->musb->lock) ep->busy =1 ;spin_unlock (&musb->lock);
Quoted 9 lines
drivers/usb/musb/musb_gadget.c __acquires(ep->musb->lock) · line 143
Quoted 2 lines
drivers/usb/musb/musb_gadget.c +1
-1-if (!dma_mapping_error (&musb->g.dev, request->dma)) +if (req &&is_buffer_mapped (req))
unmap_dma_buffer()checks foris_buffer_mapped(), so this line can be dropped.Quoted 3 lines
drivers/usb/musb/musb_gadget.c +0
-0unmap_dma_buffer (req, musb);trace_musb_req_gb (req);
Please also fix the patch subject to "usb: musb: gadget: ..." in your v2. I prefer
"usb: musb: gadget: fix illegal dma address check in non-DMA mode"
Regards,
-Bin.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html