[Sound-open-firmware] [PATCH] dma: dw: check channel status at stop.

Liam Girdwood liam.r.girdwood at linux.intel.com
Thu Oct 12 23:31:06 CEST 2017


Report an error if channel is still active during stop.

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/drivers/dw-dma.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/drivers/dw-dma.c b/src/drivers/dw-dma.c
index e9d584f..66d0cf5 100644
--- a/src/drivers/dw-dma.c
+++ b/src/drivers/dw-dma.c
@@ -398,17 +398,16 @@ static int dw_dma_stop(struct dma *dma, int channel)
 
 	spin_lock_irq(&dma->lock, flags);
 
-	tracev_dma("DDi");
+	trace_dma("DDi");
 
-	/* has channel already disabled ? */
-	if (!(dw_read(dma, DW_DMA_CHAN_EN) & (0x1 << channel))) {
-		p->chan[channel].status = COMP_STATE_PREPARE;
-		goto out;
+	/* is channel stii active ? */
+	if ((dw_read(dma, DW_DMA_CHAN_EN) & (0x1 << channel))) {
+		trace_dma_error("ea0");
+		trace_value(channel);
 	}
 
 	p->chan[channel].status = COMP_STATE_PREPARE;
 
-out:
 	spin_unlock_irq(&dma->lock, flags);
 	return ret;
 }
-- 
2.11.0



More information about the Sound-open-firmware mailing list