diff --git a/src/drivers/dw/dma.c b/src/drivers/dw/dma.c index 14246bde9..1d570256b 100644 --- a/src/drivers/dw/dma.c +++ b/src/drivers/dw/dma.c @@ -228,6 +228,9 @@ static void dw_dma_channel_put_unlocked(struct dma_chan_data *channel) dw_dma_interrupt_mask(channel); + /* disable linear link position */ + platform_dw_dma_llp_disable(channel->dma, channel); + /* free the lli allocated by set_config*/ if (dw_chan->lli) { rfree(dw_chan->lli); @@ -443,9 +446,6 @@ static int dw_dma_stop(struct dma_chan_data *channel) sizeof(struct dw_lli) * channel->desc_count); #endif - /* disable linear link position */ - platform_dw_dma_llp_disable(dma, channel); - channel->status = COMP_STATE_PREPARE; out: diff --git a/src/platform/intel/cavs/include/cavs/drivers/dw-dma.h b/src/platform/intel/cavs/include/cavs/drivers/dw-dma.h index 3c7026ad0..4a48333ac 100644 --- a/src/platform/intel/cavs/include/cavs/drivers/dw-dma.h +++ b/src/platform/intel/cavs/include/cavs/drivers/dw-dma.h @@ -80,8 +80,11 @@ static inline void platform_dw_dma_llp_config(struct dma *dma, static inline void platform_dw_dma_llp_enable(struct dma *dma, struct dma_chan_data *chan) { - shim_write(DW_CHLLPC(dma, chan), - shim_read(DW_CHLLPC(dma, chan)) | SHIM_GPDMA_CHLLPC_EN); + uint32_t val; + + val = shim_read(DW_CHLLPC(dma, chan)); + if (!(val & SHIM_GPDMA_CHLLPC_EN)) + shim_write(DW_CHLLPC(dma, chan), val | SHIM_GPDMA_CHLLPC_EN); } static inline void platform_dw_dma_llp_disable(struct dma *dma,