Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/drivers/intel/cavs/hda-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ static int hda_dma_wait_for_buffer_full(struct dma *dma,

while (!(host_dma_reg_read(dma, chan->index, DGCS) & DGCS_BF)) {
if (deadline < platform_timer_get(platform_timer)) {
/* safe check in case we've got preempted after read */
if (host_dma_reg_read(dma, chan->index, DGCS) &
DGCS_BF)
return 0;

trace_hddma_error("hda-dmac: %d wait for buffer full "
"timeout", dma->plat_data.id);
return -ETIME;
Expand All @@ -293,6 +298,11 @@ static int hda_dma_wait_for_buffer_empty(struct dma *dma,

while (host_dma_reg_read(dma, chan->index, DGCS) & DGCS_BNE) {
if (deadline < platform_timer_get(platform_timer)) {
/* safe check in case we've got preempted after read */
if (!(host_dma_reg_read(dma, chan->index, DGCS) &
DGCS_BNE))
return 0;

trace_hddma_error("hda-dmac: %d wait for buffer empty "
"timeout", dma->plat_data.id);
return -ETIME;
Expand Down