mmc: sdhci: add support for using external DMA devices
authorChunyan Zhang <zhang.chunyan@linaro.org>
Thu, 16 Jan 2020 10:51:47 +0000 (16:21 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 20 Jan 2020 09:36:11 +0000 (10:36 +0100)
commit18e762e3b7a7be764c50957edd2fa0879cb9c67e
tree4b4508326e8567306039bc7073ede8594487d8b0
parent15db1836918db903794f9ef3d6eb7b80ab09174a
mmc: sdhci: add support for using external DMA devices

Some standard SD host controllers can support both external dma
controllers as well as ADMA/SDMA in which the SD host controller
acts as DMA master. TI's omap controller is the case as an example.

Currently the generic SDHCI code supports ADMA/SDMA integrated in
the host controller but does not have any support for external DMA
controllers implemented using dmaengine, meaning that custom code is
needed for any systems that use an external DMA controller with SDHCI.

Fixes by Faiz Abbas <faiz_abbas@ti.com>:
1. Map scatterlists before dmaengine_prep_slave_sg()
2. Use dma_async() functions inside of the send_command() path and call
terminate_sync() in non-atomic context in case of an error.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20200116105154.7685-4-faiz_abbas@ti.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/Kconfig
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h