gpu: nvgpu: gr: remove only created sysfs nodes

Sysfs nodes for GR stats are created on GR init. If nvgpu
module is removed without any ops, then it tries to remove
sysfs nodes which do not exist resulting in kernel panic.
Fix this issue by removing sysfs nodes only if ecc counters
are initialized.

Bug 1987855

Change-Id: I3f967ee92ec02ad19ffbd9bfa8bace5bfd229dd2
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1730536
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nitin Kumbhar
2018-05-25 16:25:20 +05:30
committed by Tejal Kudav
parent f9da1781f6
commit 2318e66a59
2 changed files with 6 additions and 0 deletions

View File

@@ -796,6 +796,9 @@ static void gr_gp10b_remove_sysfs(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
if (!g->ecc.gr.sm_lrf_single_err_count.counters)
return;
gr_gp10b_ecc_stat_remove(dev,
0,
&g->ecc.gr.sm_lrf_single_err_count,

View File

@@ -502,6 +502,9 @@ static void gr_gv11b_remove_sysfs(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
if (!g->ecc.gr.sm_l1_tag_corrected_err_count.counters)
return;
gr_gp10b_ecc_stat_remove(dev,
0,
&g->ecc.gr.sm_l1_tag_corrected_err_count,