diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index d50ae4a80..48dfac995 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -523,11 +523,13 @@ int nvgpu_finalize_poweron(struct gk20a *g) #endif #ifdef CONFIG_NVGPU_LS_PMU - err = nvgpu_pmu_rtos_init(g); - if (err != 0) { - nvgpu_err(g, "failed to init gk20a pmu"); - nvgpu_mutex_release(&g->tpc_pg_lock); - goto done; + if (g->ops.pmu.pmu_rtos_init != NULL) { + err = g->ops.pmu.pmu_rtos_init(g); + if (err != 0) { + nvgpu_err(g, "failed to init gk20a pmu"); + nvgpu_mutex_release(&g->tpc_pg_lock); + goto done; + } } #endif diff --git a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c index ce7560f6f..a895d837f 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c @@ -884,6 +884,7 @@ static const struct gpu_ops gm20b_ops = { .pmu_pstate_pmu_setup = nvgpu_pmu_pstate_pmu_setup, .pmu_destroy = nvgpu_pmu_destroy, .pmu_early_init = nvgpu_pmu_early_init, + .pmu_rtos_init = nvgpu_pmu_rtos_init, .is_pmu_supported = gm20b_is_pmu_supported, .falcon_base_addr = gk20a_pmu_falcon_base_addr, diff --git a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c index d6374515a..35badb1f0 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c @@ -970,6 +970,7 @@ static const struct gpu_ops gp10b_ops = { .pmu = { /* Init */ .pmu_early_init = nvgpu_pmu_early_init, + .pmu_rtos_init = nvgpu_pmu_rtos_init, .pmu_pstate_sw_setup = nvgpu_pmu_pstate_sw_setup, .pmu_pstate_pmu_setup = nvgpu_pmu_pstate_pmu_setup, .pmu_destroy = nvgpu_pmu_destroy, diff --git a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c index 6fbffda96..c5a5df2d6 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c @@ -1173,6 +1173,7 @@ static const struct gpu_ops gv11b_ops = { .validate_mem_integrity = gv11b_pmu_validate_mem_integrity, #ifdef CONFIG_NVGPU_LS_PMU /* Init */ + .pmu_rtos_init = nvgpu_pmu_rtos_init, .pmu_pstate_sw_setup = nvgpu_pmu_pstate_sw_setup, .pmu_pstate_pmu_setup = nvgpu_pmu_pstate_pmu_setup, .pmu_destroy = nvgpu_pmu_destroy, diff --git a/drivers/gpu/nvgpu/hal/init/hal_tu104.c b/drivers/gpu/nvgpu/hal/init/hal_tu104.c index 983b109d1..cc4a2449c 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_tu104.c +++ b/drivers/gpu/nvgpu/hal/init/hal_tu104.c @@ -1177,6 +1177,7 @@ static const struct gpu_ops tu104_ops = { .pmu = { /* Init */ .pmu_early_init = nvgpu_pmu_early_init, + .pmu_rtos_init = nvgpu_pmu_rtos_init, .pmu_pstate_sw_setup = nvgpu_pmu_pstate_sw_setup, .pmu_pstate_pmu_setup = nvgpu_pmu_pstate_pmu_setup, .pmu_destroy = nvgpu_pmu_destroy, diff --git a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gp10b.c index 0a6f8a2e5..5d88e65dd 100644 --- a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gp10b.c @@ -684,6 +684,7 @@ static const struct gpu_ops vgpu_gp10b_ops = { #ifdef CONFIG_NVGPU_LS_PMU .pmu = { .pmu_early_init = nvgpu_pmu_early_init, + .pmu_rtos_init = nvgpu_pmu_rtos_init, .pmu_pstate_sw_setup = nvgpu_pmu_pstate_sw_setup, .pmu_pstate_pmu_setup = nvgpu_pmu_pstate_pmu_setup, .pmu_destroy = nvgpu_pmu_destroy, diff --git a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c index 8180fe29b..7213a9b2d 100644 --- a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c @@ -797,6 +797,7 @@ static const struct gpu_ops vgpu_gv11b_ops = { #ifdef CONFIG_NVGPU_LS_PMU .pmu = { .pmu_early_init = nvgpu_pmu_early_init, + .pmu_rtos_init = nvgpu_pmu_rtos_init, .pmu_pstate_sw_setup = nvgpu_pmu_pstate_sw_setup, .pmu_pstate_pmu_setup = nvgpu_pmu_pstate_pmu_setup, .pmu_destroy = nvgpu_pmu_destroy, diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 29b740ade..66d00fd0d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -1208,6 +1208,7 @@ struct gpu_ops { } therm; struct { int (*pmu_early_init)(struct gk20a *g); + int (*pmu_rtos_init)(struct gk20a *g); int (*pmu_destroy)(struct gk20a *g, struct nvgpu_pmu *pmu); int (*pmu_pstate_sw_setup)(struct gk20a *g); int (*pmu_pstate_pmu_setup)(struct gk20a *g);