From 75d7d6826dea130d5eb5ac86f1ca54bd9b05fbe1 Mon Sep 17 00:00:00 2001 From: Deepak Goyal Date: Sun, 2 Jul 2017 08:19:29 +0530 Subject: gpu: nvgpu: pmu: check before initializing perfmon We should check if perfmon is enabled before sending perfmon init command. This is needed for debug purposes. Change-Id: Ia95a590a76074c469b5d87a5820cd5b2e50d13be Signed-off-by: Deepak Goyal Reviewed-on: https://git-master/r/1510036 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/pmu/pmu_ipc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/common/pmu/pmu_ipc.c') diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c b/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c index 352e525f..0dbc2df3 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c @@ -11,6 +11,7 @@ * more details. */ +#include #include #include #include @@ -844,7 +845,8 @@ int nvgpu_pmu_process_message(struct nvgpu_pmu *pmu) nvgpu_pmu_process_init_msg(pmu, &msg); if (g->ops.pmu.init_wpr_region != NULL) g->ops.pmu.init_wpr_region(g); - nvgpu_pmu_init_perfmon(pmu); + if (nvgpu_is_enabled(g, NVGPU_PMU_PERFMON)) + nvgpu_pmu_init_perfmon(pmu); return 0; } -- cgit v1.2.2