summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2012-01-18 10:25:32 +0200
committerSimone Willett <swillett@nvidia.com>2012-02-21 17:56:36 -0800
commit63cf7a5d8e6a0229cc31826112129ae5d4a09430 (patch)
tree3d5841af08564731e6566e2fd6ae22829feef256
parentb48087f0b7616114f4c9f0236a96d3f0a0d7181c (diff)
video: tegra: host: incr_syncpt should not modify max
When user space calls NvRmChannelSyncPointIncr(), the maximum value of sync point should not be incremented unless sync point is client managed. Also prevents kernel panic if user space tries to increment beyond maximum. Instead, give debug spew and ignore. Bug 936097 Change-Id: I4dc7ed46b1e0394d41066051a47f1d7a1f08493c Reviewed-on: http://git-master/r/79957 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
-rw-r--r--drivers/video/tegra/host/host1x/host1x_syncpt.c6
-rw-r--r--drivers/video/tegra/host/nvhost_syncpt.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/video/tegra/host/host1x/host1x_syncpt.c b/drivers/video/tegra/host/host1x/host1x_syncpt.c
index 622c8e049a7b..663bd0a4d42c 100644
--- a/drivers/video/tegra/host/host1x/host1x_syncpt.c
+++ b/drivers/video/tegra/host/host1x/host1x_syncpt.c
@@ -93,10 +93,10 @@ static void t20_syncpt_cpu_incr(struct nvhost_syncpt *sp, u32 id)
BUG_ON(!nvhost_module_powered(dev->dev));
if (!client_managed(id) && nvhost_syncpt_min_eq_max(sp, id)) {
dev_err(&syncpt_to_dev(sp)->pdev->dev,
- "Syncpoint id %d\n",
- id);
+ "Trying to increment syncpoint id %d beyond max\n",
+ id);
nvhost_debug_dump(syncpt_to_dev(sp));
- BUG();
+ return;
}
writel(BIT(id), dev->sync_aperture + HOST1X_SYNC_SYNCPT_CPU_INCR);
wmb();
diff --git a/drivers/video/tegra/host/nvhost_syncpt.c b/drivers/video/tegra/host/nvhost_syncpt.c
index 04c6e917a84c..7172698e06ca 100644
--- a/drivers/video/tegra/host/nvhost_syncpt.c
+++ b/drivers/video/tegra/host/nvhost_syncpt.c
@@ -113,7 +113,8 @@ void nvhost_syncpt_cpu_incr(struct nvhost_syncpt *sp, u32 id)
*/
void nvhost_syncpt_incr(struct nvhost_syncpt *sp, u32 id)
{
- nvhost_syncpt_incr_max(sp, id, 1);
+ if (client_managed(id))
+ nvhost_syncpt_incr_max(sp, id, 1);
nvhost_module_busy(syncpt_to_dev(sp)->dev);
nvhost_syncpt_cpu_incr(sp, id);
nvhost_module_idle(syncpt_to_dev(sp)->dev);