summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2011-06-09 12:39:33 +0300
committerVarun Colbert <vcolbert@nvidia.com>2011-07-20 16:54:00 -0700
commitdd228608f81dee4ae1e9d35c7221264bd82bd415 (patch)
tree4f6ab840fe6c17481a89d8b5176e44df75631019 /drivers/video/tegra/host
parent25be81288a8513e5af18fa50a21921034b30a70f (diff)
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 <vdumpa@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Tested-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host')
-rw-r--r--drivers/video/tegra/host/nvhost_syncpt.c3
1 files changed, 2 insertions, 1 deletions
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)) {