Skip to content

Commit

Permalink
brcmfmac: properly align buffers on certain platforms with 64 bit DMA
Browse files Browse the repository at this point in the history
Systems with 64 bit DMA at least partially require buffers to be used
for DMA to be 8-byte-aligned. One example is Amlogic Meson GX.
Switching the MMC/SDIO driver for this platform to SG DMA mode
resulted in problems due to unaligned buffers.

Fortunately the brcmfmac driver has a global define for the alignment.
Changing it to 8 fixed the issues with Meson GX.

Suggested-by: Helmut Klein <hgkr.klein@gmail.com>
Tested-by: Helmut Klein <hgkr.klein@gmail.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Heiner Kallweit authored and Kalle Valo committed Apr 13, 2017
1 parent ecd7eb7 commit 6e84ab6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,11 @@ static int qcount[NUMPRIO];
/* Limit on rounding up frames */
static const uint max_roundup = 512;

#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
#define ALIGNMENT 8
#else
#define ALIGNMENT 4
#endif

enum brcmf_sdio_frmtype {
BRCMF_SDIO_FT_NORMAL,
Expand Down

0 comments on commit 6e84ab6

Please sign in to comment.