From: wlf Date: Wed, 16 Jul 2014 06:09:10 +0000 (+0800) Subject: USB: fix otg pcd DMA allocate memory with GFP_ATOMIC. X-Git-Tag: firefly_0821_release~4975 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6d10fa81b32256087cc481c3289153b75e3f10eb;p=firefly-linux-kernel-4.4.55.git USB: fix otg pcd DMA allocate memory with GFP_ATOMIC. In dwc_otg_pcd_ep_queue, allocate DMA memory for align buf. Because dwc_otg_pcd_ep_queue can be called in irq, so it must be used GFP_ATOMIC to avoid sleep in irq. --- diff --git a/drivers/usb/dwc_otg_310/dwc_otg_pcd.c b/drivers/usb/dwc_otg_310/dwc_otg_pcd.c index ddb0375d292a..a82bd0f89e34 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_pcd.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_pcd.c @@ -2144,8 +2144,8 @@ int dwc_otg_pcd_ep_queue(dwc_otg_pcd_t *pcd, void *ep_handle, req->dw_align_buf = NULL; if ((dma_buf & 0x3) && GET_CORE_IF(pcd)->dma_enable && !GET_CORE_IF(pcd)->dma_desc_enable) - req->dw_align_buf = DWC_DMA_ALLOC(buflen, - &req->dw_align_buf_dma); + req->dw_align_buf = DWC_DMA_ALLOC_ATOMIC(buflen, + &req->dw_align_buf_dma); DWC_SPINLOCK_IRQSAVE(pcd->lock, &flags); /*