summaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorAmelie Delaunay <amelie.delaunay@st.com>2020-11-20 15:33:18 +0100
committerVinod Koul <vkoul@kernel.org>2020-12-11 21:13:08 +0530
commit5d4d4dfbda18063231a95dea28fdeab148f23301 (patch)
tree690625bf55454041b52c1ec3778bca80b4c9590d /drivers/dma
parenta44d9d72453ea6b064380d4835e712e574e58d9b (diff)
downloadlinux-5d4d4dfbda18063231a95dea28fdeab148f23301.tar.bz2
dmaengine: stm32-dma: clean channel configuration when channel is freed
When dma_channel_release is called, it means that the channel won't be used anymore with the configuration it had. To ensure a future client can safely use the channel after it has been released, clean the configuration done when channel was requested. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Link: https://lore.kernel.org/r/20201120143320.30367-3-amelie.delaunay@st.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/stm32-dma.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index 55a6bd381219..62501e5d9e9d 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -1220,6 +1220,8 @@ static void stm32_dma_free_chan_resources(struct dma_chan *c)
pm_runtime_put(dmadev->ddev.dev);
vchan_free_chan_resources(to_virt_chan(c));
+ stm32_dma_clear_reg(&chan->chan_reg);
+ chan->threshold = 0;
}
static void stm32_dma_desc_free(struct virt_dma_desc *vdesc)