From 289cb4d9bdb7db478397a98f8eb56d60e04a6bfc Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 13 Apr 2016 10:23:37 +0300 Subject: gpu: nvgpu: move cs_lock init to happen always The cs_lock cyclestats mutex is unconditionally taken when removing cs support, but it wouldn't be initialized if some part of gr init would fail before it. Move it up to happen first, before other inits. Change-Id: Ia5d7a888c29dc99728630a07698b1ed25af960c2 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1126004 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 27406f9e..d085e96f 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -4626,6 +4626,10 @@ static int gk20a_init_gr_setup_sw(struct gk20a *g) gr->g = g; +#if defined(CONFIG_GK20A_CYCLE_STATS) + mutex_init(&g->gr.cs_lock); +#endif + err = gr_gk20a_init_gr_config(g, gr); if (err) goto clean_up; @@ -4662,10 +4666,6 @@ static int gk20a_init_gr_setup_sw(struct gk20a *g) mutex_init(&gr->ctx_mutex); spin_lock_init(&gr->ch_tlb_lock); -#if defined(CONFIG_GK20A_CYCLE_STATS) - mutex_init(&g->gr.cs_lock); -#endif - gr->remove_support = gk20a_remove_gr_support; gr->sw_ready = true; -- cgit v1.2.2