summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAdeel Raza <araza@nvidia.com>2016-02-29 17:25:15 -0500
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:52:11 -0500
commitf03ee50232bbd562f47b44430ae9f1e83b424dd6 (patch)
treed5ba14eeac5db4866193ae6093835ccaa7a70f00 /drivers
parent63d463c1ac1aa618111cbaee5c90ae69698816b6 (diff)
gpu: nvgpu: gp10b: only create ECC stats once
The ECC sysfs stat creation function is called on GR init. GR can get initialized multiple times but we only need to create the ECC stats once. Therefore, add a check to avoid creating duplicate stat sysfs nodes. Change-Id: Ifb338e57643f2f15492df137d2a7521e0c990cf2 Signed-off-by: Adeel Raza <araza@nvidia.com> Reviewed-on: http://git-master/r/1021660 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
index dfeba9c4..e1a96e4c 100644
--- a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
+++ b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
@@ -524,6 +524,13 @@ void gr_gp10b_create_sysfs(struct platform_device *dev)
524 int error = 0; 524 int error = 0;
525 struct gk20a *g = get_gk20a(dev); 525 struct gk20a *g = get_gk20a(dev);
526 526
527 /* This stat creation function is called on GR init. GR can get
528 initialized multiple times but we only need to create the ECC
529 stats once. Therefore, add the following check to avoid
530 creating duplicate stat sysfs nodes. */
531 if (g->gr.t18x.ecc_stats.sm_lrf_single_err_count.counters != NULL)
532 return;
533
527 error |= ecc_stat_create(dev, 534 error |= ecc_stat_create(dev,
528 0, 535 0,
529 "sm_lrf_ecc_single_err_count", 536 "sm_lrf_ecc_single_err_count",