Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

brcmfmac: fix alignment configuration on host using 64-bit DMA

For SDIO the alignment requirement for transfers from device to host
is configured in firmware. This configuration is limited to minimum
of 4-byte alignment. However, this is not correct for platforms using
64-bit DMA when the minimum alignment should be 8 bytes. This issue
appeared when the ALIGNMENT definition was set according the DMA
configuration. The configuration in firmware was not using that macro
defintion, but a hardcoded value of 4. Hence the driver reported
alignment failures for data coming from the device and causing
transfers to fail.

Fixes: 6e84ab604bde ("brcmfmac: properly align buffers on certain platforms
Reported-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Arend Van Spriel and committed by
Kalle Valo
1dbf647f efad8396

+1 -1
+1 -1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
··· 3422 3422 /* otherwise, set txglomalign */ 3423 3423 value = sdiodev->settings->bus.sdio.sd_sgentry_align; 3424 3424 /* SDIO ADMA requires at least 32 bit alignment */ 3425 - value = max_t(u32, value, 4); 3425 + value = max_t(u32, value, ALIGNMENT); 3426 3426 err = brcmf_iovar_data_set(dev, "bus:txglomalign", &value, 3427 3427 sizeof(u32)); 3428 3428 }