dmaengine: rcar-dmac: ensure CHCR DE bit is actually 0 after clearing
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 17 Nov 2017 02:00:28 +0000 (11:00 +0900)
committerVinod Koul <vinod.koul@intel.com>
Wed, 29 Nov 2017 14:12:57 +0000 (19:42 +0530)
commita8d46a7f5d17ca9cbe9e9c7d1d23dc6ea437e141
treedccacc000a57e194a089d4bb2ccc0a693fca0c5f
parent4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323
dmaengine: rcar-dmac: ensure CHCR DE bit is actually 0 after clearing

DMAC reads data from source device, and buffered it until transferable
size for sink device. Because of this behavior, DMAC is including
buffered data .

Now, CHCR DE bit is controlling DMA transfer enable/disable.

If DE bit was cleared during data transferring, or during buffering,
it will flush buffered data if source device was peripheral device
(The buffered data will be removed if source device was memory).
Because of this behavior, driver should ensure that DE bit is actually
0 after clearing.

This patch adds new rcar_dmac_chcr_de_barrier() and call it after CHCR
register access.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Tested-by: Ryo Kodama <ryo.kodama.vz@renesas.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/sh/rcar-dmac.c