brcm2708: update linux 4.4 patches to latest version
[oweals/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch
1 From 63c48596343f1431c898381a06629eef2719fbeb 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
5
6 ---
7  drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 9 +++++++--
8  1 file changed, 7 insertions(+), 2 deletions(-)
9
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 *
13  {
14         dwc_otg_qtd_t *qtd, *qtd_tmp;
15         dwc_irqflags_t flags;
16 +       uint32_t buf_size = 0;
17 +       uint8_t *align_buf_virt = NULL;
18 +       dwc_dma_t align_buf_dma;
19  
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) {
26 -               uint32_t buf_size;
27                 if (qh->ep_type == UE_ISOCHRONOUS) {
28                         buf_size = 4096;
29                 } else {
30                         buf_size = hcd->core_if->core_params->max_transfer_size;
31                 }
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;
35         }
36  
37         DWC_FREE(qh);
38         DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags);
39 +       if (align_buf_virt)
40 +               DWC_DMA_FREE(buf_size, align_buf_virt, align_buf_dma);
41         return;
42  }
43