Skip to content

Commit e4e409b

Browse files
committed
dai: capture buffer should also be flushed from cache
Writes back capture dma buffer from cache to sram. We stopped to invalidate buffer shared between DMAs, so this change is needed to avoid glitches due to the potential data eviction during cache miss. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
1 parent 20204a9 commit e4e409b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/audio/dai.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,14 +444,16 @@ static int dai_prepare(struct comp_dev *dev)
444444

445445
/* initialise buffers */
446446
if (dev->params.direction == SOF_IPC_STREAM_PLAYBACK) {
447-
448-
/* write back buffer contents from cache for playback */
449447
dma_buffer = list_first_item(&dev->bsource_list,
450448
struct comp_buffer, sink_list);
451-
452-
dcache_writeback_region(dma_buffer->addr, dma_buffer->size);
449+
} else {
450+
dma_buffer = list_first_item(&dev->bsink_list,
451+
struct comp_buffer, source_list);
453452
}
454453

454+
/* write back buffer contents from cache */
455+
dcache_writeback_region(dma_buffer->addr, dma_buffer->size);
456+
455457
/* dma reconfig not required if XRUN handling */
456458
if (dd->xrun) {
457459
/* after prepare, we have recovered from xrun */

0 commit comments

Comments
 (0)