]> asedeno.scripts.mit.edu Git - linux.git/commit
mmc: tmio: simplify the DMA mode test
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 12 Oct 2018 15:03:08 +0000 (00:03 +0900)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 15 Oct 2018 12:52:50 +0000 (14:52 +0200)
commitd3dd5db0c1b904e71690ef8cfaebd562d8e865b1
treebf15a44ac594b9d85d402df1b7269cd3471603b8
parent722fb61e2ed39473297157839ec7230b77fd6940
mmc: tmio: simplify the DMA mode test

host->chan_{rx,tx} represents the DMA capability of the platform.
Even if DMA is supported, there are cases where we want to use PIO,
for example, data length is short enough as commit 5f52c3552946
("mmc: tmio: use PIO for short transfers") mentioned.

Regarding the hardware control flow, we are interested in whether DMA
is currently enabled or not, instead of whether the platform has the
DMA capability.

Hence, the several conditionals in tmio_mmc_core.c end up with
checking host->chan_{rx,tx} and !host->force_pio. This is not nice.

Let's flip the flag host->force_pio into host->dma_on.

host->dma_on represents whether the DMA is currently enabled or not.
This flag is set false in the beginning of each command, then should
be set true by tmio_mmc_start_dma() when the DMA is turned on.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/renesas_sdhi_internal_dmac.c
drivers/mmc/host/renesas_sdhi_sys_dmac.c
drivers/mmc/host/tmio_mmc.h
drivers/mmc/host/tmio_mmc_core.c
drivers/mmc/host/uniphier-sd.c