diff options
author | Gregory Herrero <gregory.herrero@intel.com> | 2015-04-29 22:09:16 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-04-29 22:20:00 +0200 |
commit | db62b9a804b465f5050438eb06151c99c625ec9a (patch) | |
tree | dd167e381e31826ef95c1d9718908494c2f8fdcf /drivers/usb/dwc2/hcd_queue.c | |
parent | usb: dwc2: host: spinlock urb_enqueue (diff) | |
download | linux-db62b9a804b465f5050438eb06151c99c625ec9a.tar.xz linux-db62b9a804b465f5050438eb06151c99c625ec9a.zip |
usb: dwc2: host: don't use dma_alloc_coherent with irqs disabled
Align buffer must be allocated using kmalloc since irqs are disabled.
Coherency is handled through dma_map_single which can be used with irqs
disabled.
Reviewed-by: Julius Werner <jwerner@chromium.org>
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc2/hcd_queue.c')
-rw-r--r-- | drivers/usb/dwc2/hcd_queue.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c index 63207dc3cb22..9b5c36256627 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c @@ -229,11 +229,13 @@ static struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg, */ void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) { - if (hsotg->core_params->dma_desc_enable > 0) + if (hsotg->core_params->dma_desc_enable > 0) { dwc2_hcd_qh_free_ddma(hsotg, qh); - else if (qh->dw_align_buf) - dma_free_coherent(hsotg->dev, qh->dw_align_buf_size, - qh->dw_align_buf, qh->dw_align_buf_dma); + } else { + /* kfree(NULL) is safe */ + kfree(qh->dw_align_buf); + qh->dw_align_buf_dma = (dma_addr_t)0; + } kfree(qh); } |