0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch 1.3 KB

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