diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 15 |
1 files changed, 8 insertions, 7 deletions
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) | |||
1823 | { | 1823 | { |
1824 | struct gk20a *g = (struct gk20a *)arg; | 1824 | struct gk20a *g = (struct gk20a *)arg; |
1825 | struct gk20a_channel_worker *worker = &g->channel_worker; | 1825 | struct gk20a_channel_worker *worker = &g->channel_worker; |
1826 | unsigned long start_wait; | 1826 | unsigned long watchdog_interval = 100; /* milliseconds */ |
1827 | /* event timeout for also polling the watchdog */ | 1827 | struct nvgpu_timeout timeout; |
1828 | unsigned long timeout = msecs_to_jiffies(100); | ||
1829 | int get = 0; | 1828 | int get = 0; |
1830 | 1829 | ||
1831 | gk20a_dbg_fn(""); | 1830 | gk20a_dbg_fn(""); |
1832 | 1831 | ||
1833 | start_wait = jiffies; | 1832 | nvgpu_timeout_init(g, &timeout, watchdog_interval, |
1833 | NVGPU_TIMER_CPU_TIMER); | ||
1834 | while (!nvgpu_thread_should_stop(&worker->poll_task)) { | 1834 | while (!nvgpu_thread_should_stop(&worker->poll_task)) { |
1835 | int ret; | 1835 | int ret; |
1836 | 1836 | ||
1837 | ret = NVGPU_COND_WAIT( | 1837 | ret = NVGPU_COND_WAIT( |
1838 | &worker->wq, | 1838 | &worker->wq, |
1839 | __gk20a_channel_worker_pending(g, get), | 1839 | __gk20a_channel_worker_pending(g, get), |
1840 | jiffies_to_msecs(timeout)) > 0; | 1840 | watchdog_interval) > 0; |
1841 | 1841 | ||
1842 | if (ret == 0) | 1842 | if (ret == 0) |
1843 | gk20a_channel_worker_process(g, &get); | 1843 | gk20a_channel_worker_process(g, &get); |
1844 | 1844 | ||
1845 | if (jiffies - start_wait >= timeout) { | 1845 | if (nvgpu_timeout_peek_expired(&timeout)) { |
1846 | gk20a_channel_poll_timeouts(g); | 1846 | gk20a_channel_poll_timeouts(g); |
1847 | start_wait = jiffies; | 1847 | nvgpu_timeout_init(g, &timeout, watchdog_interval, |
1848 | NVGPU_TIMER_CPU_TIMER); | ||
1848 | } | 1849 | } |
1849 | } | 1850 | } |
1850 | return 0; | 1851 | return 0; |