0006-MIPS-lantiq-pass-struct-device-to-DMA-API-functions.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 74f03104ed465ff71b11076ef620e4eaa53dbf74 Mon Sep 17 00:00:00 2001
  2. From: Christoph Hellwig <[email protected]>
  3. Date: Fri, 1 Feb 2019 09:47:44 +0100
  4. Subject: [PATCH] MIPS: lantiq: pass struct device to DMA API functions
  5. The DMA API generally relies on a struct device to work properly, and
  6. only barely works without one for legacy reasons. Pass the easily
  7. available struct device from the platform_device to remedy this.
  8. Also use GFP_KERNEL instead of GFP_ATOMIC as the gfp_t for the memory
  9. allocation, as we aren't in interrupt context or under a lock.
  10. Note that this whole function looks somewhat bogus given that we never
  11. even look at the returned dma address, and the CPHYSADDR magic on
  12. a returned noncached mapping looks "interesting". But I'll leave
  13. that to people more familiar with the code to sort out.
  14. Signed-off-by: Christoph Hellwig <[email protected]>
  15. Signed-off-by: Paul Burton <[email protected]>
  16. Cc: John Crispin <[email protected]>
  17. Cc: Vinod Koul <[email protected]>
  18. Cc: Dmitry Tarnyagin <[email protected]>
  19. Cc: Nicolas Ferre <[email protected]>
  20. Cc: Sudip Mukherjee <[email protected]>
  21. Cc: Felipe Balbi <[email protected]>
  22. Cc: [email protected]
  23. Cc: [email protected]
  24. Cc: [email protected]
  25. Cc: [email protected]
  26. Cc: [email protected]
  27. Cc: [email protected]
  28. Cc: [email protected]
  29. Cc: [email protected]
  30. ---
  31. arch/mips/lantiq/xway/vmmc.c | 4 ++--
  32. 1 file changed, 2 insertions(+), 2 deletions(-)
  33. --- a/arch/mips/lantiq/xway/vmmc.c
  34. +++ b/arch/mips/lantiq/xway/vmmc.c
  35. @@ -31,8 +31,8 @@ static int vmmc_probe(struct platform_de
  36. dma_addr_t dma;
  37. cp1_base =
  38. - (void *) CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE,
  39. - &dma, GFP_ATOMIC));
  40. + (void *) CPHYSADDR(dma_alloc_coherent(&pdev->dev, CP1_SIZE,
  41. + &dma, GFP_KERNEL));
  42. gpio_count = of_gpio_count(pdev->dev.of_node);
  43. while (gpio_count > 0) {