drm/msm/gpu: avoid deprecated do_gettimeofday
authorArnd Bergmann <arnd@arndb.de>
Thu, 26 Jul 2018 12:39:25 +0000 (14:39 +0200)
committerRob Clark <robdclark@gmail.com>
Mon, 30 Jul 2018 12:50:12 +0000 (08:50 -0400)
All users of do_gettimeofday() have been removed, but this one recently
crept in, along with an incorrect printing of the microseconds portion.

This converts it to using ktime_get_real_timespec64() as a direct
replacement, and adds the leading zeroes. I considered using monotonic
times (ktime_get()) instead, but as this timestamp appears to only
be used for humans rather than compared with other timestamps, the
real time domain is probably good enough.

Fixes: e43b045e2c82 ("drm/msm/gpu: Capture the state of the GPU")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/adreno_gpu.c
drivers/gpu/drm/msm/msm_gpu.c
drivers/gpu/drm/msm/msm_gpu.h

index 08d3c618b7de95a74d458bd9bd4fb0ce510a25bb..38ac50b7382950078c68c5ef9f7124d571449b25 100644 (file)
@@ -376,7 +376,7 @@ int adreno_gpu_state_get(struct msm_gpu *gpu, struct msm_gpu_state *state)
 
        kref_init(&state->ref);
 
-       do_gettimeofday(&state->time);
+       ktime_get_real_ts64(&state->time);
 
        for (i = 0; i < gpu->nr_rings; i++) {
                int size = 0, j;
index 3cf8e8d29812cd54ce9bc0f6b3258961fa5ebdf6..f388944c93e2750a5b3092fee535b400e5fa63ca 100644 (file)
@@ -297,8 +297,8 @@ static ssize_t msm_gpu_devcoredump_read(char *buffer, loff_t offset,
        drm_printf(&p, "---\n");
        drm_printf(&p, "kernel: " UTS_RELEASE "\n");
        drm_printf(&p, "module: " KBUILD_MODNAME "\n");
-       drm_printf(&p, "time: %ld.%ld\n",
-               state->time.tv_sec, state->time.tv_usec);
+       drm_printf(&p, "time: %lld.%09ld\n",
+               state->time.tv_sec, state->time.tv_nsec);
        if (state->comm)
                drm_printf(&p, "comm: %s\n", state->comm);
        if (state->cmd)
index 57380ef8d1f7cde36d1831002651c7b94665d0fe..1c6105bc55c767735e13c771c66ebe1d243cc859 100644 (file)
@@ -189,7 +189,7 @@ struct msm_gpu_state_bo {
 
 struct msm_gpu_state {
        struct kref ref;
-       struct timeval time;
+       struct timespec64 time;
 
        struct {
                u64 iova;