diff options
author | Nitin Kumbhar <nkumbhar@nvidia.com> | 2018-07-04 13:24:08 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-07-12 16:14:25 -0400 |
commit | 0b7fbc1ff457580cf8ae3f7a8a55f5ab36bfd8e7 (patch) | |
tree | 1dd176d977671d49893d6cb7c40c40824cdcf944 /drivers/gpu/nvgpu/os/linux/module.c | |
parent | 1d82693cef59917930267f4fa9ecc4ac9c7a3c7b (diff) |
gpu: nvgpu: skip suspend if gpu already removed
On nvgpu module unload, platform_driver_unregister() detaches
driver from device (driver_detach()). As part of this,
__device_release_driver() results a race between driver's
.runtime_resume(), .remove() and .runtime_suspend().
As nvgpu's .remove() is handling all steps of cleaning up
driver state and shutting down gpu, .runtime_suspend()
shall have no work. So skip .runtime_suspend() is gk20a *g
has already been processed.
Bug 1987855
Change-Id: I024ac63d321689ea04c64b1ffc125da943d482f9
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1770803
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/module.c')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/module.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 28ade90f..a59ac1f1 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c | |||
@@ -936,6 +936,9 @@ static int gk20a_pm_runtime_suspend(struct device *dev) | |||
936 | int err = 0; | 936 | int err = 0; |
937 | struct gk20a *g = get_gk20a(dev); | 937 | struct gk20a *g = get_gk20a(dev); |
938 | 938 | ||
939 | if (!g) | ||
940 | return 0; | ||
941 | |||
939 | if (gk20a_gpu_is_virtual(dev)) | 942 | if (gk20a_gpu_is_virtual(dev)) |
940 | err = vgpu_pm_prepare_poweroff(dev); | 943 | err = vgpu_pm_prepare_poweroff(dev); |
941 | else | 944 | else |