diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index 4d4d1690..c7adb76c 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c | |||
@@ -392,7 +392,6 @@ static int gk20a_channel_wait_semaphore(struct channel_gk20a *ch, | |||
392 | void *data; | 392 | void *data; |
393 | u32 *semaphore; | 393 | u32 *semaphore; |
394 | int ret = 0; | 394 | int ret = 0; |
395 | long remain; | ||
396 | 395 | ||
397 | /* do not wait if channel has timed out */ | 396 | /* do not wait if channel has timed out */ |
398 | if (ch->has_timedout) | 397 | if (ch->has_timedout) |
@@ -413,16 +412,11 @@ static int gk20a_channel_wait_semaphore(struct channel_gk20a *ch, | |||
413 | 412 | ||
414 | semaphore = data + (offset & ~PAGE_MASK); | 413 | semaphore = data + (offset & ~PAGE_MASK); |
415 | 414 | ||
416 | remain = NVGPU_COND_WAIT_INTERRUPTIBLE( | 415 | ret = NVGPU_COND_WAIT_INTERRUPTIBLE( |
417 | &ch->semaphore_wq, | 416 | &ch->semaphore_wq, |
418 | *semaphore == payload || ch->has_timedout, | 417 | *semaphore == payload || ch->has_timedout, |
419 | timeout); | 418 | timeout); |
420 | 419 | ||
421 | if (remain == 0 && *semaphore != payload) | ||
422 | ret = -ETIMEDOUT; | ||
423 | else if (remain < 0) | ||
424 | ret = remain; | ||
425 | |||
426 | dma_buf_kunmap(dmabuf, offset >> PAGE_SHIFT, data); | 420 | dma_buf_kunmap(dmabuf, offset >> PAGE_SHIFT, data); |
427 | cleanup_put: | 421 | cleanup_put: |
428 | dma_buf_put(dmabuf); | 422 | dma_buf_put(dmabuf); |