summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
diff options
context:
space:
mode:
authorCory Perry <cperry@nvidia.com>2016-05-19 21:45:22 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:16 -0500
commit9564aa4abb5faa5cc46cd66bf7d00d1f457828c1 (patch)
tree67d46015fdbcd3a6293095a8c4f7d3520a1aef69 /drivers/gpu/nvgpu/gp10b/gr_gp10b.c
parent642cc7416ebcf0d1e7b813a1cc67d48d58004297 (diff)
gpu: nvgpu: Fix timeout error in suspend_contexts
* Moving jiffy counter after preemption work to more accurately and fairly give time for preemption to complete. * Add debug information to coordinate waiting. * Check if cilp is still pending before returning the timedout error. Bug 1700310 Change-Id: Ic16bb3b11f2cd5aea9a5a85b5e0d9927732a065c Signed-off-by: Cory Perry <cperry@nvidia.com> Reviewed-on: http://git-master/r/1151907 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 86cc0555..205d2c97 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -1953,8 +1953,6 @@ static int gr_gp10b_suspend_contexts(struct gk20a *g,
1953 struct dbg_session_gk20a *dbg_s, 1953 struct dbg_session_gk20a *dbg_s,
1954 int *ctx_resident_ch_fd) 1954 int *ctx_resident_ch_fd)
1955{ 1955{
1956 unsigned long end_jiffies = jiffies +
1957 msecs_to_jiffies(gk20a_get_gr_idle_timeout(g));
1958 u32 delay = GR_IDLE_CHECK_DEFAULT; 1956 u32 delay = GR_IDLE_CHECK_DEFAULT;
1959 bool cilp_preempt_pending = false; 1957 bool cilp_preempt_pending = false;
1960 struct channel_gk20a *cilp_preempt_pending_ch = NULL; 1958 struct channel_gk20a *cilp_preempt_pending_ch = NULL;
@@ -2000,6 +1998,12 @@ static int gr_gp10b_suspend_contexts(struct gk20a *g,
2000 struct channel_ctx_gk20a *ch_ctx = 1998 struct channel_ctx_gk20a *ch_ctx =
2001 &cilp_preempt_pending_ch->ch_ctx; 1999 &cilp_preempt_pending_ch->ch_ctx;
2002 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx; 2000 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx;
2001 unsigned long end_jiffies = jiffies +
2002 msecs_to_jiffies(gk20a_get_gr_idle_timeout(g));
2003
2004 gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg | gpu_dbg_intr,
2005 "CILP preempt pending, waiting %lu msecs for preemption",
2006 gk20a_get_gr_idle_timeout(g));
2003 2007
2004 do { 2008 do {
2005 if (!gr_ctx->t18x.cilp_preempt_pending) 2009 if (!gr_ctx->t18x.cilp_preempt_pending)
@@ -2010,7 +2014,9 @@ static int gr_gp10b_suspend_contexts(struct gk20a *g,
2010 } while (time_before(jiffies, end_jiffies) 2014 } while (time_before(jiffies, end_jiffies)
2011 || !tegra_platform_is_silicon()); 2015 || !tegra_platform_is_silicon());
2012 2016
2013 err = -ETIMEDOUT; 2017 /* If cilp is still pending at this point, timeout */
2018 if (gr_ctx->t18x.cilp_preempt_pending)
2019 err = -ETIMEDOUT;
2014 } 2020 }
2015 2021
2016 *ctx_resident_ch_fd = local_ctx_resident_ch_fd; 2022 *ctx_resident_ch_fd = local_ctx_resident_ch_fd;