History

dmaengine: imx-sdma: only restart cyclic channel when enabled

An interrupt for a channel might be pending even after struct dma_device::device_terminate_all has been called. In that case the recently introduced warning message "restart cyclic channel..." triggers and the channel will be restarted. This is not desired as the channel has just been stopped. Only restart the channel when we still have a descriptor set for it (which will be set to NULL in sdma_terminate_all()).

Sascha Hauer committed 4 years ago

Commit 09f7b801 parent 49db68d1 file · +1 −1Browse files

Unified · Split

drivers/dma/imx-sdma.c+1−1
@@ -891,7 +891,7 @@ static void sdma_update_channel_loop(struct sdma_channel *sdmac) · 890 unmodified lines
891 * SDMA stops cyclic channel when DMA request triggers a channel and no SDMA891 * SDMA stops cyclic channel when DMA request triggers a channel and no SDMA
892 * owned buffer is available (i.e. BD_DONE was set too late).892 * owned buffer is available (i.e. BD_DONE was set too late).
893 */893 */
894 if (!is_sdma_channel_enabled(sdmac->sdma, sdmac->channel)) {894 if (sdmac->desc && !is_sdma_channel_enabled(sdmac->sdma, sdmac->channel)) {
895 dev_warn(sdmac->sdma->dev, "restart cyclic channel %d\n", sdmac->channel);895 dev_warn(sdmac->sdma->dev, "restart cyclic channel %d\n", sdmac->channel);
896 sdma_enable_channel(sdmac->sdma, sdmac->channel);896 sdma_enable_channel(sdmac->sdma, sdmac->channel);
897 }897 }