Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: pxa3xx: use ktime_get_ts64 for time stamps

do_gettimeofday() is deprecated because it is not y2038 safe, so I'm
changing the calculation for the diagnostic output over to using
'timespec64'.

We really only print time deltas here, so changing it to monotonic
time makes this more robust, the correct accessor for this is
ktime_get_ts64().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Arnd Bergmann and committed by
Bartlomiej Zolnierkiewicz
f7a75354 63a4be93

+9 -7
+9 -7
drivers/video/fbdev/pxa3xx-gcu.c
··· 104 104 wait_queue_head_t wait_idle; 105 105 wait_queue_head_t wait_free; 106 106 spinlock_t spinlock; 107 - struct timeval base_time; 107 + struct timespec64 base_time; 108 108 109 109 struct pxa3xx_gcu_batch *free; 110 110 struct pxa3xx_gcu_batch *ready; ··· 126 126 127 127 #define QPRINT(priv, level, msg) \ 128 128 do { \ 129 - struct timeval tv; \ 129 + struct timespec64 ts; \ 130 130 struct pxa3xx_gcu_shared *shared = priv->shared; \ 131 131 u32 base = gc_readl(priv, REG_GCRBBR); \ 132 132 \ 133 - do_gettimeofday(&tv); \ 133 + ktime_get_ts64(&ts); \ 134 + ts = timespec64_sub(ts, priv->base_time); \ 134 135 \ 135 - printk(level "%ld.%03ld.%03ld - %-17s: %-21s (%s, " \ 136 + printk(level "%lld.%03ld.%03ld - %-17s: %-21s (%s, " \ 136 137 "STATUS " \ 137 138 "0x%02lx, B 0x%08lx [%ld], E %5ld, H %5ld, " \ 138 139 "T %5ld)\n", \ 139 - tv.tv_sec - priv->base_time.tv_sec, \ 140 - tv.tv_usec / 1000, tv.tv_usec % 1000, \ 140 + (s64)(ts.tv_sec), \ 141 + ts.tv_nsec / NSEC_PER_MSEC, \ 142 + (ts.tv_nsec % NSEC_PER_MSEC) / USEC_PER_MSEC, \ 141 143 __func__, msg, \ 142 144 shared->hw_running ? "running" : " idle", \ 143 145 gc_readl(priv, REG_GCISCR), \ ··· 166 164 priv->shared->buffer_phys = priv->shared_phys; 167 165 priv->shared->magic = PXA3XX_GCU_SHARED_MAGIC; 168 166 169 - do_gettimeofday(&priv->base_time); 167 + ktime_get_ts64(&priv->base_time); 170 168 171 169 /* set up the ring buffer pointers */ 172 170 gc_writel(priv, REG_GCRBLR, 0);