Commit 27a5e7d3 authored by Neil Armstrong's avatar Neil Armstrong Committed by Ulf Hansson

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: default avatarArt Nikpal <art@khadas.com>
Reported-by: default avatarChristian Hewitt <christianshewitt@gmail.com>
Fixes: acdc8e71 ("mmc: meson-gx: add dram-access-quirk")
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Reviewed-by: default avatarKevin Hilman <khilman@baylibre.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200608084458.32014-1-narmstrong@baylibre.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent b3a9e3b9
...@@ -1146,9 +1146,11 @@ static int meson_mmc_probe(struct platform_device *pdev) ...@@ -1146,9 +1146,11 @@ static int meson_mmc_probe(struct platform_device *pdev)
mmc->caps |= MMC_CAP_CMD23; mmc->caps |= MMC_CAP_CMD23;
if (host->dram_access_quirk) { if (host->dram_access_quirk) {
/* Limit segments to 1 due to low available sram memory */
mmc->max_segs = 1;
/* Limit to the available sram memory */ /* Limit to the available sram memory */
mmc->max_segs = SD_EMMC_SRAM_DATA_BUF_LEN / mmc->max_blk_size; mmc->max_blk_count = SD_EMMC_SRAM_DATA_BUF_LEN /
mmc->max_blk_count = mmc->max_segs; mmc->max_blk_size;
} else { } else {
mmc->max_blk_count = CMD_CFG_LENGTH_MASK; mmc->max_blk_count = CMD_CFG_LENGTH_MASK;
mmc->max_segs = SD_EMMC_DESC_BUF_LEN / mmc->max_segs = SD_EMMC_DESC_BUF_LEN /
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment