summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2018-03-20 07:51:23 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-03-23 11:20:35 -0400
commitb5b4353ca6cc9b6457ddccc00bf87538291870fc (patch)
tree1e2334728031345a3cb042bcc934bb0d9e3b0f82 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parent2aead38194fb6f3166a9ccb501467f7b0662f6c1 (diff)
gpu: nvgpu: set safe state for user managed syncpoints
MAX/threshold value of user managed syncpoint is not tracked by nvgpu So if channel is reset by nvgpu there could be waiters still waiting on some user syncpoint fence Fix this by setting a large safe value to user managed syncpoint when aborting the channel and when closing the channel We right now increment the current value by 0x10000 which should be sufficient to release any pending waiter Bug 200326065 Jira NVGPU-179 Change-Id: Ie6432369bb4c21bd922c14b8d5a74c1477116f0b Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1678768 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> 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.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 78953558..65b17304 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -196,6 +196,8 @@ void gk20a_channel_abort_clean_up(struct channel_gk20a *ch)
196 nvgpu_mutex_acquire(&ch->sync_lock); 196 nvgpu_mutex_acquire(&ch->sync_lock);
197 if (ch->sync) 197 if (ch->sync)
198 ch->sync->set_min_eq_max(ch->sync); 198 ch->sync->set_min_eq_max(ch->sync);
199 if (ch->user_sync)
200 ch->user_sync->set_safe_state(ch->user_sync);
199 nvgpu_mutex_release(&ch->sync_lock); 201 nvgpu_mutex_release(&ch->sync_lock);
200 202
201 /* release all job semaphores (applies only to jobs that use 203 /* release all job semaphores (applies only to jobs that use
@@ -435,11 +437,18 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force)
435 /* sync must be destroyed before releasing channel vm */ 437 /* sync must be destroyed before releasing channel vm */
436 nvgpu_mutex_acquire(&ch->sync_lock); 438 nvgpu_mutex_acquire(&ch->sync_lock);
437 if (ch->sync) { 439 if (ch->sync) {
438 gk20a_channel_sync_destroy(ch->sync); 440 gk20a_channel_sync_destroy(ch->sync, false);
439 ch->sync = NULL; 441 ch->sync = NULL;
440 } 442 }
441 if (ch->user_sync) { 443 if (ch->user_sync) {
442 gk20a_channel_sync_destroy(ch->user_sync); 444 /*
445 * Set user managed syncpoint to safe state
446 * But it's already done if channel has timedout
447 */
448 if (ch->has_timedout)
449 gk20a_channel_sync_destroy(ch->user_sync, false);
450 else
451 gk20a_channel_sync_destroy(ch->user_sync, true);
443 ch->user_sync = NULL; 452 ch->user_sync = NULL;
444 } 453 }
445 nvgpu_mutex_release(&ch->sync_lock); 454 nvgpu_mutex_release(&ch->sync_lock);
@@ -1211,7 +1220,7 @@ clean_up_prealloc:
1211 channel_gk20a_free_prealloc_resources(c); 1220 channel_gk20a_free_prealloc_resources(c);
1212clean_up_sync: 1221clean_up_sync:
1213 if (c->sync) { 1222 if (c->sync) {
1214 gk20a_channel_sync_destroy(c->sync); 1223 gk20a_channel_sync_destroy(c->sync, false);
1215 c->sync = NULL; 1224 c->sync = NULL;
1216 } 1225 }
1217clean_up_unmap: 1226clean_up_unmap:
@@ -1905,7 +1914,8 @@ void gk20a_channel_clean_up_jobs(struct channel_gk20a *c,
1905 if (nvgpu_atomic_dec_and_test( 1914 if (nvgpu_atomic_dec_and_test(
1906 &c->sync->refcount) && 1915 &c->sync->refcount) &&
1907 g->aggressive_sync_destroy) { 1916 g->aggressive_sync_destroy) {
1908 gk20a_channel_sync_destroy(c->sync); 1917 gk20a_channel_sync_destroy(c->sync,
1918 false);
1909 c->sync = NULL; 1919 c->sync = NULL;
1910 } 1920 }
1911 nvgpu_mutex_release(&c->sync_lock); 1921 nvgpu_mutex_release(&c->sync_lock);