[ARM] tegra_i2s_audio: add timeout to prevent flush deadlock
Chris Fries [Mon, 25 Oct 2010 03:48:17 +0000 (22:48 -0500)]
Signed-off-by: Iliyan Malchev <malchev@google.com>

arch/arm/mach-tegra/tegra_spdif_audio.c

index 9c6ae5b..3764edf 100644 (file)
@@ -478,7 +478,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\n", __func__);
        allow_suspend(as);
        pr_debug("%s: done: %d\n", __func__, rc);
        return true;