319-v4.12-0053-brcmfmac-fix-alignment-configuration-on-host-using-6.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 1dbf647f31751a4e94fa0435c34f0f5ad5ce0adc Mon Sep 17 00:00:00 2001
  2. From: Arend Van Spriel <arend.vanspriel@broadcom.com>
  3. Date: Fri, 26 May 2017 13:02:55 +0200
  4. Subject: [PATCH] brcmfmac: fix alignment configuration on host using 64-bit
  5. DMA
  6. For SDIO the alignment requirement for transfers from device to host
  7. is configured in firmware. This configuration is limited to minimum
  8. of 4-byte alignment. However, this is not correct for platforms using
  9. 64-bit DMA when the minimum alignment should be 8 bytes. This issue
  10. appeared when the ALIGNMENT definition was set according the DMA
  11. configuration. The configuration in firmware was not using that macro
  12. defintion, but a hardcoded value of 4. Hence the driver reported
  13. alignment failures for data coming from the device and causing
  14. transfers to fail.
  15. Fixes: 6e84ab604bde ("brcmfmac: properly align buffers on certain platforms
  16. Reported-by: Hans de Goede <hdegoede@redhat.com>
  17. Tested-by: Hans de Goede <hdegoede@redhat.com>
  18. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
  19. Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
  20. Reviewed-by: Franky Lin <franky.lin@broadcom.com>
  21. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  22. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  23. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  24. ---
  25. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
  26. 1 file changed, 1 insertion(+), 1 deletion(-)
  27. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  28. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  29. @@ -3422,7 +3422,7 @@ static int brcmf_sdio_bus_preinit(struct
  30. /* otherwise, set txglomalign */
  31. value = sdiodev->settings->bus.sdio.sd_sgentry_align;
  32. /* SDIO ADMA requires at least 32 bit alignment */
  33. - value = max_t(u32, value, 4);
  34. + value = max_t(u32, value, ALIGNMENT);
  35. err = brcmf_iovar_data_set(dev, "bus:txglomalign", &value,
  36. sizeof(u32));
  37. }