mmc: mmci: stm32: use a buffer for unaligned DMA requests
authorYann Gautier <yann.gautier@foss.st.com>
Mon, 28 Mar 2022 14:51:14 +0000 (16:51 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 26 Apr 2022 12:05:18 +0000 (14:05 +0200)
commit970dc9c11a17994ab878016b536612ab00d1441d
tree96ca797e1d0118c8325dbd3f81f39e8925386558
parented9ab884987bf80e015f0531e10ad1c1af978e09
mmc: mmci: stm32: use a buffer for unaligned DMA requests

In SDIO mode, the sg list for requests can be unaligned with what the
STM32 SDMMC internal DMA can support. In that case, instead of failing,
use a temporary bounce buffer to copy from/to the sg list.
This buffer is limited to 1MB. But for that we need to also limit
max_req_size to 1MB. It has not shown any throughput penalties for
SD-cards or eMMC.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Link: https://lore.kernel.org/r/20220328145114.334577-1-yann.gautier@foss.st.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mmci_stm32_sdmmc.c