From f01e60722d19f1d825dcc6b9c8434df531cb7c57 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 31 Mar 2020 12:42:20 +0200 Subject: [PATCH] DMA: Fix fw panic after release on SdW platforms Bug was caused because sdw controller is stopped first, then DSP is stopped, so DW FIFO will never be consumed, so timeout occurs, and watch dog will reset hardware. Moreover polling for FIFO empty in duch a place should have positive result only when pause take shorten than 1ms what is not reasonable value. Signed-off-by: Karol Trzcinski --- src/drivers/dw/dma.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/drivers/dw/dma.c b/src/drivers/dw/dma.c index 4c6e152af19b..e187f1ca6524 100644 --- a/src/drivers/dw/dma.c +++ b/src/drivers/dw/dma.c @@ -335,32 +335,19 @@ static int dw_dma_start(struct dma_chan_data *channel) static int dw_dma_release(struct dma_chan_data *channel) { struct dw_dma_chan_data *dw_chan = dma_chan_get_data(channel); - struct dma *dma = channel->dma; uint32_t flags; - int ret; trace_dwdma("dw_dma_release(): dma %d channel %d release", channel->dma->plat_data.id, channel->index); irq_local_disable(flags); - /* now we wait for FIFO to be empty */ - ret = poll_for_register_delay(dma_base(dma) + - DW_CFG_LOW(channel->index), - DW_CFGL_FIFO_EMPTY, - DW_CFGL_FIFO_EMPTY, - DW_DMA_TIMEOUT); - /* get next lli for proper release */ dw_chan->lli_current = (struct dw_lli *)dw_chan->lli_current->llp; /* prepare to start */ dw_dma_stop(channel); - if (ret < 0) - trace_dwdma_error("dw_dma_release() error: dma %d channel %d timeout", - dma->plat_data.id, channel->index); - irq_local_enable(flags); return 0;