brcm2708: update linux 4.4 patches to latest version
[openwrt/staging/lynxis/omap.git] / target / linux / brcm2708 / patches-4.4 / 0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch
1 From d309ffcbd73c0fb942d4f92b1a5089a40fe3855e 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 206/423] dwc_otg: Don't free qh align buffers in atomic
5 context
6
7 ---
8 drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 9 +++++++--
9 1 file changed, 7 insertions(+), 2 deletions(-)
10
11 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
12 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
13 @@ -56,6 +56,9 @@ void dwc_otg_hcd_qh_free(dwc_otg_hcd_t *
14 {
15 dwc_otg_qtd_t *qtd, *qtd_tmp;
16 dwc_irqflags_t flags;
17 + uint32_t buf_size = 0;
18 + uint8_t *align_buf_virt = NULL;
19 + dwc_dma_t align_buf_dma;
20
21 /* Free each QTD in the QTD list */
22 DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags);
23 @@ -67,17 +70,19 @@ void dwc_otg_hcd_qh_free(dwc_otg_hcd_t *
24 if (hcd->core_if->dma_desc_enable) {
25 dwc_otg_hcd_qh_free_ddma(hcd, qh);
26 } else if (qh->dw_align_buf) {
27 - uint32_t buf_size;
28 if (qh->ep_type == UE_ISOCHRONOUS) {
29 buf_size = 4096;
30 } else {
31 buf_size = hcd->core_if->core_params->max_transfer_size;
32 }
33 - DWC_DMA_FREE(buf_size, qh->dw_align_buf, qh->dw_align_buf_dma);
34 + align_buf_virt = qh->dw_align_buf;
35 + align_buf_dma = qh->dw_align_buf_dma;
36 }
37
38 DWC_FREE(qh);
39 DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags);
40 + if (align_buf_virt)
41 + DWC_DMA_FREE(buf_size, align_buf_virt, align_buf_dma);
42 return;
43 }
44