summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPeter Daifuku <pdaifuku@nvidia.com>2019-03-27 20:15:00 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-03-29 06:57:26 -0400
commit9e329ca39b64b9c96d1db70d750c287166af92d1 (patch)
treee70060d289798ce86653b6c54613fc2119350b76 /drivers
parente00804594b83781bc9f7c17ac68cd9c5dd30953c (diff)
gpu: nvgpu: tsg: ensure unbound channel is disabled
Multiple threads could be unbinding different channels from the same tsg at the same time. At the point where we remove the channel from the tsg's channel list, call disable_channel again, in case another thread had re-enabled the channel after we had disabled it. Bug 200404549 Change-Id: I9abbc08dc11fe1f7a0abada88376c0ef96b56610 Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2083337 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Satish Arora <satisha@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index f4b96b7a..a1844a28 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Graphics FIFO (gr host) 2 * GK20A Graphics FIFO (gr host)
3 * 3 *
4 * Copyright (c) 2011-2018, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2019, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"), 7 * copy of this software and associated documentation files (the "Software"),
@@ -2193,6 +2193,11 @@ int gk20a_fifo_tsg_unbind_channel(struct channel_gk20a *ch)
2193 nvgpu_rwsem_down_write(&tsg->ch_list_lock); 2193 nvgpu_rwsem_down_write(&tsg->ch_list_lock);
2194 nvgpu_list_del(&ch->ch_entry); 2194 nvgpu_list_del(&ch->ch_entry);
2195 ch->tsgid = NVGPU_INVALID_TSG_ID; 2195 ch->tsgid = NVGPU_INVALID_TSG_ID;
2196
2197 /* another thread could have re-enabled the channel because it was
2198 * still on the list at that time, so make sure it's truly disabled
2199 */
2200 g->ops.fifo.disable_channel(ch);
2196 nvgpu_rwsem_up_write(&tsg->ch_list_lock); 2201 nvgpu_rwsem_up_write(&tsg->ch_list_lock);
2197 2202
2198 /* 2203 /*