diff options
author | Nitin Kumbhar <nkumbhar@nvidia.com> | 2018-05-30 05:02:41 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-06-15 08:03:58 -0400 |
commit | 8963318b140d8ad7a98281bf083c23f08735c57e (patch) | |
tree | ccdf9778c56254b376bc2bbe1cfa7f48fe68b61e /drivers/gpu/nvgpu/common | |
parent | 000b10782deb1ff854fb0a1d0224ff218bfe25ae (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')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/pci.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c | 13 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.h | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c | 27 |
4 files changed, 35 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c index 6b3f1092..6caf5ad9 100644 --- a/drivers/gpu/nvgpu/common/linux/pci.c +++ b/drivers/gpu/nvgpu/common/linux/pci.c | |||
@@ -52,6 +52,11 @@ static int nvgpu_pci_tegra_probe(struct device *dev) | |||
52 | 52 | ||
53 | static int nvgpu_pci_tegra_remove(struct device *dev) | 53 | static int nvgpu_pci_tegra_remove(struct device *dev) |
54 | { | 54 | { |
55 | struct gk20a *g = get_gk20a(dev); | ||
56 | |||
57 | if (g->ops.gr.remove_gr_sysfs) | ||
58 | g->ops.gr.remove_gr_sysfs(g); | ||
59 | |||
55 | return 0; | 60 | return 0; |
56 | } | 61 | } |
57 | 62 | ||
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 | ||
70 | static 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 | ||
177 | int gp10b_tegra_remove(struct device *dev) | 175 | static 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 | ||
795 | static void gr_gp10b_remove_sysfs(struct device *dev) | 796 | void 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; |
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.h b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.h index 05832e87..725bd0cf 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.h +++ b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -43,6 +43,4 @@ void gp10b_ecc_stat_remove(struct device *dev, | |||
43 | struct gk20a_ecc_stat *ecc_stat, | 43 | struct gk20a_ecc_stat *ecc_stat, |
44 | struct device_attribute *dev_attr_array); | 44 | struct device_attribute *dev_attr_array); |
45 | 45 | ||
46 | int gp10b_tegra_remove(struct device *dev); | ||
47 | |||
48 | #endif | 46 | #endif |
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 | ||
47 | static void gr_gv11b_remove_sysfs(struct device *dev); | 47 | static 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 | ||
49 | static int gv11b_tegra_probe(struct device *dev) | 57 | static 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 | |||
85 | static int gv11b_tegra_remove(struct device *dev) | 94 | static 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 | ||
501 | static void gr_gv11b_remove_sysfs(struct device *dev) | 517 | void 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, |