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

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