dmaengine: stm32-mdma: check the channel availability (secure or not)
authorAmelie Delaunay <amelie.delaunay@foss.st.com>
Wed, 30 Mar 2022 10:36:45 +0000 (12:36 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 11 Apr 2022 13:28:19 +0000 (18:58 +0530)
commitec834f1cc7cf471b090bb0a6ee077a7bb90a3549
tree58dccce34c99b7c5f7eadbdb8df198f139746ab4
parent105989311442e4d74a0226e555503dd57aa1e896
dmaengine: stm32-mdma: check the channel availability (secure or not)

STM32_MDMA_CCR bit[8] is used to enable Secure Mode (SM). If this bit is
set, it means that all the channel registers are write-protected. So the
channel is not available for Linux use.

Add stm32_mdma_filter_fn() callback filter and give it to
__dma_request_chan (instead of dma_get_any_slave_channel()), to exclude the
channel if it is marked Secure.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20220330103645.99969-1-amelie.delaunay@foss.st.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/stm32-mdma.c