aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorAmelie Delaunay <amelie.delaunay@foss.st.com>2022-05-04 18:17:24 +0200
committerVinod Koul <vkoul@kernel.org>2022-05-19 23:43:40 +0530
commitd0b360e3c164be7ccc8eb2bfc341287959e27040 (patch)
tree7ae02f407695e7060935474da0f1e7f085fda9d2 /drivers/dma
parentdmaengine: qcom: gpi: Add support for sc7280 (diff)
downloadlinux-dev-d0b360e3c164be7ccc8eb2bfc341287959e27040.tar.xz
linux-dev-d0b360e3c164be7ccc8eb2bfc341287959e27040.zip
dmaengine: stm32-dmamux: avoid reset of dmamux if used by coprocessor
One of the two DMA controllers managed by the DMAMUX can be used by the coprocessor. It is defined in the device tree with dma-masters. When the two DMA controllers are used by the main CPU, dma-masters = <&dma1, &dma2>; is specified in the device tree. When one of the controllers is used by coprocessor (so not managed by Linux), dma-masters = <&dma1>; is specified in the device tree. In this case, Linux driver must not reset the DMAMUX, because it could have been configured by the coprocessor to use the second DMA controller. count is the number of DMA controllers defined in dma-masters property. Reset only if resets property is found and valid in device tree, and if the two DMA controllers are under Linux control. Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com> Link: https://lore.kernel.org/r/20220504161724.123180-1-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/stm32-dmamux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c
index d5d55732adba..eee0c5aa5fb5 100644
--- a/drivers/dma/stm32-dmamux.c
+++ b/drivers/dma/stm32-dmamux.c
@@ -267,7 +267,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev)
ret = PTR_ERR(rst);
if (ret == -EPROBE_DEFER)
goto err_clk;
- } else {
+ } else if (count > 1) { /* Don't reset if there is only one dma-master */
reset_control_assert(rst);
udelay(2);
reset_control_deassert(rst);