diff options
author | Vijayakumar <vsubbu@nvidia.com> | 2015-08-04 07:44:54 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-09-16 12:44:00 -0400 |
commit | b8faddfe2ad3d52837b0f766d74feb8e6d6f4ce5 (patch) | |
tree | 9cf25fcdd5e9ac2ff870f78c35213ce46b90ac7a /drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |
parent | 2359f247d18fbde3220e463543193ab06f75fe81 (diff) |
gpu: nvgpu: fix runlist update timeout handling
bug 1625901
1) disable ELPG before doing GR reset when runlist update times out
2) add mutex for GR reset to avoid multiple threads resetting GR
3) protect GR reset with FECS mutex so that no one else submits methods
Change-Id: I02993fd1eabe6875ab1c58a40a06e6c79fcdeeae
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/793643
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index dae9c8cb..c18a4e5d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -719,7 +719,7 @@ static void gk20a_free_channel(struct channel_gk20a *ch) | |||
719 | struct vm_gk20a *ch_vm = ch->vm; | 719 | struct vm_gk20a *ch_vm = ch->vm; |
720 | unsigned long timeout = gk20a_get_gr_idle_timeout(g); | 720 | unsigned long timeout = gk20a_get_gr_idle_timeout(g); |
721 | struct dbg_session_gk20a *dbg_s; | 721 | struct dbg_session_gk20a *dbg_s; |
722 | 722 | bool was_reset; | |
723 | gk20a_dbg_fn(""); | 723 | gk20a_dbg_fn(""); |
724 | 724 | ||
725 | WARN_ON(ch->g == NULL); | 725 | WARN_ON(ch->g == NULL); |
@@ -764,7 +764,15 @@ static void gk20a_free_channel(struct channel_gk20a *ch) | |||
764 | if (g->fifo.deferred_reset_pending) { | 764 | if (g->fifo.deferred_reset_pending) { |
765 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "engine reset was" | 765 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "engine reset was" |
766 | " deferred, running now"); | 766 | " deferred, running now"); |
767 | gk20a_fifo_reset_engine(g, g->fifo.deferred_fault_engines); | 767 | was_reset = mutex_is_locked(&g->fifo.gr_reset_mutex); |
768 | mutex_lock(&g->fifo.gr_reset_mutex); | ||
769 | /* if lock is already taken, a reset is taking place | ||
770 | so no need to repeat */ | ||
771 | if (!was_reset) { | ||
772 | gk20a_fifo_reset_engine(g, | ||
773 | g->fifo.deferred_fault_engines); | ||
774 | } | ||
775 | mutex_unlock(&g->fifo.gr_reset_mutex); | ||
768 | g->fifo.deferred_fault_engines = 0; | 776 | g->fifo.deferred_fault_engines = 0; |
769 | g->fifo.deferred_reset_pending = false; | 777 | g->fifo.deferred_reset_pending = false; |
770 | } | 778 | } |