dma: dw: allow to stop in DW_DMA_SUSPENDED state

Allow DMA channel to be stopped even if it is in suspended state.
The current code in dw_dma_stop() supports this, but the recently
added early check for dw_dma_is_enabled() results in DMA stop
sequence to be skipped if the channel was in suspended state.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2023-02-16 15:31:16 +02:00 committed by Anas Nashif
commit 0c0d73721e

View file

@ -525,7 +525,7 @@ int dw_dma_stop(const struct device *dev, uint32_t channel)
goto out;
}
if (!dw_dma_is_enabled(dev, channel)) {
if (!dw_dma_is_enabled(dev, channel) && chan_data->state != DW_DMA_SUSPENDED) {
goto out;
}