From 59e2c410a1dbb8667402e772f796ec21bb8db887 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 19 Apr 2017 09:52:41 -0700 Subject: gpu: nvgpu: Use usleep_range() instead of hrtimer FECS trace used hrtimer for sleeping between frames. The resolution does not need to be that high, and hrtimers are not portable, so replace the delay with nvpgu_usleep_range(). Bug 200290850 Change-Id: I10fc56fcf6f6d407413384d557ae4bfdfa4239ef Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1465761 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker Reviewed-by: Thomas Fleury Reviewed-by: Sachin Nikam GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index ffc5f9f5..174fdb18 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c @@ -37,7 +37,7 @@ */ #define GK20A_FECS_TRACE_NUM_RECORDS (1 << 6) #define GK20A_FECS_TRACE_HASH_BITS 8 /* 2^8 */ -#define GK20A_FECS_TRACE_FRAME_PERIOD_NS (1000000000ULL/60ULL) +#define GK20A_FECS_TRACE_FRAME_PERIOD_US (1000000ULL/60ULL) #define GK20A_FECS_TRACE_PTIMER_SHIFT 5 struct gk20a_fecs_trace_record { @@ -379,13 +379,13 @@ done: static int gk20a_fecs_trace_periodic_polling(void *arg) { struct gk20a *g = (struct gk20a *)arg; - struct timespec ts = ns_to_timespec(GK20A_FECS_TRACE_FRAME_PERIOD_NS); pr_info("%s: running\n", __func__); while (!kthread_should_stop()) { - hrtimer_nanosleep(&ts, NULL, HRTIMER_MODE_REL, CLOCK_MONOTONIC); + nvgpu_usleep_range(GK20A_FECS_TRACE_FRAME_PERIOD_US, + GK20A_FECS_TRACE_FRAME_PERIOD_US * 2); gk20a_fecs_trace_poll(g); } -- cgit v1.2.2