0003-HACK-Revert-of-device-Really-only-set-bus-DMA-mask-w.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 3b579413ed231e51625b5f5b5f672d10fc570628 Mon Sep 17 00:00:00 2001
  2. From: Alistair Francis <alistair.francis@wdc.com>
  3. Date: Thu, 21 Feb 2019 16:29:37 -0800
  4. Subject: [PATCH 3/4] HACK: Revert "of/device: Really only set bus DMA mask
  5. when appropriate"
  6. This reverts commit 6778be4e520959659b27a441c06a84c9cb009085.
  7. Reverting the commit fixes these error messages and an non-functioning
  8. USB bus when attaching a USB to PCIe card to a RISC-V board:
  9. xhci_hcd 0000:03:00.0: Host took too long to start, waited 16000 microseconds.
  10. xhci_hcd 0000:03:00.0: startup error -19
  11. xhci_hcd 0000:03:00.0: USB bus 2 deregistered
  12. xhci_hcd 0000:03:00.0: WARNING: Host System Error
  13. xhci_hcd 0000:03:00.0: remove, state 1
  14. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
  15. Upstream-Status: Denied
  16. ---
  17. drivers/of/device.c | 4 +---
  18. 1 file changed, 1 insertion(+), 3 deletions(-)
  19. diff --git a/drivers/of/device.c b/drivers/of/device.c
  20. index da8158392010..e1fb703ff603 100644
  21. --- a/drivers/of/device.c
  22. +++ b/drivers/of/device.c
  23. @@ -149,11 +149,9 @@ int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
  24. * set by the driver.
  25. */
  26. mask = DMA_BIT_MASK(ilog2(dma_addr + size - 1) + 1);
  27. + dev->bus_dma_mask = mask;
  28. dev->coherent_dma_mask &= mask;
  29. *dev->dma_mask &= mask;
  30. - /* ...but only set bus mask if we found valid dma-ranges earlier */
  31. - if (!ret)
  32. - dev->bus_dma_mask = mask;
  33. coherent = of_dma_is_coherent(np);
  34. dev_dbg(dev, "device is%sdma coherent\n",
  35. --
  36. 2.22.0