319-v4.12-0030-brcmfmac-properly-align-buffers-on-certain-platforms.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 6e84ab604bdedaa16239bd1c6e5fcb5660309f02 Mon Sep 17 00:00:00 2001
  2. From: Heiner Kallweit <hkallweit1@gmail.com>
  3. Date: Wed, 5 Apr 2017 20:33:26 +0200
  4. Subject: [PATCH] brcmfmac: properly align buffers on certain platforms with 64
  5. bit DMA
  6. Systems with 64 bit DMA at least partially require buffers to be used
  7. for DMA to be 8-byte-aligned. One example is Amlogic Meson GX.
  8. Switching the MMC/SDIO driver for this platform to SG DMA mode
  9. resulted in problems due to unaligned buffers.
  10. Fortunately the brcmfmac driver has a global define for the alignment.
  11. Changing it to 8 fixed the issues with Meson GX.
  12. Suggested-by: Helmut Klein <hgkr.klein@gmail.com>
  13. Tested-by: Helmut Klein <hgkr.klein@gmail.com>
  14. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
  15. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  16. ---
  17. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 ++++
  18. 1 file changed, 4 insertions(+)
  19. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  20. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  21. @@ -540,7 +540,11 @@ static int qcount[NUMPRIO];
  22. /* Limit on rounding up frames */
  23. static const uint max_roundup = 512;
  24. +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
  25. +#define ALIGNMENT 8
  26. +#else
  27. #define ALIGNMENT 4
  28. +#endif
  29. enum brcmf_sdio_frmtype {
  30. BRCMF_SDIO_FT_NORMAL,