From e5c5fee01e9f33638fa89a0a6d5b2bb9f0d6e07a Mon Sep 17 00:00:00 2001 From: Rajesh Devaraj Date: Tue, 24 Jan 2023 19:27:39 +0000 Subject: [PATCH] gpu: nvgpu: skip falcon sw init for pmu Perform falcon sw init for PMU only if it is supported in the platform. JIRA NVGPU-9283 Change-Id: I697e389a7cd812c7cb941eac010549f541074bb4 Signed-off-by: Rajesh Devaraj Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2848436 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/common/init/nvgpu_init.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index 41b137912..c365b5011 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -239,10 +239,12 @@ static int nvgpu_falcons_sw_init(struct gk20a *g) { int err; - err = g->ops.falcon.falcon_sw_init(g, FALCON_ID_PMU); - if (err != 0) { - nvgpu_err(g, "failed to sw init FALCON_ID_PMU"); - return err; + if (g->ops.pmu.is_pmu_supported != NULL) { + err = g->ops.falcon.falcon_sw_init(g, FALCON_ID_PMU); + if (err != 0) { + nvgpu_err(g, "failed to sw init FALCON_ID_PMU"); + return err; + } } err = g->ops.falcon.falcon_sw_init(g, FALCON_ID_FECS); @@ -282,7 +284,9 @@ done_fecs: #endif g->ops.falcon.falcon_sw_free(g, FALCON_ID_FECS); done_pmu: - g->ops.falcon.falcon_sw_free(g, FALCON_ID_PMU); + if (g->ops.pmu.is_pmu_supported != NULL) { + g->ops.falcon.falcon_sw_free(g, FALCON_ID_PMU); + } return err; } @@ -290,7 +294,9 @@ done_pmu: /* handle poweroff and error case for all falcons interface layer support */ static void nvgpu_falcons_sw_free(struct gk20a *g) { - g->ops.falcon.falcon_sw_free(g, FALCON_ID_PMU); + if (g->ops.pmu.is_pmu_supported != NULL) { + g->ops.falcon.falcon_sw_free(g, FALCON_ID_PMU); + } g->ops.falcon.falcon_sw_free(g, FALCON_ID_FECS); #ifdef CONFIG_NVGPU_DGPU