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>
This commit is contained in:
Deepak Goyal
2017-04-19 23:37:05 +05:30
committed by mobile promotions
parent d0955cad82
commit 5a4926f291
4 changed files with 15 additions and 8 deletions

View File

@@ -3126,6 +3126,7 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c,
struct nvgpu_alloc_obj_ctx_args *args)
{
struct gk20a *g = c->g;
struct gk20a_platform *platform = dev_get_drvdata(g->dev);
struct fifo_gk20a *f = &g->fifo;
struct channel_ctx_gk20a *ch_ctx = &c->ch_ctx;
struct tsg_gk20a *tsg = NULL;
@@ -3280,7 +3281,7 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c,
args->flags |= NVGPU_ALLOC_OBJ_FLAGS_LOCKBOOST_ZERO;
if (g->support_pmu)
if (g->support_pmu && platform->can_elpg)
gk20a_pmu_enable_elpg(g);
}