summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2011-11-01 08:50:37 +0200
committerVarun Colbert <vcolbert@nvidia.com>2011-11-07 13:50:40 -0800
commitbd33af9a86f9a276034e6cb6bddd6aa8cce1f89a (patch)
treebd7518fc8152f7a811c30b1d08ed687a2e45cbfd /drivers/video/tegra/host
parent2622e4b4b82b25dc5e71426984f41794055641bf (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 Reviewed-on: http://git-master/r/61412 (cherry picked from commit 5b13d80dc21855c52f53a67471453ea6e95e61f9) Change-Id: Id4bab93ccc4eff22d2dd3a49b8c7df6cac95bff3 Reviewed-on: http://git-master/r/62367 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@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.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);