提交 54eb5e26 编写于 作者: S Srinivas Kandagatla 提交者: Vinod Koul

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: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 48d163b1
...@@ -935,12 +935,15 @@ static void bam_apply_new_config(struct bam_chan *bchan, ...@@ -935,12 +935,15 @@ static void bam_apply_new_config(struct bam_chan *bchan,
struct bam_device *bdev = bchan->bdev; struct bam_device *bdev = bchan->bdev;
u32 maxburst; u32 maxburst;
if (dir == DMA_DEV_TO_MEM) if (!bdev->controlled_remotely) {
maxburst = bchan->slave.src_maxburst; if (dir == DMA_DEV_TO_MEM)
else maxburst = bchan->slave.src_maxburst;
maxburst = bchan->slave.dst_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; bchan->reconfigure = 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册