aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/qcom
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2018-02-15 07:25:10 -0500
committerVinod Koul <vinod.koul@intel.com>2018-03-01 03:44:27 -0500
commit54eb5e26cbb72ba77588098385bf5f492b8323ae (patch)
treeeb61c2108418587b6027ca42a1f5d043853d71bd /drivers/dma/qcom
parent48d163b1aa6e7f650c0b7a4f9c61c387a6def868 (diff)
dmaengine: qcom: bam_dma: do not write to global regs in remote mode
BAM_DESC_CNT_TRSHLD register is global register, which can only be written when BAM is in master mode, So check the mode of operation before writing it. Without this check SOC's xPU would catch such access and crash the system. First noticed on DB820c while testing SLIMBus BAM. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/qcom')
-rw-r--r--drivers/dma/qcom/bam_dma.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 139e9f5e47a9..6919f501b9f3 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -935,12 +935,15 @@ static void bam_apply_new_config(struct bam_chan *bchan,
935 struct bam_device *bdev = bchan->bdev; 935 struct bam_device *bdev = bchan->bdev;
936 u32 maxburst; 936 u32 maxburst;
937 937
938 if (dir == DMA_DEV_TO_MEM) 938 if (!bdev->controlled_remotely) {
939 maxburst = bchan->slave.src_maxburst; 939 if (dir == DMA_DEV_TO_MEM)
940 else 940 maxburst = bchan->slave.src_maxburst;
941 maxburst = bchan->slave.dst_maxburst; 941 else
942 maxburst = bchan->slave.dst_maxburst;
942 943
943 writel_relaxed(maxburst, bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD)); 944 writel_relaxed(maxburst,
945 bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
946 }
944 947
945 bchan->reconfigure = 0; 948 bchan->reconfigure = 0;
946} 949}