Skip to content

Commit d1f63aa

Browse files
alexandrebelloniLee Jones
authored andcommitted
usb: gadget: udc: lpc32xx: allocate descriptor with GFP_ATOMIC
[ Upstream commit fbc318a ] 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. Also remove the unnecessary cast. Acked-by: Sylvain Lemieux <slemieux.tyco@gmail.com> Tested-by: James Grant <jamesg@zaltys.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Change-Id: Iac6fdb2f664de82dde243dfa15b81e4add2198bf
1 parent 5758072 commit d1f63aa

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/usb/gadget/udc/lpc32xx_udc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc)
966966
dma_addr_t dma;
967967
struct lpc32xx_usbd_dd_gad *dd;
968968

969-
dd = (struct lpc32xx_usbd_dd_gad *) dma_pool_alloc(
970-
udc->dd_cache, (GFP_KERNEL | GFP_DMA), &dma);
969+
dd = dma_pool_alloc(udc->dd_cache, GFP_ATOMIC | GFP_DMA, &dma);
971970
if (dd)
972971
dd->this_dma = dma;
973972

0 commit comments

Comments
 (0)