diff options
author | Deepak Goyal <dgoyal@nvidia.com> | 2017-07-01 22:49:29 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-06 08:44:32 -0400 |
commit | 75d7d6826dea130d5eb5ac86f1ca54bd9b05fbe1 (patch) | |
tree | 3a309b2d70caca4f73b78c73ad380d07c5d11ac2 /drivers/gpu/nvgpu/common/linux | |
parent | 4166fc2f87ca4254b5e0c1433c810a83676d029a (diff) |
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 <dgoyal@nvidia.com>
Reviewed-on: https://git-master/r/1510036
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
4 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/debug_pmu.c b/drivers/gpu/nvgpu/common/linux/debug_pmu.c index 0d364fe7..8c3607b5 100644 --- a/drivers/gpu/nvgpu/common/linux/debug_pmu.c +++ b/drivers/gpu/nvgpu/common/linux/debug_pmu.c | |||
@@ -12,6 +12,7 @@ | |||
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <nvgpu/enabled.h> | ||
15 | #include "debug_pmu.h" | 16 | #include "debug_pmu.h" |
16 | #include "gk20a/platform_gk20a.h" | 17 | #include "gk20a/platform_gk20a.h" |
17 | 18 | ||
@@ -348,10 +349,12 @@ static ssize_t perfmon_events_enable_write(struct file *file, | |||
348 | if (err) | 349 | if (err) |
349 | return err; | 350 | return err; |
350 | 351 | ||
351 | if (val && !g->pmu.perfmon_sampling_enabled) { | 352 | if (val && !g->pmu.perfmon_sampling_enabled && |
353 | nvgpu_is_enabled(g, NVGPU_PMU_PERFMON)) { | ||
352 | g->pmu.perfmon_sampling_enabled = true; | 354 | g->pmu.perfmon_sampling_enabled = true; |
353 | nvgpu_pmu_perfmon_start_sampling(&(g->pmu)); | 355 | nvgpu_pmu_perfmon_start_sampling(&(g->pmu)); |
354 | } else if (!val && g->pmu.perfmon_sampling_enabled) { | 356 | } else if (!val && g->pmu.perfmon_sampling_enabled && |
357 | nvgpu_is_enabled(g, NVGPU_PMU_PERFMON)) { | ||
355 | g->pmu.perfmon_sampling_enabled = false; | 358 | g->pmu.perfmon_sampling_enabled = false; |
356 | nvgpu_pmu_perfmon_stop_sampling(&(g->pmu)); | 359 | nvgpu_pmu_perfmon_stop_sampling(&(g->pmu)); |
357 | } | 360 | } |
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index b12917d6..4e2cb2b4 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c | |||
@@ -124,6 +124,7 @@ static void nvgpu_init_pm_vars(struct gk20a *g) | |||
124 | g->support_pmu = support_gk20a_pmu(dev_from_gk20a(g)); | 124 | g->support_pmu = support_gk20a_pmu(dev_from_gk20a(g)); |
125 | g->can_railgate = platform->can_railgate_init; | 125 | g->can_railgate = platform->can_railgate_init; |
126 | g->railgate_delay = platform->railgate_delay_init; | 126 | g->railgate_delay = platform->railgate_delay_init; |
127 | __nvgpu_set_enabled(g, NVGPU_PMU_PERFMON, platform->enable_perfmon); | ||
127 | 128 | ||
128 | /* set default values to aelpg parameters */ | 129 | /* set default values to aelpg parameters */ |
129 | g->pmu.aelpg_param[0] = APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US; | 130 | g->pmu.aelpg_param[0] = APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US; |
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c index 2c1709ea..000e9eee 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c | |||
@@ -920,6 +920,7 @@ struct gk20a_platform gm20b_tegra_platform = { | |||
920 | .enable_elcg = true, | 920 | .enable_elcg = true, |
921 | .enable_elpg = true, | 921 | .enable_elpg = true, |
922 | .enable_aelpg = true, | 922 | .enable_aelpg = true, |
923 | .enable_perfmon = true, | ||
923 | .ptimer_src_freq = 19200000, | 924 | .ptimer_src_freq = 19200000, |
924 | 925 | ||
925 | .force_reset_in_do_idle = false, | 926 | .force_reset_in_do_idle = false, |
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c index 61b8053f..83d3634c 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c | |||
@@ -377,6 +377,7 @@ struct gk20a_platform gp10b_tegra_platform = { | |||
377 | .enable_slcg = true, | 377 | .enable_slcg = true, |
378 | .enable_elcg = true, | 378 | .enable_elcg = true, |
379 | .enable_aelpg = true, | 379 | .enable_aelpg = true, |
380 | .enable_perfmon = true, | ||
380 | 381 | ||
381 | /* ptimer src frequency in hz*/ | 382 | /* ptimer src frequency in hz*/ |
382 | .ptimer_src_freq = 31250000, | 383 | .ptimer_src_freq = 31250000, |