From 6d10fa81b32256087cc481c3289153b75e3f10eb Mon Sep 17 00:00:00 2001 From: wlf Date: Wed, 16 Jul 2014 14:09:10 +0800 Subject: [PATCH] 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. --- drivers/usb/dwc_otg_310/dwc_otg_pcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); /* -- 2.34.1