[ARM] tegra_spdif_audio: add timeout to prevent flush deadlock
authorChris Fries <C.Fries@motorola.com>
Mon, 25 Oct 2010 03:48:17 +0000 (22:48 -0500)
committerIliyan Malchev <malchev@google.com>
Wed, 3 Nov 2010 02:43:33 +0000 (19:43 -0700)
Signed-off-by: Iliyan Malchev <malchev@google.com>
arch/arm/mach-tegra/tegra_i2s_audio.c

index bca3828f3c6a012eb0c8d6a197c226ce72578478..a1bcc90b7519f28f974974517e97adb919947fb9 100644 (file)
@@ -668,8 +668,10 @@ static bool wait_till_stopped(struct audio_stream *as)
 {
        int rc;
        pr_debug("%s: wait for completion\n", __func__);
-       rc = wait_for_completion_interruptible(
-                       &as->stop_completion);
+       rc = wait_for_completion_interruptible_timeout(
+                       &as->stop_completion, HZ);
+       if (!rc)
+               pr_err("%s: wait timed out", __func__);
        allow_suspend(as);
        pr_debug("%s: done: %d\n", __func__, rc);
        return true;