summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAdeel Raza <araza@nvidia.com>2016-02-29 17:25:15 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-03-03 23:33:00 -0500
commit063e3d5ae87612e3f896735d6b39240f49d48941 (patch)
tree081d54c4e9db71ee907db4e276ca789a87632d94 /drivers/gpu
parentf7e260dc9f9e3d2d22447f143b62d0ab2d8f5ce1 (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/gpu')
-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 dfeba9c42..e1a96e4c0 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",