Skip to content

Commit 27a5e7d

Browse files
superna9999storulf
authored andcommitted
mmc: meson-gx: limit segments to 1 when dram-access-quirk is needed
The actual max_segs computation leads to failure while using the broadcom sdio brcmfmac/bcmsdh driver, since the driver tries to make usage of scatter gather. But with the dram-access-quirk we use a 1,5K SRAM bounce buffer, and the max_segs current value of 3 leads to max transfers to 4,5k, which doesn't work. This patch sets max_segs to 1 to better describe the hardware limitation, and fix the SDIO functionality with the brcmfmac/bcmsdh driver on Amlogic G12A/G12B SoCs on boards like SEI510 or Khadas VIM3. Reported-by: Art Nikpal <[email protected]> Reported-by: Christian Hewitt <[email protected]> Fixes: acdc8e7 ("mmc: meson-gx: add dram-access-quirk") Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Kevin Hilman <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent b3a9e3b commit 27a5e7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/mmc/host/meson-gx-mmc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,9 +1146,11 @@ static int meson_mmc_probe(struct platform_device *pdev)
11461146

11471147
mmc->caps |= MMC_CAP_CMD23;
11481148
if (host->dram_access_quirk) {
1149+
/* Limit segments to 1 due to low available sram memory */
1150+
mmc->max_segs = 1;
11491151
/* Limit to the available sram memory */
1150-
mmc->max_segs = SD_EMMC_SRAM_DATA_BUF_LEN / mmc->max_blk_size;
1151-
mmc->max_blk_count = mmc->max_segs;
1152+
mmc->max_blk_count = SD_EMMC_SRAM_DATA_BUF_LEN /
1153+
mmc->max_blk_size;
11521154
} else {
11531155
mmc->max_blk_count = CMD_CFG_LENGTH_MASK;
11541156
mmc->max_segs = SD_EMMC_DESC_BUF_LEN /

0 commit comments

Comments
 (0)