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 <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1465761
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Terje Bergstrom
2017-04-19 09:52:41 -07:00
committed by mobile promotions
parent 0d8f5f3fdb
commit 59e2c410a1

View File

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