USB: fix dwc_otg hcd desc dma allocate memory with GFP_ATOMIC.
authorwlf <wulf@rock-chips.com>
Wed, 16 Jul 2014 10:06:43 +0000 (18:06 +0800)
committerwlf <wulf@rock-chips.com>
Wed, 16 Jul 2014 10:06:43 +0000 (18:06 +0800)
drivers/usb/dwc_otg_310/dwc_otg_hcd_ddma.c

index 6d70577aff47834f2a6d1e0cd67286269b8078e3..3169aa272c0c1e0a4c09b66c80a0949d0de9f2bb 100755 (executable)
@@ -83,8 +83,8 @@ static int desc_list_alloc(dwc_otg_qh_t *qh)
        int retval = 0;
 
        qh->desc_list = (dwc_otg_host_dma_desc_t *)
-           DWC_DMA_ALLOC(sizeof(dwc_otg_host_dma_desc_t) * max_desc_num(qh),
-                         &qh->desc_list_dma);
+           DWC_DMA_ALLOC_ATOMIC(sizeof(dwc_otg_host_dma_desc_t) * max_desc_num(qh),
+                                &qh->desc_list_dma);
 
        if (!qh->desc_list) {
                retval = -DWC_E_NO_MEMORY;
@@ -97,7 +97,7 @@ static int desc_list_alloc(dwc_otg_qh_t *qh)
                   sizeof(dwc_otg_host_dma_desc_t) * max_desc_num(qh));
 
        qh->n_bytes =
-           (uint32_t *) DWC_ALLOC(sizeof(uint32_t) * max_desc_num(qh));
+           (uint32_t *) DWC_ALLOC_ATOMIC(sizeof(uint32_t) * max_desc_num(qh));
 
        if (!qh->n_bytes) {
                retval = -DWC_E_NO_MEMORY;
@@ -130,8 +130,8 @@ static int frame_list_alloc(dwc_otg_hcd_t *hcd)
        if (hcd->frame_list)
                return 0;
 
-       hcd->frame_list = DWC_DMA_ALLOC(4 * MAX_FRLIST_EN_NUM,
-                                       &hcd->frame_list_dma);
+       hcd->frame_list = DWC_DMA_ALLOC_ATOMIC(4 * MAX_FRLIST_EN_NUM,
+                                              &hcd->frame_list_dma);
        if (!hcd->frame_list) {
                retval = -DWC_E_NO_MEMORY;
                DWC_ERROR("%s: Frame List allocation failed\n", __func__);