From dd228608f81dee4ae1e9d35c7221264bd82bd415 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 9 Jun 2011 12:39:33 +0300 Subject: nvhost: Do not crash if wait syncpt > max If user space is waiting for a syncpt value higher than max, nvhost_wait_timeout() panics the kernel. This panic is based on the assumption that nobody should wait for sync points higher than indicated by a submit from user space. As the API has nothing to disallow waiting for future sync points not indicated by any submit, this patch removes the panic and treats this as a normal case. Bug 843238 Change-Id: I367c46e42bd683f1023e7fe04e523a99ab3d666b Reviewed-on: http://git-master/r/36470 Reviewed-by: Krishna Reddy Reviewed-by: Scott Williams Tested-by: Krishna Reddy Reviewed-by: Yu-Huan Hsu --- drivers/video/tegra/host/nvhost_syncpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/tegra/host/nvhost_syncpt.c b/drivers/video/tegra/host/nvhost_syncpt.c index 88059b0f182d..71233096c0c6 100644 --- a/drivers/video/tegra/host/nvhost_syncpt.c +++ b/drivers/video/tegra/host/nvhost_syncpt.c @@ -115,7 +115,8 @@ int nvhost_syncpt_wait_timeout(struct nvhost_syncpt *sp, u32 id, if (value) *value = 0; BUG_ON(!syncpt_op(sp).update_min); - BUG_ON(!nvhost_syncpt_check_max(sp, id, thresh)); + if (!nvhost_syncpt_check_max(sp, id, thresh)) + return -EINVAL; /* first check cache */ if (nvhost_syncpt_min_cmp(sp, id, thresh)) { -- cgit v1.2.3