Skip to content

Commit edef72f

Browse files
RanderWangxiulipan
authored andcommitted
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 a2f0dd0 commit edef72f

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/drivers/intel/dw-dma.c

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

124125
#define DW_CFG_CH_SUSPEND 0x100
125126
#define DW_CFG_CH_FIFO_EMPTY 0x200
@@ -491,6 +492,31 @@ static int dw_dma_pause(struct dma *dma, int channel)
491492
return 0;
492493
}
493494

495+
#if defined CONFIG_BAYTRAIL || defined CONFIG_CHERRYTRAIL
496+
static int dw_dma_stop(struct dma *dma, int channel)
497+
{
498+
struct dma_pdata *p = dma_get_drvdata(dma);
499+
int ret = 0;
500+
uint32_t flags;
501+
uint32_t val = 0;
502+
503+
spin_lock_irq(&dma->lock, flags);
504+
505+
trace_dma("DDi");
506+
507+
ret = poll_for_register_delay(dma_base(dma) + DW_DMA_CHAN_EN,
508+
CHAN_MASK(channel), val,
509+
PLATFORM_DMA_TIMEOUT);
510+
if (ret < 0)
511+
trace_dma_error("esp");
512+
513+
dw_write(dma, DW_CLEAR_BLOCK, 0x1 << channel);
514+
p->chan[channel].status = COMP_STATE_PREPARE;
515+
516+
spin_unlock_irq(&dma->lock, flags);
517+
return ret;
518+
}
519+
#else
494520
static int dw_dma_stop(struct dma *dma, int channel)
495521
{
496522
struct dma_pdata *p = dma_get_drvdata(dma);
@@ -528,6 +554,7 @@ static int dw_dma_stop(struct dma *dma, int channel)
528554
spin_unlock_irq(&dma->lock, flags);
529555
return ret;
530556
}
557+
#endif
531558

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

0 commit comments

Comments
 (0)