From: Srinivas Kandagatla Date: Thu, 15 Feb 2018 12:25:10 +0000 (+0000) Subject: dmaengine: qcom: bam_dma: do not write to global regs in remote mode X-Git-Tag: v4.19~1233^2~3^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54eb5e26cbb72ba77588098385bf5f492b8323ae;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 139e9f5..6919f50 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, struct bam_device *bdev = bchan->bdev; u32 maxburst; - if (dir == DMA_DEV_TO_MEM) - maxburst = bchan->slave.src_maxburst; - else - maxburst = bchan->slave.dst_maxburst; + if (!bdev->controlled_remotely) { + if (dir == DMA_DEV_TO_MEM) + maxburst = bchan->slave.src_maxburst; + else + maxburst = bchan->slave.dst_maxburst; - writel_relaxed(maxburst, bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD)); + writel_relaxed(maxburst, + bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD)); + } bchan->reconfigure = 0; }