usb: gadget: udc: lpc32xx: allocate descriptor with GFP_ATOMIC
Subsystems (2)
PATCH 1/1 usb: gadget: udc: lpc32xx: allocate descriptor with GFP_ATOMIC
Gadget drivers may queue request in interrupt context. This would lead to a descriptor allocation in that context. In that case we would hit BUG_ON(in_interrupt()) in __get_vm_area_node.
--- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/lpc32xx_udc.c +1 -1
@@ -938,7 +938,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc)struct lpc32xx_usbd_dd_gad *dd; dd = (struct lpc32xx_usbd_dd_gad *)dma_pool_alloc ( - udc->dd_cache, (GFP_KERNEL |GFP_DMA ), &dma); + udc->dd_cache, (GFP_ATOMIC |GFP_DMA ), &dma);if (dd) dd->this_dma = dma;
Signature · 1 line
2.21.0
Quoted 3 lines · Alexandre Belloni
Gadget drivers may queue request in interrupt context. This would lead to a descriptor allocation in that context. In that case we would hit BUG_ON(in_interrupt()) in
__get_vm_area_node.
[]
drivers/usb/gadget/udc/lpc32xx_udc.c
Quoted 1 line
drivers/usb/gadget/udc/lpc32xx_udc.c +0
-0
[]
drivers/usb/gadget/udc/lpc32xx_udc.c static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) · line 941
Quoted 6 lines
drivers/usb/gadget/udc/lpc32xx_udc.c +1
-1@@ -938,7 +938,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc)struct lpc32xx_usbd_dd_gad *dd; dd = (struct lpc32xx_usbd_dd_gad *)dma_pool_alloc ( - udc->dd_cache, (GFP_KERNEL |GFP_DMA ), &dma); + udc->dd_cache, (GFP_ATOMIC |GFP_DMA ), &dma);
trivia:
This could fit nicely on a single line without the unnecessary cast and the unnecessary parentheses around the GFP_ types.
Tested with a board containing LPC3250 SOC and STOTG04 PHY by using serial gadget.
Needed patch series starting with "[PATCH 0/5] usb: gadget: udc: lpc32xx: add stotg04 phy support" also.
Regards,
James Grant.
Quoted 14 lines · Alexandre Belloni
Gadget drivers may queue request in interrupt context. This would lead to a descriptor allocation in that context. In that case we would hit BUG_ON(in_interrupt()) in
__get_vm_area_node.Signed-off-by Alexandre Belloni<[email protected]>--- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/udc/lpc32xx_udc.c +0
-0
drivers/usb/gadget/udc/lpc32xx_udc.c static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) · line 944
Quoted 8 lines
drivers/usb/gadget/udc/lpc32xx_udc.c +1
-1@@ -938,7 +938,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc)struct lpc32xx_usbd_dd_gad *dd; dd = (struct lpc32xx_usbd_dd_gad *)dma_pool_alloc ( - udc->dd_cache, (GFP_KERNEL |GFP_DMA ), &dma); + udc->dd_cache, (GFP_ATOMIC |GFP_DMA ), &dma);if (dd) dd->this_dma = dma;
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 14 lines · Alexandre Belloni
Gadget drivers may queue request in interrupt context. This would lead to a descriptor allocation in that context. In that case we would hit BUG_ON(in_interrupt()) in
__get_vm_area_node.Signed-off-by Alexandre Belloni <[email protected]>--- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/udc/lpc32xx_udc.c +0
-0
drivers/usb/gadget/udc/lpc32xx_udc.c static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) · line 941
Quoted 5 lines
drivers/usb/gadget/udc/lpc32xx_udc.c +1
-1@@ -938,7 +938,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc)struct lpc32xx_usbd_dd_gad *dd; dd = (struct lpc32xx_usbd_dd_gad *)dma_pool_alloc ( - udc->dd_cache, (GFP_KERNEL |GFP_DMA ), &dma); + udc->dd_cache, (GFP_ATOMIC |GFP_DMA ), &dma);
doesn't apply:
checking file drivers/usb/gadget/udc/lpc32xx_udc.c Hunk #1 FAILED at 938.
Signature · 1 line
balbi
Hi,
Quoted 18 lines · Felipe Balbi
Quoted 16 lines · Alexandre Belloni
Gadget drivers may queue request in interrupt context. This would lead to a descriptor allocation in that context. In that case we would hit BUG_ON(in_interrupt()) in
__get_vm_area_node.Signed-off-by Alexandre Belloni <[email protected]>--- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/udc/lpc32xx_udc.c +0
-0@@ -938,7 +938,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc)struct lpc32xx_usbd_dd_gad *dd;
Quoted 9 lines
drivers/usb/gadget/udc/lpc32xx_udc.c static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) · line 941
Quoted 3 lines
drivers/usb/gadget/udc/lpc32xx_udc.c +1
-1dd = (struct lpc32xx_usbd_dd_gad *)dma_pool_alloc ( - udc->dd_cache, (GFP_KERNEL |GFP_DMA ), &dma); + udc->dd_cache, (GFP_ATOMIC |GFP_DMA ), &dma);doesn't apply:
checking file
drivers/usb/gadget/udc/lpc32xx_udc.cHunk #1 FAILED at 938.
You already applied it for v5.2-rc5
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi,
Quoted 27 lines · Alexandre Belloni
Hi,
Quoted 24 lines · Felipe Balbi
Quoted 14 lines · Alexandre Belloni
Gadget drivers may queue request in interrupt context. This would lead to a descriptor allocation in that context. In that case we would hit BUG_ON(in_interrupt()) in
__get_vm_area_node.Signed-off-by Alexandre Belloni <[email protected]>--- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/udc/lpc32xx_udc.c +0
-0drivers/usb/gadget/udc/lpc32xx_udc.c static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) · line 941
Quoted 5 lines
drivers/usb/gadget/udc/lpc32xx_udc.c +1
-1@@ -938,7 +938,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc)struct lpc32xx_usbd_dd_gad *dd; dd = (struct lpc32xx_usbd_dd_gad *)dma_pool_alloc ( - udc->dd_cache, (GFP_KERNEL |GFP_DMA ), &dma); + udc->dd_cache, (GFP_ATOMIC |GFP_DMA ), &dma);doesn't apply:
Quoted 5 lines
Quoted 3 lines
checking file
drivers/usb/gadget/udc/lpc32xx_udc.cHunk #1 FAILED at 938.You already applied it for v5.2-rc5
d'oh!
Guess I haven't looked at my inbox in a while :-p
thanks
Signature · 1 line
balbi