summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/lpwr/lpwr.c
diff options
context:
space:
mode:
authorDeepak Goyal <dgoyal@nvidia.com>2017-04-19 14:07:05 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-12 13:14:37 -0400
commit5a4926f2918b84fccefb8ddf6dbaa7b6449735bf (patch)
tree792361e78f0e178281db15e675e00d87a6ee0e60 /drivers/gpu/nvgpu/lpwr/lpwr.c
parentd0955cad82c92699965f76c95c87150fbed70d3a (diff)
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 <dgoyal@nvidia.com> Reviewed-on: http://git-master/r/1465816 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/lpwr/lpwr.c')
-rw-r--r--drivers/gpu/nvgpu/lpwr/lpwr.c3
1 files changed, 2 insertions, 1 deletions
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)
337int nvgpu_lpwr_enable_pg(struct gk20a *g, bool pstate_lock) 337int nvgpu_lpwr_enable_pg(struct gk20a *g, bool pstate_lock)
338{ 338{
339 struct pmu_gk20a *pmu = &g->pmu; 339 struct pmu_gk20a *pmu = &g->pmu;
340 struct gk20a_platform *platform = dev_get_drvdata(g->dev);
340 u32 status = 0; 341 u32 status = 0;
341 u32 is_mscg_supported = 0; 342 u32 is_mscg_supported = 0;
342 u32 is_rppg_supported = 0; 343 u32 is_rppg_supported = 0;
@@ -363,7 +364,7 @@ int nvgpu_lpwr_enable_pg(struct gk20a *g, bool pstate_lock)
363 is_rppg_supported = nvgpu_lpwr_is_rppg_supported(g, 364 is_rppg_supported = nvgpu_lpwr_is_rppg_supported(g,
364 present_pstate); 365 present_pstate);
365 if (is_rppg_supported) { 366 if (is_rppg_supported) {
366 if (g->support_pmu && g->elpg_enabled) 367 if (g->support_pmu && platform->can_elpg)
367 status = gk20a_pmu_enable_elpg(g); 368 status = gk20a_pmu_enable_elpg(g);
368 } 369 }
369 370