From c9d4df288d51e4776188a25a6a2bb26ddd897a20 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Thu, 13 Dec 2018 11:02:11 -0800 Subject: gpu: nvgpu: remove code for ch not bound to tsg - Remove handling for channels that are no more bound to tsg as channel could be referenceable but no more part of a tsg - Use tsg_gk20a_from_ch to get pointer to tsg for a given channel - Clear unhandled gr interrupts Bug 2429295 JIRA NVGPU-1580 Change-Id: I9da43a2bc9a0282c793b9f301eaf8e8604f91d70 Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1972492 (cherry picked from commit 013ca60edd97e7719e389b3048fed9b165277251 in dev-kernel) Reviewed-on: https://git-master.nvidia.com/r/2018262 Reviewed-by: svc-mobile-coverity Reviewed-by: Debarshi Dutta Tested-by: Debarshi Dutta GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index cac3ce27..6b384c89 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c @@ -457,9 +457,14 @@ int gk20a_fecs_trace_bind_channel(struct gk20a *g, struct gk20a_fecs_trace *trace = g->fecs_trace; struct nvgpu_mem *mem; u32 context_ptr = gk20a_fecs_trace_fecs_context_ptr(g, ch); - pid_t pid; u32 aperture_mask; + tsg = tsg_gk20a_from_ch(ch); + if (tsg == NULL) { + nvgpu_err(g, "chid: %d is not bound to tsg", ch->chid); + return -EINVAL; + } + nvgpu_log(g, gpu_dbg_fn|gpu_dbg_ctxsw, "chid=%d context_ptr=%x inst_block=%llx", ch->chid, context_ptr, @@ -519,11 +524,7 @@ int gk20a_fecs_trace_bind_channel(struct gk20a *g, /* pid (process identifier) in user space, corresponds to tgid (thread * group id) in kernel space. */ - if (gk20a_is_channel_marked_as_tsg(ch)) - pid = tsg_gk20a_from_ch(ch)->tgid; - else - pid = ch->tgid; - gk20a_fecs_trace_hash_add(g, context_ptr, pid); + gk20a_fecs_trace_hash_add(g, context_ptr, tsg->tgid); return 0; } -- cgit v1.2.2