From ef6ea3475cac013c174905ab4f7f187700ae2a33 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Thu, 7 Sep 2017 16:12:44 -0700 Subject: gpu: nvgpu: Unify remove/shutdown codepaths The following changes are part of the porting of the bind/unbind functionality. These changes reuse the shutdown codepaths in iGPU and dGPU and fix a locking issue with in gk20a_busy() where the usage count can lead to a deadlock during the driver shutdown. It fixes a racing condition with the gr/mm code by invalidating the sw ready flag while holding the busy lock JIRA: EVLR-1739 Change-Id: I62ce47378436b21f447f4cd93388759ed3f9bad1 Signed-off-by: David Nieto Reviewed-on: https://git-master.nvidia.com/r/1554959 Reviewed-by: svc-mobile-coverity Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/clk/clk_arb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/clk') diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c index 0204627b..4f09da74 100644 --- a/drivers/gpu/nvgpu/clk/clk_arb.c +++ b/drivers/gpu/nvgpu/clk/clk_arb.c @@ -489,9 +489,8 @@ void nvgpu_clk_arb_cleanup_arbiter(struct gk20a *g) nvgpu_kfree(g, arb->vf_table_pool[index].gpc2clk_points); nvgpu_kfree(g, arb->vf_table_pool[index].mclk_points); } + nvgpu_mutex_destroy(&g->clk_arb->pstate_lock); } - - nvgpu_mutex_destroy(&g->clk_arb->pstate_lock); nvgpu_kfree(g, g->clk_arb); g->clk_arb = NULL; } -- cgit v1.2.2