diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2012-04-12 14:28:40 +0300 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-05-17 06:30:39 -0700 |
commit | f33b459acd29eba5c1e3050175aac259c41803fa (patch) | |
tree | f564554adb2b799859b14320ca21acd8d3dfdc9f /drivers/video/tegra/host | |
parent | 1aed8b0aad50077c193beee5be4174a23a2f46d9 (diff) |
video: tegra: host: Do not panic on hardware timeout
nvhost panics if hardware does not respond within 30 seconds. Remove
this behavior, as it causes problems in emulation and simulation.
Panic should be used only to prevent corruption.
Submits are now given a default timeout of 30 seconds. The clients
can still override with their own timeout value.
MPE doesn't provide the number of slots for context save/restore.
This information is needed to be able to use the submit timeout for
MPE.
Bug 982946
Change-Id: I0f54d639df0fb726cc3163b317bf9c90bf56798b
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/100246
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host')
-rw-r--r-- | drivers/video/tegra/host/bus_client.c | 1 | ||||
-rw-r--r-- | drivers/video/tegra/host/mpe/mpe.c | 2 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_syncpt.c | 6 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_syncpt.h | 1 |
4 files changed, 6 insertions, 4 deletions
diff --git a/drivers/video/tegra/host/bus_client.c b/drivers/video/tegra/host/bus_client.c index 9a32e5333d08..4aacde958954 100644 --- a/drivers/video/tegra/host/bus_client.c +++ b/drivers/video/tegra/host/bus_client.c @@ -140,6 +140,7 @@ static int nvhost_channelopen(struct inode *inode, struct file *filp) priv->priority = NVHOST_PRIORITY_MEDIUM; priv->clientid = atomic_add_return(1, &nvhost_get_host(ch->dev)->clientid); + priv->timeout = MAX_STUCK_CHECK_COUNT * SYNCPT_CHECK_PERIOD; priv->job = nvhost_job_alloc(ch, priv->hwctx, &priv->hdr, NULL, priv->priority, priv->clientid); diff --git a/drivers/video/tegra/host/mpe/mpe.c b/drivers/video/tegra/host/mpe/mpe.c index 2b0001058406..f155183613cd 100644 --- a/drivers/video/tegra/host/mpe/mpe.c +++ b/drivers/video/tegra/host/mpe/mpe.c @@ -460,6 +460,7 @@ static struct nvhost_hwctx *ctxmpe_alloc(struct nvhost_hwctx_handler *h, ctx->hwctx.valid = false; ctx->save_incrs = 3; ctx->save_thresh = 2; + ctx->save_slots = p->save_slots; ctx->restore_phys = nvmap_pin(nvmap, ctx->restore); ctx->restore_size = restore_size; ctx->restore_incrs = 1; @@ -566,6 +567,7 @@ struct nvhost_hwctx_handler *nvhost_mpe_ctxhandler_init( } p->save_phys = nvmap_pin(nvmap, p->save_buf); + p->save_slots = 1; setup_save(p, save_ptr); diff --git a/drivers/video/tegra/host/nvhost_syncpt.c b/drivers/video/tegra/host/nvhost_syncpt.c index 93068ec7a4d2..4835d22881b8 100644 --- a/drivers/video/tegra/host/nvhost_syncpt.c +++ b/drivers/video/tegra/host/nvhost_syncpt.c @@ -26,7 +26,6 @@ #include "nvhost_acm.h" #include "dev.h" -#define MAX_STUCK_CHECK_COUNT 15 #define MAX_SYNCPT_LENGTH 5 /* Name of sysfs node for min and max value */ static const char *min_name = "min"; @@ -205,20 +204,19 @@ int nvhost_syncpt_wait_timeout(struct nvhost_syncpt *sp, u32 id, } if (timeout != NVHOST_NO_TIMEOUT) timeout -= check; - if (timeout) { + if (timeout && check_count <= MAX_STUCK_CHECK_COUNT) { dev_warn(&syncpt_to_dev(sp)->dev->dev, "%s: syncpoint id %d (%s) stuck waiting %d, timeout=%d\n", current->comm, id, syncpt_op().name(sp, id), thresh, timeout); syncpt_op().debug(sp); - if (check_count > MAX_STUCK_CHECK_COUNT) { + if (check_count == MAX_STUCK_CHECK_COUNT) { if (low_timeout) { dev_warn(&syncpt_to_dev(sp)->dev->dev, "is timeout %d too low?\n", low_timeout); } nvhost_debug_dump(syncpt_to_dev(sp)); - BUG(); } check_count++; } diff --git a/drivers/video/tegra/host/nvhost_syncpt.h b/drivers/video/tegra/host/nvhost_syncpt.h index 048eeb96ac2b..7625905bfa9c 100644 --- a/drivers/video/tegra/host/nvhost_syncpt.h +++ b/drivers/video/tegra/host/nvhost_syncpt.h @@ -57,6 +57,7 @@ void nvhost_syncpt_deinit(struct nvhost_syncpt *); #define client_managed(id) (BIT(id) & sp->client_managed) #define syncpt_to_dev(sp) container_of(sp, struct nvhost_master, syncpt) #define SYNCPT_CHECK_PERIOD (2 * HZ) +#define MAX_STUCK_CHECK_COUNT 15 /** * Updates the value sent to hardware. |