summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2018-05-30 05:02:41 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-06-15 08:03:58 -0400
commit8963318b140d8ad7a98281bf083c23f08735c57e (patch)
treeccdf9778c56254b376bc2bbe1cfa7f48fe68b61e /drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
parent000b10782deb1ff854fb0a1d0224ff218bfe25ae (diff)
gpu: nvgpu: add remove_gr_sysfs gpu op
Add remove_gr_sys() op to gpu_ops to reverse steps done in create_gr_sysfs(). Make gv11b_tegra_remove() specific to gv11b instead to properly remove sysfs nodes. This also helps in having gv11b specific remove steps. Also, update platform remove function of dGPU i.e. nvgpu_pci_tegra_remove() to remove sysfs nodes. This adds parity with iGPU platform remove. Bug 1987855 Change-Id: Ibbaffac5c24346709347f86444a951461894354d Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1735987 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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
index 5d7ee84d..a2506341 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
@@ -67,8 +67,6 @@ static struct {
67 {"gpu", GPCCLK_INIT_RATE}, 67 {"gpu", GPCCLK_INIT_RATE},
68 {"gpu_sys", 204000000} }; 68 {"gpu_sys", 204000000} };
69 69
70static void gr_gp10b_remove_sysfs(struct device *dev);
71
72/* 70/*
73 * gp10b_tegra_get_clocks() 71 * gp10b_tegra_get_clocks()
74 * 72 *
@@ -174,9 +172,12 @@ static int gp10b_tegra_late_probe(struct device *dev)
174 return 0; 172 return 0;
175} 173}
176 174
177int gp10b_tegra_remove(struct device *dev) 175static int gp10b_tegra_remove(struct device *dev)
178{ 176{
179 gr_gp10b_remove_sysfs(dev); 177 struct gk20a *g = get_gk20a(dev);
178
179 if (g->ops.gr.remove_gr_sysfs)
180 g->ops.gr.remove_gr_sysfs(g);
180 181
181 /* deinitialise tegra specific scaling quirks */ 182 /* deinitialise tegra specific scaling quirks */
182 gp10b_tegra_scale_exit(dev); 183 gp10b_tegra_scale_exit(dev);
@@ -792,9 +793,9 @@ void gr_gp10b_create_sysfs(struct gk20a *g)
792 dev_err(dev, "Failed to create sysfs attributes!\n"); 793 dev_err(dev, "Failed to create sysfs attributes!\n");
793} 794}
794 795
795static void gr_gp10b_remove_sysfs(struct device *dev) 796void gr_gp10b_remove_sysfs(struct gk20a *g)
796{ 797{
797 struct gk20a *g = get_gk20a(dev); 798 struct device *dev = dev_from_gk20a(g);
798 799
799 if (!g->ecc.gr.sm_lrf_single_err_count.counters) 800 if (!g->ecc.gr.sm_lrf_single_err_count.counters)
800 return; 801 return;