summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2018-05-05 11:10:48 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-10 05:13:58 -0400
commit90b2f780d414d993571dceccafbc01b371068782 (patch)
tree22eacf1ab70196ab9373ebe903e881bc05d22352 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parent6ad9862657469e7dac343d7857f907967f6d4c76 (diff)
gpu: nvgpu: support TSG IOCTL to unbind channel
We so far do not support unbinding a channel from TSG explicitly through IOCTL Channel is unbound from TSG when channel fd is closed But this could create issue in case process is forked and fd is duplicated In worst case it is possible that duplicate fd is closed sometime later when TSG is active and that could lead to corruption of TSG state Fix this by implementing NVGPU_TSG_IOCTL_UNBIND_CHANNEL API This API will simply call gk20a_tsg_unbind_channel() API to unbind the channel Note that we also mark the channel has_timedout since unbound channel does not have any context of its own and it cannot serve any job Remove call to gk20a_disable_channel() while closing the channel. We do not support bare channels without TSG, and if channel is not part of TSG then it means channel is already unbound from TSG with call to NVGPU_TSG_IOCTL_UNBIND_CHANNEL, and there is nothing to do while closing the channel Bug 200327095 Jira NVGPU-229 Change-Id: Ib7f6710f0dc8125caafabe7bee737622c3dd9fa3 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1708902 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 21abdf9a..0c199146 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -314,7 +314,11 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force)
314 "failed to unbind channel %d from TSG", 314 "failed to unbind channel %d from TSG",
315 ch->chid); 315 ch->chid);
316 } else { 316 } else {
317 gk20a_disable_channel(ch); 317 /*
318 * Channel is already unbound from TSG by User with
319 * explicit call
320 * Nothing to do here in that case
321 */
318 } 322 }
319 } 323 }
320 /* wait until there's only our ref to the channel */ 324 /* wait until there's only our ref to the channel */