]> git.ipfire.org Git - thirdparty/linux.git/commit
mmc: moxart-mmc: Fix accounting in DMA transfer
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 27 Jan 2024 00:19:50 +0000 (01:19 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 13 Feb 2024 12:40:56 +0000 (13:40 +0100)
commit54fd8cd61799673622a0c683e870ee584c713aa7
treec1f5586f55592b9518ded098917dc0efdb824eea
parentbc169ad24308ff3304966af10bea2df9219a0189
mmc: moxart-mmc: Fix accounting in DMA transfer

The whole scatterlist chain is submitted to the DMA engine,
but the code is written to just account for the length of
the first sg entry.

When the DMA transfer is finished, all the data in the
request has been transferred, account for this instead.

This only works because the moxart_request() function isn't
checking that all data was transferred and will
unconditionally issue mmc_request_done() after returning
successfully from moxart_transfer_dma().

Keep the assignment of accounted bytes in .bytes_xfered
but move it after the completion where we know it has
actually happened.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240127-mmc-proper-kmap-v2-3-d8e732aa97d1@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/moxart-mmc.c