gpu: nvgpu: use support_ls_pmu flag to check LS PMU support

Currently PMU support enable check is done with multiple
methods which added complexity to know status of PMU
support.

Changed to replace multiple methods with support_pmu
flag to know the PMU support, support_pmu will be updated
at init stage based on platform/chip specific settings
to know the PMU support status.

Cleaned up support_pmu flag check with platform specific
PMU members in multiple places & moved check to
public functions

JIRA NVGPU-173

Change-Id: Ief2c64250d1f78e3b054203be56499e4d1d9b046
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2024024
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Mahantesh Kumbar
2019-02-20 22:43:01 +05:30
committed by mobile promotions
parent e7c9a5309c
commit 4bb9b0b987
14 changed files with 160 additions and 152 deletions

View File

@@ -88,7 +88,7 @@ int gk20a_prepare_poweroff(struct gk20a *g)
}
/* disable elpg before gr or fifo suspend */
if (g->ops.pmu.is_pmu_supported(g)) {
if (g->support_ls_pmu) {
ret |= nvgpu_pmu_destroy(g);
}
@@ -179,12 +179,10 @@ int gk20a_finalize_poweron(struct gk20a *g)
goto done_gsp;
}
if (g->ops.pmu.is_pmu_supported(g)) {
err = nvgpu_early_init_pmu_sw(g, &g->pmu);
if (err != 0) {
nvgpu_err(g, "failed to early init pmu sw");
goto done;
}
err = nvgpu_early_init_pmu_sw(g, &g->pmu);
if (err != 0) {
nvgpu_err(g, "failed to early init pmu sw");
goto done;
}
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_SEC2_RTOS)) {
@@ -336,13 +334,11 @@ int gk20a_finalize_poweron(struct gk20a *g)
}
}
if (g->ops.pmu.is_pmu_supported(g)) {
err = nvgpu_init_pmu_support(g);
if (err != 0) {
nvgpu_err(g, "failed to init gk20a pmu");
nvgpu_mutex_release(&g->tpc_pg_lock);
goto done;
}
err = nvgpu_init_pmu_support(g);
if (err != 0) {
nvgpu_err(g, "failed to init gk20a pmu");
nvgpu_mutex_release(&g->tpc_pg_lock);
goto done;
}
err = gk20a_init_gr_support(g);