From 5a4926f2918b84fccefb8ddf6dbaa7b6449735bf Mon Sep 17 00:00:00 2001 From: Deepak Goyal Date: Wed, 19 Apr 2017 23:37:05 +0530 Subject: gpu: nvgpu: pmu: add check before enabling elpg. Do not enable/disable elpg if platform->can_elpg is false. Bug 1870556 Change-Id: I82d1fc4efdccc518827a6150fd3c17f6112e2f4a Signed-off-by: Deepak Goyal Reviewed-on: http://git-master/r/1465816 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/lpwr/lpwr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/lpwr/lpwr.c') diff --git a/drivers/gpu/nvgpu/lpwr/lpwr.c b/drivers/gpu/nvgpu/lpwr/lpwr.c index 1f15d512..8fa92b62 100644 --- a/drivers/gpu/nvgpu/lpwr/lpwr.c +++ b/drivers/gpu/nvgpu/lpwr/lpwr.c @@ -337,6 +337,7 @@ u32 nvgpu_lpwr_is_rppg_supported(struct gk20a *g, u32 pstate_num) int nvgpu_lpwr_enable_pg(struct gk20a *g, bool pstate_lock) { struct pmu_gk20a *pmu = &g->pmu; + struct gk20a_platform *platform = dev_get_drvdata(g->dev); u32 status = 0; u32 is_mscg_supported = 0; u32 is_rppg_supported = 0; @@ -363,7 +364,7 @@ int nvgpu_lpwr_enable_pg(struct gk20a *g, bool pstate_lock) is_rppg_supported = nvgpu_lpwr_is_rppg_supported(g, present_pstate); if (is_rppg_supported) { - if (g->support_pmu && g->elpg_enabled) + if (g->support_pmu && platform->can_elpg) status = gk20a_pmu_enable_elpg(g); } -- cgit v1.2.2