From 0ebe462c130108a027f85bcb6736fed2ef74204e Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 25 Apr 2017 13:54:58 -0700 Subject: gpu: nvgpu: Use nvgpu_cond in notifier wq Change notifier wait queue to use nvgpu_cond instead of Linux wait queue. JIRA NVGPU-14 Change-Id: I197a0ef6c0a2331ca0dbb3480bdb89d45ba73020 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1469853 Reviewed-by: Alex Waterman Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 4 ++-- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 3 +-- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 2 +- drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | 2 +- drivers/gpu/nvgpu/vgpu/gr_vgpu.c | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index d81328f0..2c9fac0b 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c @@ -476,8 +476,8 @@ static int gk20a_channel_wait(struct channel_gk20a *ch, /* user should set status pending before * calling this ioctl */ - remain = wait_event_interruptible_timeout( - ch->notifier_wq, + remain = NVGPU_COND_WAIT_INTERRUPTIBLE( + &ch->notifier_wq, notif->status == 0 || ch->has_timedout, timeout); diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 13abed95..fad6b6af 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -867,7 +867,7 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g, /* The channel is *not* runnable at this point. It still needs to have * an address space bound and allocate a gpfifo and grctx. */ - init_waitqueue_head(&ch->notifier_wq); + nvgpu_cond_init(&ch->notifier_wq); nvgpu_cond_init(&ch->semaphore_wq); ch->update_fn = NULL; diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index 4bca4edb..a636e13c 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h @@ -19,7 +19,6 @@ #define CHANNEL_GK20A_H #include -#include #include #include @@ -218,7 +217,7 @@ struct channel_gk20a { struct priv_cmd_queue priv_cmd_q; - wait_queue_head_t notifier_wq; + struct nvgpu_cond notifier_wq; struct nvgpu_cond semaphore_wq; u32 timeout_accumulated_ms; diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 46560a56..9141264b 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -1358,7 +1358,7 @@ static void gk20a_fifo_set_has_timedout_and_wake_up_wqs(struct gk20a *g, wmb(); /* unblock pending waits */ nvgpu_cond_broadcast_interruptible(&refch->semaphore_wq); - wake_up(&refch->notifier_wq); + nvgpu_cond_broadcast_interruptible(&refch->notifier_wq); } } diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 2cf55119..f8e05818 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -5873,7 +5873,7 @@ static int gk20a_gr_handle_notify_pending(struct gk20a *g, nvgpu_mutex_release(&ch->cyclestate.cyclestate_buffer_mutex); #endif gk20a_dbg_fn(""); - wake_up(&ch->notifier_wq); + nvgpu_cond_broadcast_interruptible(&ch->notifier_wq); return 0; } diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c index 5fbe7227..8d12bb42 100644 --- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c @@ -724,7 +724,7 @@ static void vgpu_fifo_set_ctx_mmu_error(struct gk20a *g, wmb(); /* unblock pending waits */ nvgpu_cond_broadcast_interruptible(&ch->semaphore_wq); - wake_up(&ch->notifier_wq); + nvgpu_cond_broadcast_interruptible(&ch->notifier_wq); } int vgpu_fifo_isr(struct gk20a *g, struct tegra_vgpu_fifo_intr_info *info) diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index 2198b115..a001b54e 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c @@ -925,7 +925,7 @@ int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info) switch (info->type) { case TEGRA_VGPU_GR_INTR_NOTIFY: - wake_up(&ch->notifier_wq); + nvgpu_cond_broadcast_interruptible(&ch->notifier_wq); break; case TEGRA_VGPU_GR_INTR_SEMAPHORE: nvgpu_cond_broadcast_interruptible(&ch->semaphore_wq); -- cgit v1.2.2