USB: fix otg pcd DMA allocate memory with GFP_ATOMIC.
authorwlf <wulf@rock-chips.com>
Wed, 16 Jul 2014 06:09:10 +0000 (14:09 +0800)
committerwlf <wulf@rock-chips.com>
Wed, 16 Jul 2014 06:09:10 +0000 (14:09 +0800)
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

index ddb0375d292a54f177da4d81914bc1d218e58bb9..a82bd0f89e347cd6400ce8299d9b358ce3337380 100755 (executable)
@@ -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);
 
        /*