summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
diff options
context:
space:
mode:
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;