Skip to content

Commit fbb001b

Browse files
committed
dma: fix dma issue on BYT
It is caused by the change of removing dai waiting after stop. dma should not be stopped in dai_comp_trigger if HW LLI is not enable. At this time DMA is still working and it can't be stopped DMA engine would stop the channel automatically after each transfer. So just query channel status to stop dma on BYT Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com> Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
1 parent b9fb774 commit fbb001b

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/drivers/dw-dma.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
#define INT_UNMASK_ALL 0xFFFF
120120
#define CHAN_ENABLE(chan) (0x101 << chan)
121121
#define CHAN_DISABLE(chan) (0x100 << chan)
122+
#define CHAN_MASK(chan) (0x1 << chan)
122123

123124
#define DW_CFG_CH_SUSPEND 0x100
124125
#define DW_CFG_CH_FIFO_EMPTY 0x200
@@ -474,6 +475,31 @@ static int dw_dma_pause(struct dma *dma, int channel)
474475
return 0;
475476
}
476477

478+
#if defined CONFIG_BAYTRAIL || defined CONFIG_CHERRYTRAIL
479+
static int dw_dma_stop(struct dma *dma, int channel)
480+
{
481+
struct dma_pdata *p = dma_get_drvdata(dma);
482+
int ret = 0;
483+
uint32_t flags;
484+
uint32_t val = 0;
485+
486+
spin_lock_irq(&dma->lock, flags);
487+
488+
trace_dma("DDi");
489+
490+
ret = poll_for_register_delay(dma_base(dma) + DW_DMA_CHAN_EN,
491+
CHAN_MASK(channel), val,
492+
PLATFORM_DMA_TIMEOUT);
493+
if (ret < 0)
494+
trace_dma_error("esp");
495+
496+
dw_write(dma, DW_CLEAR_BLOCK, 0x1 << channel);
497+
p->chan[channel].status = COMP_STATE_PREPARE;
498+
499+
spin_unlock_irq(&dma->lock, flags);
500+
return ret;
501+
}
502+
#else
477503
static int dw_dma_stop(struct dma *dma, int channel)
478504
{
479505
struct dma_pdata *p = dma_get_drvdata(dma);
@@ -508,6 +534,7 @@ static int dw_dma_stop(struct dma *dma, int channel)
508534
spin_unlock_irq(&dma->lock, flags);
509535
return ret;
510536
}
537+
#endif
511538

512539
/* fill in "status" with current DMA channel state and position */
513540
static int dw_dma_status(struct dma *dma, int channel,

0 commit comments

Comments
 (0)