Skip to content

Commit 85c7123

Browse files
ADESTMfourmone
authored andcommitted
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. Change-Id: If885e9e49699ea8f68b94526adcfc706e0f19990 Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com> Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/228676 Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com> Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com> Reviewed-by: Fabien DESSENNE <fabien.dessenne@foss.st.com>
1 parent 94249eb commit 85c7123

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/stm32-dmamux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev)
267267
ret = PTR_ERR(rst);
268268
if (ret == -EPROBE_DEFER)
269269
goto err_clk;
270-
} else {
270+
} else if (count > 1) { /* Don't reset if there is only one dma-master */
271271
reset_control_assert(rst);
272272
udelay(2);
273273
reset_control_deassert(rst);

0 commit comments

Comments
 (0)