summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/platform_gv11b_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_gv11b_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_gv11b_tegra.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c
index df760478..f681fe4b 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c
@@ -44,7 +44,15 @@
44#include "platform_gk20a_tegra.h" 44#include "platform_gk20a_tegra.h"
45#include "gv11b/gr_gv11b.h" 45#include "gv11b/gr_gv11b.h"
46 46
47static void gr_gv11b_remove_sysfs(struct device *dev); 47static void gv11b_tegra_scale_exit(struct device *dev)
48{
49 struct gk20a_platform *platform = gk20a_get_platform(dev);
50 struct gk20a_scale_profile *profile = platform->g->scale_profile;
51
52 if (profile)
53 tegra_bwmgr_unregister(
54 (struct tegra_bwmgr_client *)profile->private_data);
55}
48 56
49static int gv11b_tegra_probe(struct device *dev) 57static int gv11b_tegra_probe(struct device *dev)
50{ 58{
@@ -82,11 +90,19 @@ static int gv11b_tegra_late_probe(struct device *dev)
82 return 0; 90 return 0;
83} 91}
84 92
93
85static int gv11b_tegra_remove(struct device *dev) 94static int gv11b_tegra_remove(struct device *dev)
86{ 95{
87 gp10b_tegra_remove(dev); 96 struct gk20a *g = get_gk20a(dev);
97
98 if (g->ops.gr.remove_gr_sysfs)
99 g->ops.gr.remove_gr_sysfs(g);
100
101 gv11b_tegra_scale_exit(dev);
88 102
89 gr_gv11b_remove_sysfs(dev); 103#ifdef CONFIG_TEGRA_GK20A_NVHOST
104 nvgpu_free_nvhost_dev(get_gk20a(dev));
105#endif
90 106
91 return 0; 107 return 0;
92} 108}
@@ -498,12 +514,13 @@ void gr_gv11b_create_sysfs(struct gk20a *g)
498 dev_err(dev, "Failed to create gv11b sysfs attributes!\n"); 514 dev_err(dev, "Failed to create gv11b sysfs attributes!\n");
499} 515}
500 516
501static void gr_gv11b_remove_sysfs(struct device *dev) 517void gr_gv11b_remove_sysfs(struct gk20a *g)
502{ 518{
503 struct gk20a *g = get_gk20a(dev); 519 struct device *dev = dev_from_gk20a(g);
504 520
505 if (!g->ecc.gr.sm_l1_tag_corrected_err_count.counters) 521 if (!g->ecc.gr.sm_l1_tag_corrected_err_count.counters)
506 return; 522 return;
523 gr_gp10b_remove_sysfs(g);
507 524
508 gr_gp10b_ecc_stat_remove(dev, 525 gr_gp10b_ecc_stat_remove(dev,
509 0, 526 0,