mmc: sdhci: use dma_map_single() instead of flush_cache() before DMA
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 14 Feb 2020 07:40:26 +0000 (16:40 +0900)
committerPeng Fan <peng.fan@nxp.com>
Thu, 20 Feb 2020 07:09:57 +0000 (15:09 +0800)
commit58d8ace12be763351df37cdcf6fdfceb646fb4dd
tree14493161aee3ee512b98effd23fdc982d3f98891
parenta7b2b6cc0aa9294b570a3161a05c6ccf4c0b6e40
mmc: sdhci: use dma_map_single() instead of flush_cache() before DMA

Currently, sdhci_prepare_dma() calls flush_cache() regardless of the
DMA direction.

Actually, cache invalidation is enough when reading data from the device.

This is correctly handled by dma_map_single(), which mimics the DMA-API
in Linux kernel. Drivers can be agnostic which cache operation occurs
behind the scene.

This commit also sanitizes the difference between the virtual address
and the dma address.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/mmc/sdhci.c