diff options
author | Nitin Kumbhar <nkumbhar@nvidia.com> | 2018-06-11 06:01:33 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-07-26 03:06:07 -0400 |
commit | b4b1fb97bd095fa0de72550b04dc414b0194903e (patch) | |
tree | efef55fc52463a4278b3d01f0eaf165d3c677657 /drivers/gpu/nvgpu/common/nvlink.c | |
parent | d80e8168755da80987a654b910a5ce1f6f273223 (diff) |
gpu: nvgpu: shutdown nvlink in driver remove
During driver remove, if nvlink is set up, gracefully
shut it down so that it can be enumerated again.
Bug 1987855
Change-Id: Ibd83a5e29364b22264e689aa879569a9cccf0f79
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1746073
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/nvlink.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/nvlink.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/nvlink.c b/drivers/gpu/nvgpu/common/nvlink.c index 6bfc154c..b13e5942 100644 --- a/drivers/gpu/nvgpu/common/nvlink.c +++ b/drivers/gpu/nvgpu/common/nvlink.c | |||
@@ -92,6 +92,16 @@ static int nvgpu_nvlink_interface_init(struct nvlink_device *ndev) | |||
92 | return err; | 92 | return err; |
93 | } | 93 | } |
94 | 94 | ||
95 | static int nvgpu_nvlink_interface_disable(struct nvlink_device *ndev) | ||
96 | { | ||
97 | int err = 0; | ||
98 | struct gk20a *g = (struct gk20a *) ndev->priv; | ||
99 | |||
100 | if (g->ops.nvlink.interface_disable) | ||
101 | err = g->ops.nvlink.interface_disable(g); | ||
102 | return err; | ||
103 | } | ||
104 | |||
95 | static int nvgpu_nvlink_shutdown(struct nvlink_device *ndev) | 105 | static int nvgpu_nvlink_shutdown(struct nvlink_device *ndev) |
96 | { | 106 | { |
97 | int err; | 107 | int err; |
@@ -401,6 +411,7 @@ static int nvgpu_nvlink_init_ops(struct gk20a *g) | |||
401 | ndev->dev_ops.dev_early_init = nvgpu_nvlink_early_init; | 411 | ndev->dev_ops.dev_early_init = nvgpu_nvlink_early_init; |
402 | ndev->dev_ops.dev_interface_init = nvgpu_nvlink_interface_init; | 412 | ndev->dev_ops.dev_interface_init = nvgpu_nvlink_interface_init; |
403 | ndev->dev_ops.dev_reg_init = nvgpu_nvlink_reg_init; | 413 | ndev->dev_ops.dev_reg_init = nvgpu_nvlink_reg_init; |
414 | ndev->dev_ops.dev_interface_disable = nvgpu_nvlink_interface_disable; | ||
404 | ndev->dev_ops.dev_shutdown = nvgpu_nvlink_shutdown; | 415 | ndev->dev_ops.dev_shutdown = nvgpu_nvlink_shutdown; |
405 | 416 | ||
406 | /* Fill in the link struct */ | 417 | /* Fill in the link struct */ |