1 From c237ff4a1325ac94169ed1f5f9022f1358b79ac9 Mon Sep 17 00:00:00 2001
2 From: P33M <P33M@github.com>
3 Date: Fri, 18 Mar 2016 17:38:37 +0000
4 Subject: [PATCH] dwc_otg: Don't free qh align buffers in atomic context
7 drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 9 +++++++--
8 1 file changed, 7 insertions(+), 2 deletions(-)
10 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
11 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
12 @@ -56,6 +56,9 @@ void dwc_otg_hcd_qh_free(dwc_otg_hcd_t *
14 dwc_otg_qtd_t *qtd, *qtd_tmp;
16 + uint32_t buf_size = 0;
17 + uint8_t *align_buf_virt = NULL;
18 + dwc_dma_t align_buf_dma;
20 /* Free each QTD in the QTD list */
21 DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags);
22 @@ -67,17 +70,19 @@ void dwc_otg_hcd_qh_free(dwc_otg_hcd_t *
23 if (hcd->core_if->dma_desc_enable) {
24 dwc_otg_hcd_qh_free_ddma(hcd, qh);
25 } else if (qh->dw_align_buf) {
27 if (qh->ep_type == UE_ISOCHRONOUS) {
30 buf_size = hcd->core_if->core_params->max_transfer_size;
32 - DWC_DMA_FREE(buf_size, qh->dw_align_buf, qh->dw_align_buf_dma);
33 + align_buf_virt = qh->dw_align_buf;
34 + align_buf_dma = qh->dw_align_buf_dma;
38 DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags);
40 + DWC_DMA_FREE(buf_size, align_buf_virt, align_buf_dma);