summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2018-05-25 06:55:20 -0400
committerTejal Kudav <tkudav@nvidia.com>2018-06-14 09:44:06 -0400
commit2318e66a59e4e25240513fe7d267fc63b7353a15 (patch)
tree719b58c12a9ad7e2efa0e63628924c1e92acc12a /drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
parentf9da1781f67b1c67f4c0825dae38dfc13e72bbc1 (diff)
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>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
index b2d6230d..5d7ee84d 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
@@ -796,6 +796,9 @@ static void gr_gp10b_remove_sysfs(struct device *dev)
796{ 796{
797 struct gk20a *g = get_gk20a(dev); 797 struct gk20a *g = get_gk20a(dev);
798 798
799 if (!g->ecc.gr.sm_lrf_single_err_count.counters)
800 return;
801
799 gr_gp10b_ecc_stat_remove(dev, 802 gr_gp10b_ecc_stat_remove(dev,
800 0, 803 0,
801 &g->ecc.gr.sm_lrf_single_err_count, 804 &g->ecc.gr.sm_lrf_single_err_count,