Skip to content

Commit 9b81354

Browse files
superna9999Ulf Hansson
authored andcommitted
mmc: meson-gx: also check SD_IO_RW_EXTENDED for scatterlist size alignment
The brcmfmac driver can generate a scatterlist from a skb with each packets not aligned to the block size. This is not supported by the Amlogic Descriptor dma engine where each descriptor must match a multiple of the block size. The sg list is valid, since the sum of the sg buffers is a multiple of the block size, but we must discard those when in SD_IO_RW_EXTENDED mode since SDIO block mode can be used under the hood even with data->blocks == 1. Those transfers are very rare, thus can be replaced by a bounce buffer without real performance loss. Fixes: 7412dee ("mmc: meson-gx: replace WARN_ONCE with dev_warn_once about scatterlist size alignment in block mode") Cc: stable@vger.kernel.org Reported-by: Christian Hewitt <christianshewitt@gmail.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Link: https://lore.kernel.org/r/20210426175559.3110575-2-narmstrong@baylibre.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent cabb1bb commit 9b81354

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ static void meson_mmc_get_transfer_mode(struct mmc_host *mmc,
236236
if (host->dram_access_quirk)
237237
return;
238238

239-
if (data->blocks > 1) {
239+
/* SD_IO_RW_EXTENDED (CMD53) can also use block mode under the hood */
240+
if (data->blocks > 1 || mrq->cmd->opcode == SD_IO_RW_EXTENDED) {
240241
/*
241242
* In block mode DMA descriptor format, "length" field indicates
242243
* number of blocks and there is no way to pass DMA size that

0 commit comments

Comments
 (0)