diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 10 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 9 |
2 files changed, 6 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 6cb77d67..4ee1ab43 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -409,7 +409,7 @@ static void gk20a_wait_until_counter_is_N( | |||
409 | if (NVGPU_COND_WAIT( | 409 | if (NVGPU_COND_WAIT( |
410 | c, | 410 | c, |
411 | atomic_read(counter) == wait_value, | 411 | atomic_read(counter) == wait_value, |
412 | msecs_to_jiffies(5000)) > 0) | 412 | 5000) == 0) |
413 | break; | 413 | break; |
414 | 414 | ||
415 | nvgpu_warn(ch->g, | 415 | nvgpu_warn(ch->g, |
@@ -1798,14 +1798,14 @@ static int gk20a_channel_poll_worker(void *arg) | |||
1798 | 1798 | ||
1799 | start_wait = jiffies; | 1799 | start_wait = jiffies; |
1800 | while (!nvgpu_thread_should_stop(&worker->poll_task)) { | 1800 | while (!nvgpu_thread_should_stop(&worker->poll_task)) { |
1801 | bool got_events; | 1801 | int ret; |
1802 | 1802 | ||
1803 | got_events = NVGPU_COND_WAIT( | 1803 | ret = NVGPU_COND_WAIT( |
1804 | &worker->wq, | 1804 | &worker->wq, |
1805 | __gk20a_channel_worker_pending(g, get), | 1805 | __gk20a_channel_worker_pending(g, get), |
1806 | timeout) > 0; | 1806 | jiffies_to_msecs(timeout)) > 0; |
1807 | 1807 | ||
1808 | if (got_events) | 1808 | if (ret == 0) |
1809 | gk20a_channel_worker_process(g, &get); | 1809 | gk20a_channel_worker_process(g, &get); |
1810 | 1810 | ||
1811 | if (jiffies - start_wait >= timeout) { | 1811 | if (jiffies - start_wait >= timeout) { |
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index 3964c37d..7c5d33c7 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c | |||
@@ -203,20 +203,13 @@ void gk20a_init_fence(struct gk20a_fence *f, | |||
203 | 203 | ||
204 | static int nvgpu_semaphore_fence_wait(struct gk20a_fence *f, long timeout) | 204 | static int nvgpu_semaphore_fence_wait(struct gk20a_fence *f, long timeout) |
205 | { | 205 | { |
206 | long remain; | ||
207 | |||
208 | if (!nvgpu_semaphore_is_acquired(f->semaphore)) | 206 | if (!nvgpu_semaphore_is_acquired(f->semaphore)) |
209 | return 0; | 207 | return 0; |
210 | 208 | ||
211 | remain = NVGPU_COND_WAIT_INTERRUPTIBLE( | 209 | return NVGPU_COND_WAIT_INTERRUPTIBLE( |
212 | f->semaphore_wq, | 210 | f->semaphore_wq, |
213 | !nvgpu_semaphore_is_acquired(f->semaphore), | 211 | !nvgpu_semaphore_is_acquired(f->semaphore), |
214 | timeout); | 212 | timeout); |
215 | if (remain == 0 && nvgpu_semaphore_is_acquired(f->semaphore)) | ||
216 | return -ETIMEDOUT; | ||
217 | else if (remain < 0) | ||
218 | return remain; | ||
219 | return 0; | ||
220 | } | 213 | } |
221 | 214 | ||
222 | static bool nvgpu_semaphore_fence_is_expired(struct gk20a_fence *f) | 215 | static bool nvgpu_semaphore_fence_is_expired(struct gk20a_fence *f) |