summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2016-05-26 21:44:40 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-05-31 22:49:14 -0400
commit37b747ca450a3afa5e7101f3c0d41929f472c721 (patch)
tree2b8d0df58ca0ceba4dec61ac9f2c9993d0f2080f /drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
parent6f5bdfd0916b139389e5dcccb1783b5da1c79953 (diff)
gpu: nvgpu: fix pid retrieval on tsg reset
On engine reset, an event is generate for FECS trace. In case a TSG context is currentlu loaded on GR engine, we retrieve the pid of the TSG from the first channel in the ch_list. Fixed invalid invocation of list_entry that led to crash. Bug 200193891 Change-Id: I79358bbb6685748cde68396ce220ab7b660d414d Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: http://git-master/r/1154811 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Richard Zhao <rizhao@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
index 77e93458..3682d904 100644
--- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
@@ -686,11 +686,13 @@ void gk20a_ctxsw_trace_tsg_reset(struct gk20a *g, struct tsg_gk20a *tsg)
686 return; 686 return;
687 687
688 mutex_lock(&tsg->ch_list_lock); 688 mutex_lock(&tsg->ch_list_lock);
689 ch = list_entry(&tsg->ch_list, struct channel_gk20a, ch_entry); 689 if (!list_empty(&tsg->ch_list)) {
690 ch = list_entry(tsg->ch_list.next,
691 struct channel_gk20a, ch_entry);
692 entry.pid = ch->pid;
693 }
690 mutex_unlock(&tsg->ch_list_lock); 694 mutex_unlock(&tsg->ch_list_lock);
691 695
692 entry.pid = ch->pid;
693
694 gk20a_ctxsw_trace_write(g, &entry); 696 gk20a_ctxsw_trace_write(g, &entry);
695 gk20a_ctxsw_trace_wake_up(g, 0); 697 gk20a_ctxsw_trace_wake_up(g, 0);
696#endif 698#endif