summaryrefslogtreecommitdiff
path: root/drivers/media/video
diff options
context:
space:
mode:
authorKaz Fukuoka <kfukuoka@nvidia.com>2011-07-05 18:36:27 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:29 -0800
commitbcee00a3e0de825418c63d5340fbf794100610c3 (patch)
tree499e1790ce12f629f35f524548b8a6d2ef8d5065 /drivers/media/video
parenta0c9b768dcaa1da001d9203dae14c809a488274e (diff)
media: tegra: avp: Fix avp_svc_thread shutdown
Fix the race condition between kthread_stop() and wait. Without this fix, the following message was printed. "avp_svc_thread: timed out while waiting for kthread_stop" bug 840262 bug 836806 Original-Change-Id: I5acf75859e6512923506a3c508f62e7d7ef9a1dc Reviewed-on: http://git-master/r/39736 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rf58fd998c20b6ba03077e0a06cb1ac3d89826f77
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/tegra/avp/avp_svc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/tegra/avp/avp_svc.c b/drivers/media/video/tegra/avp/avp_svc.c
index 715e948918be..37a8ecdf7d0a 100644
--- a/drivers/media/video/tegra/avp/avp_svc.c
+++ b/drivers/media/video/tegra/avp/avp_svc.c
@@ -656,10 +656,14 @@ static int avp_svc_thread(void *data)
DBG(AVP_DBG_TRACE_SVC, "%s: got message\n", __func__);
if (ret == -ECONNRESET || ret == -ENOTCONN) {
+ wait_queue_head_t wq;
+ init_waitqueue_head(&wq);
+
pr_info("%s: AVP seems to be down; "
"wait for kthread_stop\n", __func__);
timeout = msecs_to_jiffies(100);
- timeout = schedule_timeout_interruptible(timeout);
+ timeout = wait_event_interruptible_timeout(wq,
+ kthread_should_stop(), timeout);
if (timeout == 0)
pr_err("%s: timed out while waiting for "
"kthread_stop\n", __func__);