From 142c377d60947cd707cff612f06d9f58b72bb7e3 Mon Sep 17 00:00:00 2001 From: Deepak Goyal Date: Thu, 8 Jan 2015 17:50:02 +0530 Subject: gpu: nvgpu: Fix if/else conds if PMU flag is OFF. bug 200069748 Invalidating FECS code instblk is required only if FECS uses bootloader to load. Added check for same instead of using PMU support to invalidate. Handle elpg enable/disable call in case PMU is OFF. Change-Id: I28abbbbe1f22edd9e0417df9d0e831bbd770502c Signed-off-by: Deepak Goyal Reviewed-on: http://git-master/r/670664 Reviewed-by: Vijayakumar Subbu Tested-by: Vijayakumar Subbu Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Supriya Sharatkumar Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index cffc48f5..d84d4ad5 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -2160,7 +2160,7 @@ static int gr_gk20a_wait_ctxsw_ready(struct gk20a *g) return ret; } - if (support_gk20a_pmu(g->dev)) + if (!(g->gpu_characteristics.arch > NVGPU_GPU_ARCH_GM200)) gk20a_writel(g, gr_fecs_current_ctx_r(), gr_fecs_current_ctx_valid_false_f()); diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 7bcda89f..f2430165 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -1,7 +1,7 @@ /* * GK20A PMU (aka. gPMU outside gk20a context) * - * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -3610,6 +3610,10 @@ int gk20a_pmu_enable_elpg(struct gk20a *g) gk20a_dbg_fn(""); + + if (!support_gk20a_pmu(g->dev)) + return ret; + mutex_lock(&pmu->elpg_mutex); pmu->elpg_refcnt++; @@ -3650,6 +3654,9 @@ int gk20a_pmu_disable_elpg(struct gk20a *g) gk20a_dbg_fn(""); + if (!support_gk20a_pmu(g->dev)) + return ret; + mutex_lock(&pmu->elpg_mutex); pmu->elpg_refcnt--; -- cgit v1.2.2