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>
This commit is contained in:
Adeel Raza
2016-02-29 14:25:15 -08:00
committed by Deepak Nibade
parent 63d463c1ac
commit f03ee50232

View File

@@ -524,6 +524,13 @@ void gr_gp10b_create_sysfs(struct platform_device *dev)
int error = 0;
struct gk20a *g = get_gk20a(dev);
/* This 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 the following check to avoid
creating duplicate stat sysfs nodes. */
if (g->gr.t18x.ecc_stats.sm_lrf_single_err_count.counters != NULL)
return;
error |= ecc_stat_create(dev,
0,
"sm_lrf_ecc_single_err_count",