From 8963318b140d8ad7a98281bf083c23f08735c57e Mon Sep 17 00:00:00 2001 From: Nitin Kumbhar Date: Wed, 30 May 2018 14:32:41 +0530 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1735987 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c') 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 { {"gpu", GPCCLK_INIT_RATE}, {"gpu_sys", 204000000} }; -static void gr_gp10b_remove_sysfs(struct device *dev); - /* * gp10b_tegra_get_clocks() * @@ -174,9 +172,12 @@ static int gp10b_tegra_late_probe(struct device *dev) return 0; } -int gp10b_tegra_remove(struct device *dev) +static int gp10b_tegra_remove(struct device *dev) { - gr_gp10b_remove_sysfs(dev); + struct gk20a *g = get_gk20a(dev); + + if (g->ops.gr.remove_gr_sysfs) + g->ops.gr.remove_gr_sysfs(g); /* deinitialise tegra specific scaling quirks */ gp10b_tegra_scale_exit(dev); @@ -792,9 +793,9 @@ void gr_gp10b_create_sysfs(struct gk20a *g) dev_err(dev, "Failed to create sysfs attributes!\n"); } -static void gr_gp10b_remove_sysfs(struct device *dev) +void gr_gp10b_remove_sysfs(struct gk20a *g) { - struct gk20a *g = get_gk20a(dev); + struct device *dev = dev_from_gk20a(g); if (!g->ecc.gr.sm_lrf_single_err_count.counters) return; -- cgit v1.2.2