Fix memory issue in non-DMA mode for MUSB gadget
Hi,
Please don't top-posting.
Quoted 5 lines · Alexey Spirkov
Hi, Bin,
Thanks for note, but what do you think - is '
dma_mapping_error' checking still needed before call ofunmap_dma_buffer? If yes than I'll check DMA usage in this check instead ofis_buffer_map.
No, unmap_dma_buffer() can be called unconditionally here because unmap_dma_buffer() already calls is_buffer_mapped() internally.
So my comment below is to remove the 'if' condition check you modified.
Regards,
-Bin.
Quoted 36 lines
Best regards,
Alexey Spirkov-----Original Message-----
From: Bin Liu <[email protected]>
Sent: Thursday, August 2, 2018 7:15 PM
To: Alexey Spirkov <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] Fix memory issue in non-DMA mode for MUSB gadgetHi,
Quoted 14 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(-)(quoted diff) +0
-0
b/drivers/usb/musb/musb_gadget.cindex eae8b1b..3bc7c25 100644drivers/usb/musb/musb_gadget.c __acquires(ep->musb->lock) · line 143
Quoted 5 lines
drivers/usb/musb/musb_gadget.c +1
-1@@ -140,7 +140,7 @@ __acquires(ep->musb->lock) ep->busy =1 ;spin_unlock (&musb->lock); -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 6 lines
drivers/usb/musb/musb_gadget.c __acquires(ep->musb->lock) · line 146
Quoted 3 lines
drivers/usb/musb/musb_gadget.c +0
-0unmap_dma_buffer (req, musb);trace_musb_req_gb (req);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