From 9eef737acfa9b7e7df7dbf236eafe8d98f792019 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Wed, 29 Mar 2017 10:14:16 -0700 Subject: [PATCH] gpu: nvgpu: fix vgpu shutdown code On unbind we need to check that interrupts are complete before tearing down the interrupt threads, but on vgpu those structures are not initialized as they are managed by the server. This change makes sure we do not try to free those resources on vgpu shutdown Bug 200293510 JIRA: EASS-1753 Change-Id: I77cb8594e1ad2c53f632e18b0dfc88f784a815e4 Signed-off-by: David Nieto (cherry picked from commit 1a640fa6a3b41c3de7d63e14ee6770679e2c82af) Reviewed-on: http://git-master/r/1330770 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jinyoung Park GVS: Gerrit_Virtual_Submit Reviewed-by: Vladislav Buzov --- drivers/gpu/nvgpu/gk20a/gk20a.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 861eda5d3..2ab367a18 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1768,6 +1768,9 @@ void gk20a_driver_start_unload(struct gk20a *g) g->driver_is_dying = 1; up_write(&g->busy_lock); + if (gk20a_gpu_is_virtual(g->dev)) + return; + gk20a_wait_for_idle(g->dev); nvgpu_wait_for_deferred_interrupts(g);