Skip to content

Commit

Permalink
dw-dma: clear block/transfer irq after stop
Browse files Browse the repository at this point in the history
Clears block/transfer interrupts after stopping the
DMA channel. It prevents sudden interrupt trigger
after enabling different DMA channel than the one
previously stopped.

Signed-off-by: Tomasz Lauda <[email protected]>
  • Loading branch information
tlauda authored and jajanusz committed Apr 25, 2019
1 parent 5d49c72 commit 433de9f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/drivers/dw/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,13 +480,19 @@ static int dw_dma_stop(struct dma *dma, int channel)
dw_dma_interrupt_unregister(dma, channel);

#if CONFIG_HW_LLI
/* clear block interrupt */
dw_write(dma, DW_CLEAR_BLOCK, DW_CHAN(channel));

for (i = 0; i < chan->desc_count; i++) {
lli->ctrl_hi &= ~DW_CTLH_DONE(1);
lli++;
}

dcache_writeback_region(chan->lli,
sizeof(struct dw_lli) * chan->desc_count);
#else
/* clear transfer interrupt */
dw_write(dma, DW_CLEAR_TFR, DW_CHAN(channel));
#endif

chan->status = COMP_STATE_PREPARE;
Expand Down

0 comments on commit 433de9f

Please sign in to comment.