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/common/fifo/channel.c | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'drivers/gpu/nvgpu/common/fifo') diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index cbffb6de..4b76dcdd 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -164,28 +164,26 @@ int gk20a_enable_channel_tsg(struct gk20a *g, struct channel_gk20a *ch) { struct tsg_gk20a *tsg; - if (gk20a_is_channel_marked_as_tsg(ch)) { - tsg = &g->fifo.tsg[ch->tsgid]; + tsg = tsg_gk20a_from_ch(ch); + if (tsg != NULL) { g->ops.fifo.enable_tsg(tsg); + return 0; } else { - g->ops.fifo.enable_channel(ch); + return -EINVAL; } - - return 0; } int gk20a_disable_channel_tsg(struct gk20a *g, struct channel_gk20a *ch) { struct tsg_gk20a *tsg; - if (gk20a_is_channel_marked_as_tsg(ch)) { - tsg = &g->fifo.tsg[ch->tsgid]; + tsg = tsg_gk20a_from_ch(ch); + if (tsg != NULL) { g->ops.fifo.disable_tsg(tsg); + return 0; } else { - g->ops.fifo.disable_channel(ch); + return -EINVAL; } - - return 0; } void gk20a_channel_abort_clean_up(struct channel_gk20a *ch) @@ -238,19 +236,8 @@ void gk20a_channel_abort(struct channel_gk20a *ch, bool channel_preempt) if (tsg != NULL) { return gk20a_fifo_abort_tsg(ch->g, tsg, channel_preempt); - } - - /* make sure new kickoffs are prevented */ - gk20a_channel_set_timedout(ch); - - ch->g->ops.fifo.disable_channel(ch); - - if (channel_preempt) { - ch->g->ops.fifo.preempt_channel(ch->g, ch); - } - - if (ch->g->ops.fifo.ch_abort_clean_up) { - ch->g->ops.fifo.ch_abort_clean_up(ch); + } else { + nvgpu_err(ch->g, "chid: %d is not bound to tsg", ch->chid); } } -- cgit v1.2.2