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 <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1469853
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
This commit is contained in:
Terje Bergstrom
2017-04-25 13:54:58 -07:00
committed by mobile promotions
parent 673dd97160
commit 0ebe462c13
7 changed files with 8 additions and 9 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -19,7 +19,6 @@
#define CHANNEL_GK20A_H
#include <linux/stacktrace.h>
#include <linux/wait.h>
#include <nvgpu/list.h>
#include <nvgpu/lock.h>
@@ -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;

View File

@@ -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);
}
}

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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);