diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 4d366fa9..ef9e3a37 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -458,6 +458,9 @@ static int gk20a_channel_semaphore_wait_fd( | |||
458 | goto fail; | 458 | goto fail; |
459 | } | 459 | } |
460 | 460 | ||
461 | /* worker takes one reference */ | ||
462 | gk20a_semaphore_get(w->sema); | ||
463 | |||
461 | gk20a_channel_alloc_priv_cmdbuf(c, 8, &wait_cmd); | 464 | gk20a_channel_alloc_priv_cmdbuf(c, 8, &wait_cmd); |
462 | if (wait_cmd == NULL) { | 465 | if (wait_cmd == NULL) { |
463 | gk20a_err(dev_from_gk20a(c->g), | 466 | gk20a_err(dev_from_gk20a(c->g), |
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index 1a28e660..3b1f1024 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c | |||
@@ -139,6 +139,7 @@ static const struct gk20a_fence_ops gk20a_semaphore_fence_ops = { | |||
139 | .is_expired = &gk20a_semaphore_fence_is_expired, | 139 | .is_expired = &gk20a_semaphore_fence_is_expired, |
140 | }; | 140 | }; |
141 | 141 | ||
142 | /* This function takes ownership of the semaphore */ | ||
142 | struct gk20a_fence *gk20a_fence_from_semaphore( | 143 | struct gk20a_fence *gk20a_fence_from_semaphore( |
143 | struct sync_timeline *timeline, | 144 | struct sync_timeline *timeline, |
144 | struct gk20a_semaphore *semaphore, | 145 | struct gk20a_semaphore *semaphore, |
@@ -163,7 +164,7 @@ struct gk20a_fence *gk20a_fence_from_semaphore( | |||
163 | #endif | 164 | #endif |
164 | return NULL; | 165 | return NULL; |
165 | } | 166 | } |
166 | gk20a_semaphore_get(semaphore); | 167 | |
167 | f->semaphore = semaphore; | 168 | f->semaphore = semaphore; |
168 | f->semaphore_wq = semaphore_wq; | 169 | f->semaphore_wq = semaphore_wq; |
169 | return f; | 170 | return f; |