mmc: mmc_spi: remove custom DMA mapped buffers
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 7 Dec 2023 22:19:01 +0000 (00:19 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 2 Jan 2024 16:54:05 +0000 (17:54 +0100)
commit84a6be7db9050dd2601c9870f65eab9a665d2d5d
tree807e10361a18e2ef1462dbce8ce8e5ec032fb876
parentef62548f4a162d1f5096c7a16673081dd72c6f4e
mmc: mmc_spi: remove custom DMA mapped buffers

There is no need to duplicate what SPI core or individual controller
drivers already do, i.e. mapping the buffers for DMA capable transfers.

Note, that the code, besides its redundancy, was buggy: strictly speaking
there is no guarantee, while it's true for those which can use this code
(see below), that the SPI host controller _is_ the device which does DMA.

Also see the Link tags below.

Additional notes. Currently only two SPI host controller drivers may use
premapped (by the user) DMA buffers:

  - drivers/spi/spi-au1550.c

  - drivers/spi/spi-fsl-spi.c

Both of them have DMA mapping support code. I don't expect that SPI host
controller code is worse than what has been done in mmc_spi. Hence I do
not expect any regressions here. Otherwise, I'm pretty much sure these
regressions have to be fixed in the respective drivers, and not here.

That said, remove all related pieces of DMA mapping code from mmc_spi.

Link: https://lore.kernel.org/linux-mmc/c73b9ba9-1699-2aff-e2fd-b4b4f292a3ca@raspberrypi.org/
Link: https://stackoverflow.com/questions/67620728/mmc-spi-issue-not-able-to-setup-mmc-sd-card-in-linux
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20231207221901.3259962-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mmc_spi.c