OSDN Git Service

dmaengine: rcar-dmac: Fix DMACHCLR handling if iommu is mapped
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Mon, 2 Sep 2019 11:44:03 +0000 (20:44 +0900)
committerVinod Koul <vkoul@kernel.org>
Wed, 4 Sep 2019 06:05:58 +0000 (11:35 +0530)
commitcf24aac38698bfa1d021afd3883df3c4c65143a4
treea62efbcfd0a750f1dd8db94426410bd2f50543a0
parent689379c2f383b1fdfdff03e84cf659daf62f2088
dmaengine: rcar-dmac: Fix DMACHCLR handling if iommu is mapped

The commit 20c169aceb45 ("dmaengine: rcar-dmac: clear pertinence
number of channels") forgets to clear the last channel by
DMACHCLR in rcar_dmac_init() (and doesn't need to clear the first
channel) if iommu is mapped to the device. So, this patch fixes it
by using "channels_mask" bitfield.

Note that the hardware and driver don't support more than 32 bits
in DMACHCLR register anyway, so this patch should reject more than
32 channels in rcar_dmac_parse_of().

Fixes: 20c169aceb459575 ("dmaengine: rcar-dmac: clear pertinence number of channels")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/1567424643-26629-1-git-send-email-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/sh/rcar-dmac.c