diff options
author | Deepak Goyal <dgoyal@nvidia.com> | 2017-04-19 14:07:05 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-05-12 13:14:37 -0400 |
commit | 5a4926f2918b84fccefb8ddf6dbaa7b6449735bf (patch) | |
tree | 792361e78f0e178281db15e675e00d87a6ee0e60 /drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |
parent | d0955cad82c92699965f76c95c87150fbed70d3a (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/gk20a/pmu_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 26ce66f1..af22b13f 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -4936,6 +4936,7 @@ clean_up: | |||
4936 | int gk20a_pmu_pg_global_enable(struct gk20a *g, u32 enable_pg) | 4936 | int gk20a_pmu_pg_global_enable(struct gk20a *g, u32 enable_pg) |
4937 | { | 4937 | { |
4938 | u32 status = 0; | 4938 | u32 status = 0; |
4939 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | ||
4939 | 4940 | ||
4940 | if (enable_pg == true) { | 4941 | if (enable_pg == true) { |
4941 | if (g->ops.pmu.pmu_pg_engines_feature_list && | 4942 | if (g->ops.pmu.pmu_pg_engines_feature_list && |
@@ -4945,7 +4946,7 @@ int gk20a_pmu_pg_global_enable(struct gk20a *g, u32 enable_pg) | |||
4945 | if (g->ops.pmu.pmu_lpwr_enable_pg) | 4946 | if (g->ops.pmu.pmu_lpwr_enable_pg) |
4946 | status = g->ops.pmu.pmu_lpwr_enable_pg(g, | 4947 | status = g->ops.pmu.pmu_lpwr_enable_pg(g, |
4947 | true); | 4948 | true); |
4948 | } else if (g->support_pmu) | 4949 | } else if (g->support_pmu && platform->can_elpg) |
4949 | status = gk20a_pmu_enable_elpg(g); | 4950 | status = gk20a_pmu_enable_elpg(g); |
4950 | } else if (enable_pg == false) { | 4951 | } else if (enable_pg == false) { |
4951 | if (g->ops.pmu.pmu_pg_engines_feature_list && | 4952 | if (g->ops.pmu.pmu_pg_engines_feature_list && |
@@ -4955,7 +4956,7 @@ int gk20a_pmu_pg_global_enable(struct gk20a *g, u32 enable_pg) | |||
4955 | if (g->ops.pmu.pmu_lpwr_disable_pg) | 4956 | if (g->ops.pmu.pmu_lpwr_disable_pg) |
4956 | status = g->ops.pmu.pmu_lpwr_disable_pg(g, | 4957 | status = g->ops.pmu.pmu_lpwr_disable_pg(g, |
4957 | true); | 4958 | true); |
4958 | } else if (g->support_pmu) | 4959 | } else if (g->support_pmu && platform->can_elpg) |
4959 | status = gk20a_pmu_disable_elpg(g); | 4960 | status = gk20a_pmu_disable_elpg(g); |
4960 | } | 4961 | } |
4961 | 4962 | ||