Skip to content

dai: fix error handling when DMA is stuck - #208

Merged
lgirdwood merged 1 commit into
thesofproject:masterfrom
plbossart:fix/trigger_stop_fail
Aug 8, 2018
Merged

lgirdwood merged 1 commit into
thesofproject:masterfrom
plbossart:fix/trigger_stop_fail

Conversation

@plbossart

Copy link
Copy Markdown
Member

When the DMA is stuck, e.g. in slave mode when the external clock is
not active, the Linux kernel will trigger a stop after a
timeout. Since the DMA will never complete, the current code returns
an IPC error on stop (DMA completion fails) and will not reset DMA
channel status and reference counts.

Force the DMA and DAI to be stopped to solve the problem. We probably
need to look at all error handling since it's likely to be a recurring
issue.

Also simplify the Xrun code, no need for an extra return.

Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com

When the DMA is stuck, e.g. in slave mode when the external clock is
not active, the Linux kernel will trigger a stop after a
timeout. Since the DMA will never complete, the current code returns
an IPC error on stop (DMA completion fails) and will not reset DMA
channel status and reference counts.

Force the DMA and DAI to be stopped to solve the problem. We probably
need to look at all error handling since it's likely to be a recurring
issue.

Also simplify the Xrun code, no need for an extra return.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
plbossart requested review from lgirdwood and tlauda August 7, 2018 21:24
@tlauda

tlauda commented Aug 8, 2018

Copy link
Copy Markdown
Contributor

It looks OK to me, but I just wonder, if maybe we should never wait for the interrupt.
Stopping in the middle of the transfer shouldn't make DMA hang and also for the sake of the future schedule methods, where they won't be based on the DAI interrupts.

@lgirdwood

Copy link
Copy Markdown
Member

@tlauda agree, we can update this to remove the irq wait.

@lgirdwood
lgirdwood merged commit 1cdf8f1 into thesofproject:master Aug 8, 2018
@plbossart

Copy link
Copy Markdown
Member Author

Sorry guys, are you asking for an update but the code was merged already ? Not sure I get the point here.

@lgirdwood

Copy link
Copy Markdown
Member

@plbossart I think the intention is to update incrementally if happy with suggested change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants