diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2016-04-13 03:23:37 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-14 11:42:05 -0400 |
commit | 289cb4d9bdb7db478397a98f8eb56d60e04a6bfc (patch) | |
tree | 3a49ea958c9e940286b28ed69300807d1a96f179 /drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |
parent | ad49722b9dc34e6e4e1061a67f44b85c50cb3346 (diff) |
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 <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1126004
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 8 |
1 files changed, 4 insertions, 4 deletions
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) | |||
4626 | 4626 | ||
4627 | gr->g = g; | 4627 | gr->g = g; |
4628 | 4628 | ||
4629 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
4630 | mutex_init(&g->gr.cs_lock); | ||
4631 | #endif | ||
4632 | |||
4629 | err = gr_gk20a_init_gr_config(g, gr); | 4633 | err = gr_gk20a_init_gr_config(g, gr); |
4630 | if (err) | 4634 | if (err) |
4631 | goto clean_up; | 4635 | goto clean_up; |
@@ -4662,10 +4666,6 @@ static int gk20a_init_gr_setup_sw(struct gk20a *g) | |||
4662 | mutex_init(&gr->ctx_mutex); | 4666 | mutex_init(&gr->ctx_mutex); |
4663 | spin_lock_init(&gr->ch_tlb_lock); | 4667 | spin_lock_init(&gr->ch_tlb_lock); |
4664 | 4668 | ||
4665 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
4666 | mutex_init(&g->gr.cs_lock); | ||
4667 | #endif | ||
4668 | |||
4669 | gr->remove_support = gk20a_remove_gr_support; | 4669 | gr->remove_support = gk20a_remove_gr_support; |
4670 | gr->sw_ready = true; | 4670 | gr->sw_ready = true; |
4671 | 4671 | ||