From 18643ac1357a845d204d6dabd98359a0ab0509a7 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Fri, 30 Nov 2018 10:57:05 +0530 Subject: gpu: nvgpu: replace input param chid with pointer to channel preempt_channel needs to use the channel to pass it to other public functions, get access to a tsg etc. This qualifies it to take a pointer to a channel as an input parameter instead of a chid. Increment the channel ref counter using the function gk20a_channel_from_id in functions where we get the chid from the h/w registers directly. Once the prempt_channel function call is done, use a gk20a_channel_put on the referenced channel. Jira NVGPU-1461 Change-Id: I6c87c8104cfcb418d468c8c590087fd4aeabf4bd Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/1963200 (cherry picked from commit 9abe9fe062367902ede7721cff55396859f8e4e8 in dev-kernel) Reviewed-on: https://git-master.nvidia.com/r/2013728 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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 6ac8e508..29720886 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -227,8 +227,8 @@ void gk20a_channel_abort(struct channel_gk20a *ch, bool channel_preempt) ch->g->ops.fifo.disable_channel(ch); - if (channel_preempt && gk20a_is_channel_marked_as_tsg(ch)) { - ch->g->ops.fifo.preempt_channel(ch->g, ch->chid); + if (channel_preempt) { + ch->g->ops.fifo.preempt_channel(ch->g, ch); } if (ch->g->ops.fifo.ch_abort_clean_up) { -- cgit v1.2.2