summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/os/linux/ioctl_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/ioctl_channel.c')
-rw-r--r--drivers/gpu/nvgpu/os/linux/ioctl_channel.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c
index 45d49474..d0d4b1af 100644
--- a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c
+++ b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c
@@ -636,8 +636,9 @@ static int gk20a_channel_wait_semaphore(struct channel_gk20a *ch,
636 int ret = 0; 636 int ret = 0;
637 637
638 /* do not wait if channel has timed out */ 638 /* do not wait if channel has timed out */
639 if (ch->has_timedout) 639 if (gk20a_channel_check_timedout(ch)) {
640 return -ETIMEDOUT; 640 return -ETIMEDOUT;
641 }
641 642
642 dmabuf = dma_buf_get(id); 643 dmabuf = dma_buf_get(id);
643 if (IS_ERR(dmabuf)) { 644 if (IS_ERR(dmabuf)) {
@@ -656,7 +657,8 @@ static int gk20a_channel_wait_semaphore(struct channel_gk20a *ch,
656 657
657 ret = NVGPU_COND_WAIT_INTERRUPTIBLE( 658 ret = NVGPU_COND_WAIT_INTERRUPTIBLE(
658 &ch->semaphore_wq, 659 &ch->semaphore_wq,
659 *semaphore == payload || ch->has_timedout, 660 *semaphore == payload ||
661 gk20a_channel_check_timedout(ch),
660 timeout); 662 timeout);
661 663
662 dma_buf_kunmap(dmabuf, offset >> PAGE_SHIFT, data); 664 dma_buf_kunmap(dmabuf, offset >> PAGE_SHIFT, data);
@@ -680,8 +682,9 @@ static int gk20a_channel_wait(struct channel_gk20a *ch,
680 682
681 nvgpu_log_fn(g, " "); 683 nvgpu_log_fn(g, " ");
682 684
683 if (ch->has_timedout) 685 if (gk20a_channel_check_timedout(ch)) {
684 return -ETIMEDOUT; 686 return -ETIMEDOUT;
687 }
685 688
686 switch (args->type) { 689 switch (args->type) {
687 case NVGPU_WAIT_TYPE_NOTIFIER: 690 case NVGPU_WAIT_TYPE_NOTIFIER:
@@ -716,7 +719,8 @@ static int gk20a_channel_wait(struct channel_gk20a *ch,
716 * calling this ioctl */ 719 * calling this ioctl */
717 remain = NVGPU_COND_WAIT_INTERRUPTIBLE( 720 remain = NVGPU_COND_WAIT_INTERRUPTIBLE(
718 &ch->notifier_wq, 721 &ch->notifier_wq,
719 notif->status == 0 || ch->has_timedout, 722 notif->status == 0 ||
723 gk20a_channel_check_timedout(ch),
720 args->timeout); 724 args->timeout);
721 725
722 if (remain == 0 && notif->status != 0) { 726 if (remain == 0 && notif->status != 0) {
@@ -786,8 +790,9 @@ static int gk20a_ioctl_channel_submit_gpfifo(
786 profile = gk20a_fifo_profile_acquire(ch->g); 790 profile = gk20a_fifo_profile_acquire(ch->g);
787 gk20a_fifo_profile_snapshot(profile, PROFILE_IOCTL_ENTRY); 791 gk20a_fifo_profile_snapshot(profile, PROFILE_IOCTL_ENTRY);
788 792
789 if (ch->has_timedout) 793 if (gk20a_channel_check_timedout(ch)) {
790 return -ETIMEDOUT; 794 return -ETIMEDOUT;
795 }
791 796
792 nvgpu_get_fence_args(&args->fence, &fence); 797 nvgpu_get_fence_args(&args->fence, &fence);
793 submit_flags = 798 submit_flags =
@@ -1249,7 +1254,7 @@ long gk20a_channel_ioctl(struct file *filp,
1249 } 1254 }
1250 case NVGPU_IOCTL_CHANNEL_GET_TIMEDOUT: 1255 case NVGPU_IOCTL_CHANNEL_GET_TIMEDOUT:
1251 ((struct nvgpu_get_param_args *)buf)->value = 1256 ((struct nvgpu_get_param_args *)buf)->value =
1252 ch->has_timedout; 1257 gk20a_channel_check_timedout(ch);
1253 break; 1258 break;
1254 case NVGPU_IOCTL_CHANNEL_ENABLE: 1259 case NVGPU_IOCTL_CHANNEL_ENABLE:
1255 err = gk20a_busy(ch->g); 1260 err = gk20a_busy(ch->g);