]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: sh: rcar-dmac: Fix glitch in dmaengine_tx_status
authorAchim Dahlhoff <Achim.Dahlhoff@de.bosch.com>
Fri, 12 Apr 2019 05:29:14 +0000 (07:29 +0200)
committerVinod Koul <vkoul@kernel.org>
Tue, 23 Apr 2019 05:15:34 +0000 (10:45 +0530)
commit52a68822f4e1afa7d3131577c85661174b8c9c83
tree413646631eb6d319927011131f58b0169fa51513
parent70b4b2ff50670aec32b8fab12dcdcf5f46559c7c
dmaengine: sh: rcar-dmac: Fix glitch in dmaengine_tx_status

The tx_status poll in the rcar_dmac driver reads the status register
which indicates which chunk is busy (DMACHCRB). Afterwards the point
inside the chunk is read from DMATCRB. It is possible that the chunk
has changed between the two reads. The result is a non-monotonous
increase of the residue. Fix this by introducing a 'safe read' logic.

Fixes: 6cb7d91d3be7 ("dmaengine: rcar-dmac: use TCRB instead of TCR for residue")
Signed-off-by: Achim Dahlhoff <Achim.Dahlhoff@de.bosch.com>
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: <stable@vger.kernel.org> # v4.16+
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/sh/rcar-dmac.c