From d84d7f8694562628e1ab41fd09d08b68f59e0b30 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 14 Jun 2017 15:11:58 +0300 Subject: gpu: nvgpu: use timeout API in ch poll worker Instead of using raw jiffies, use milliseconds and the nvgpu timeout API. The COND_WAIT API uses also just milliseconds. Jira NVGPU-83 Change-Id: I21b5e0880f0b6aa02856d7c207be97861e423b6b Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1502999 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 90202fd7..645183ba 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -1823,28 +1823,29 @@ static int gk20a_channel_poll_worker(void *arg) { struct gk20a *g = (struct gk20a *)arg; struct gk20a_channel_worker *worker = &g->channel_worker; - unsigned long start_wait; - /* event timeout for also polling the watchdog */ - unsigned long timeout = msecs_to_jiffies(100); + unsigned long watchdog_interval = 100; /* milliseconds */ + struct nvgpu_timeout timeout; int get = 0; gk20a_dbg_fn(""); - start_wait = jiffies; + nvgpu_timeout_init(g, &timeout, watchdog_interval, + NVGPU_TIMER_CPU_TIMER); while (!nvgpu_thread_should_stop(&worker->poll_task)) { int ret; ret = NVGPU_COND_WAIT( &worker->wq, __gk20a_channel_worker_pending(g, get), - jiffies_to_msecs(timeout)) > 0; + watchdog_interval) > 0; if (ret == 0) gk20a_channel_worker_process(g, &get); - if (jiffies - start_wait >= timeout) { + if (nvgpu_timeout_peek_expired(&timeout)) { gk20a_channel_poll_timeouts(g); - start_wait = jiffies; + nvgpu_timeout_init(g, &timeout, watchdog_interval, + NVGPU_TIMER_CPU_TIMER); } } return 0; -- cgit v1.2.2