summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/nvhost_syncpt.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2011-11-01 08:50:37 +0200
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:52 -0800
commitf7d616f300a2707f0f0ff99f393cc38f037037ea (patch)
tree8272152bd0ced39125c408b0fd135cf0472fc9b3 /drivers/video/tegra/host/nvhost_syncpt.c
parentd1a2d45c505b5a21eb1e5fdcc131f5e8e9cc8240 (diff)
video: tegra: host: Increase syncpt stuck loop count
Increase minimum loop count when checking for stuck syncpoint, before triggering debug_dump()->BUG_ON(), to account for some lengthy context-save operations. Now increased to 15 loops * 2s wait (SYNCPT_CHECK_PERIOD) per loop. (Wait per loop may be less depending on user-specified timeout for nvhost_syncpt_wait_timeout().) Bug 834337 Change-Id: I1029b6359c1bb8e08f389c211641798fefa92d75 Reviewed-on: http://git-master/r/61412 Tested-by: Gerrit_Virtual_Submit (cherry picked from commit 5b13d80dc21855c52f53a67471453ea6e95e61f9) Reviewed-on: http://git-master/r/62370 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Rebase-Id: Rfcf833e15c597a5684a3d44e923d64ef12ec4b5a
Diffstat (limited to 'drivers/video/tegra/host/nvhost_syncpt.c')
-rw-r--r--drivers/video/tegra/host/nvhost_syncpt.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/video/tegra/host/nvhost_syncpt.c b/drivers/video/tegra/host/nvhost_syncpt.c
index 672841f22e5c..5207c0a2d810 100644
--- a/drivers/video/tegra/host/nvhost_syncpt.c
+++ b/drivers/video/tegra/host/nvhost_syncpt.c
@@ -24,6 +24,7 @@
#include "nvhost_syncpt.h"
#include "dev.h"
+#define MAX_STUCK_CHECK_COUNT 15
/**
* Resets syncpoint and waitbase values to sw shadows
@@ -126,7 +127,7 @@ int nvhost_syncpt_wait_timeout(struct nvhost_syncpt *sp, u32 id,
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
void *ref;
void *waiter;
- int err = 0;
+ int err = 0, check_count = 0, low_timeout = 0;
if (value)
*value = 0;
@@ -197,14 +198,28 @@ int nvhost_syncpt_wait_timeout(struct nvhost_syncpt *sp, u32 id,
err = remain;
break;
}
- if (timeout != NVHOST_NO_TIMEOUT)
+ if (timeout != NVHOST_NO_TIMEOUT) {
+ if (timeout < SYNCPT_CHECK_PERIOD) {
+ /* Caller-specified timeout may be impractically low */
+ low_timeout = timeout;
+ }
timeout -= check;
+ }
if (timeout) {
dev_warn(&syncpt_to_dev(sp)->pdev->dev,
"%s: syncpoint id %d (%s) stuck waiting %d, timeout=%d\n",
current->comm, id, syncpt_op(sp).name(sp, id),
thresh, timeout);
syncpt_op(sp).debug(sp);
+ if (check_count > MAX_STUCK_CHECK_COUNT) {
+ if (low_timeout) {
+ dev_warn(&syncpt_to_dev(sp)->pdev->dev,
+ "is timeout %d too low?\n", low_timeout);
+ }
+ nvhost_debug_dump(syncpt_to_dev(sp));
+ BUG();
+ }
+ check_count++;
}
}
nvhost_intr_put_ref(&(syncpt_to_dev(sp)->intr), ref);