diff options
author | Chris Fries <C.Fries@motorola.com> | 2010-12-04 21:49:46 -0600 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2012-03-21 22:12:58 -0700 |
commit | 38dbb7e2e394475ae6c8b3beb28b38c888c739f5 (patch) | |
tree | f027d5f9b5732526e1b1ce43af6786d8088ab86f /arch/arm/mach-tegra/tegra_i2s_audio.c | |
parent | 3719a40a03ecd15aa858a27ac46027610545b4e2 (diff) |
[ARM] tegra: spdif/i2s audio: fixes
-- release can take a long time
Releasing the out file handles can take a long time, because
we wait for a stop completion that may never arrive.
-- fix possible dma list corruption
If things have gone wrong and a "wait_till_stopped()" times
out, prevent list corrption in the DMA by dequeing any
queued requests.
Signed-off-by: Iliyan Malchev <malchev@google.com>
Rebase-Id: R7ad735afdb6205e984bf8ac5bb2e314e0fd11eba
Diffstat (limited to 'arch/arm/mach-tegra/tegra_i2s_audio.c')
-rw-r--r-- | arch/arm/mach-tegra/tegra_i2s_audio.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/tegra_i2s_audio.c b/arch/arm/mach-tegra/tegra_i2s_audio.c index c36fe3b5671f..56857beae63a 100644 --- a/arch/arm/mach-tegra/tegra_i2s_audio.c +++ b/arch/arm/mach-tegra/tegra_i2s_audio.c @@ -690,12 +690,17 @@ static void request_stop_nosync(struct audio_stream *as) pr_debug("%s\n", __func__); if (!as->stop) { as->stop = true; - wait_till_stopped(as); + if (pending_buffer_requests(as)) + wait_till_stopped(as); for (i = 0; i < as->num_bufs; i++) { init_completion(&as->comp[i]); complete(&as->comp[i]); } } + if (!tegra_dma_is_empty(as->dma_chan)) + pr_err("%s: DMA not empty!\n", __func__); + /* Stop the DMA then dequeue anything that's in progress. */ + tegra_dma_cancel(as->dma_chan); as->active = false; /* applies to recording only */ pr_debug("%s: done\n", __func__); } |