From f03ee50232bbd562f47b44430ae9f1e83b424dd6 Mon Sep 17 00:00:00 2001 From: Adeel Raza Date: Mon, 29 Feb 2016 14:25:15 -0800 Subject: 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 Reviewed-on: http://git-master/r/1021660 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') 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) 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", -- cgit v1.2.2