From e6edb10656c86bbc8918c63ae99be25c2e343a99 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 15 Jun 2017 11:15:51 +0300 Subject: gpu: nvgpu: use time API in channel ref action debug Save the time using nvgpu_current_time_ms() instead of the Linux-specific jiffies counter. Jira NVGPU-83 Change-Id: I19b4296d8b64ddf52506144e77d151f668ff7838 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1503002 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 645183ba..1caecf3d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -627,8 +627,8 @@ static void gk20a_channel_dump_ref_actions(struct channel_gk20a *ch) { #if GK20A_CHANNEL_REFCOUNT_TRACKING size_t i, get; - unsigned long now = jiffies; - unsigned long prev_jiffies = 0; + s64 now = nvgpu_current_time_ms(); + s64 prev = 0; struct device *dev = dev_from_gk20a(ch->g); nvgpu_spinlock_acquire(&ch->ref_actions_lock); @@ -651,11 +651,11 @@ static void gk20a_channel_dump_ref_actions(struct channel_gk20a *ch) act->type == channel_gk20a_ref_action_get ? "GET" : "PUT", GK20A_CHANNEL_REFCOUNT_TRACKING - 1 - i, - jiffies_to_msecs(now - act->jiffies), - jiffies_to_msecs(act->jiffies - prev_jiffies)); + now - act->timestamp_ms, + act->timestamp_ms - prev); print_stack_trace(&act->trace, 0); - prev_jiffies = act->jiffies; + prev = act->timestamp_ms; } get = (get + 1) % GK20A_CHANNEL_REFCOUNT_TRACKING; @@ -680,7 +680,7 @@ static void gk20a_channel_save_ref_source(struct channel_gk20a *ch, act->trace.skip = 3; /* onwards from the caller of this */ act->trace.entries = act->trace_entries; save_stack_trace(&act->trace); - act->jiffies = jiffies; + act->timestamp_ms = nvgpu_current_time_ms(); ch->ref_actions_put = (ch->ref_actions_put + 1) % GK20A_CHANNEL_REFCOUNT_TRACKING; -- cgit v1.2.2