Skip to content

Commit

Permalink
dmaengine: stm32-dma: clean channel configuration when channel is freed
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
ADESTM authored and vinodkoul committed Dec 11, 2020
1 parent a44d9d7 commit 5d4d4df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/dma/stm32-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5d4d4df

Please sign in to comment.