summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-03-17 12:56:50 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-27 13:48:31 -0400
commitb45a67934faeba042dbf6ebe47c520db3ef4090d (patch)
tree771f8c223a47281da915fee3348167724c332f56 /drivers/gpu/nvgpu/gp10b/gr_gp10b.c
parent0c45c5fcb60810f06b0ae05270f0fa7e32d31869 (diff)
gpu: nvgpu: Use nvgpu_timeout for all loops
There were still a few remaining loops where we did not use nvgpu_timeout and required Tegra specific functions for detecting if timeout should be skipped. Replace all of them with nvgpu_timeout and remove including chip-id.h where possible. FE power mode timeout loop also used wrong delay value. It always waited for the whole max timeout instead of looping with smaller increments. If SEC2 ACR boot fails to halt, we should not try to check ACR result from mailbox. Add an early return for that case. JIRA NVGPU-16 Change-Id: I9f0984250d7d01785755338e39822e6631dcaa5a Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1323227
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 7f43a6ce..cb6ef9c7 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -2041,21 +2041,21 @@ static int gr_gp10b_suspend_contexts(struct gk20a *g,
2041 struct channel_ctx_gk20a *ch_ctx = 2041 struct channel_ctx_gk20a *ch_ctx =
2042 &cilp_preempt_pending_ch->ch_ctx; 2042 &cilp_preempt_pending_ch->ch_ctx;
2043 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx; 2043 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx;
2044 unsigned long end_jiffies = jiffies + 2044 struct nvgpu_timeout timeout;
2045 msecs_to_jiffies(gk20a_get_gr_idle_timeout(g));
2046 2045
2047 gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg | gpu_dbg_intr, 2046 gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg | gpu_dbg_intr,
2048 "CILP preempt pending, waiting %lu msecs for preemption", 2047 "CILP preempt pending, waiting %lu msecs for preemption",
2049 gk20a_get_gr_idle_timeout(g)); 2048 gk20a_get_gr_idle_timeout(g));
2050 2049
2050 nvgpu_timeout_init(g, &timeout, gk20a_get_gr_idle_timeout(g),
2051 NVGPU_TIMER_CPU_TIMER);
2051 do { 2052 do {
2052 if (!gr_ctx->t18x.cilp_preempt_pending) 2053 if (!gr_ctx->t18x.cilp_preempt_pending)
2053 break; 2054 break;
2054 2055
2055 usleep_range(delay, delay * 2); 2056 usleep_range(delay, delay * 2);
2056 delay = min_t(u32, delay << 1, GR_IDLE_CHECK_MAX); 2057 delay = min_t(u32, delay << 1, GR_IDLE_CHECK_MAX);
2057 } while (time_before(jiffies, end_jiffies) 2058 } while (!nvgpu_timeout_expired(&timeout));
2058 || !tegra_platform_is_silicon());
2059 2059
2060 /* If cilp is still pending at this point, timeout */ 2060 /* If cilp is still pending at this point, timeout */
2061 if (gr_ctx->t18x.cilp_preempt_pending) 2061 if (gr_ctx->t18x.cilp_preempt_pending)