Re: [PATCH 1/3] usb: gadget: udc: renesas_usb3: fix free size in renesas_usb3_dma_free_prd()

2017-07-18 Thread Geert Uytterhoeven
Hi Shimoda-san,

On Tue, Jul 18, 2017 at 2:26 PM, Yoshihiro Shimoda
 wrote:
> The commit 2d4aa21a73ba ("usb: gadget: udc: renesas_usb3: add support
> for dedicated DMAC") has a bug in the renesas_usb3_dma_free_prd().
> The size of dma_free_coherent() should be the same with dma_alloc_coherent()
> Otherwise, this code causes a WARNING by mm/page_alloc.c when
> renesas_usb3_dma_free_prd() is called. So, this patch fixes it.
>
> Fixes: 2d4aa21a73ba ("usb: gadget: udc: renesas_usb3: add support for 
> dedicated DMAC")
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] usb: gadget: udc: renesas_usb3: fix free size in renesas_usb3_dma_free_prd()

2017-07-18 Thread Yoshihiro Shimoda
The commit 2d4aa21a73ba ("usb: gadget: udc: renesas_usb3: add support
for dedicated DMAC") has a bug in the renesas_usb3_dma_free_prd().
The size of dma_free_coherent() should be the same with dma_alloc_coherent()
Otherwise, this code causes a WARNING by mm/page_alloc.c when
renesas_usb3_dma_free_prd() is called. So, this patch fixes it.

Fixes: 2d4aa21a73ba ("usb: gadget: udc: renesas_usb3: add support for dedicated 
DMAC")
Signed-off-by: Yoshihiro Shimoda 
---
 drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
b/drivers/usb/gadget/udc/renesas_usb3.c
index d827832..923ad5a 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -1369,7 +1369,7 @@ static int renesas_usb3_dma_free_prd(struct renesas_usb3 
*usb3,
 
usb3_for_each_dma(usb3, dma, i) {
if (dma->prd) {
-   dma_free_coherent(dev, USB3_DMA_MAX_XFER_SIZE,
+   dma_free_coherent(dev, USB3_DMA_PRD_SIZE,
  dma->prd, dma->prd_dma);
dma->prd = NULL;
}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html