From patchwork Tue Nov 7 14:13:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10046753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BA6BB60247 for ; Tue, 7 Nov 2017 14:13:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFA5528EC3 for ; Tue, 7 Nov 2017 14:13:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A406D28FDE; Tue, 7 Nov 2017 14:13:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 28F5128EC3 for ; Tue, 7 Nov 2017 14:13:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CF706E2A5; Tue, 7 Nov 2017 14:13:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id 847116E2A5 for ; Tue, 7 Nov 2017 14:13:41 +0000 (UTC) Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0MRQMu-1eehL70GsK-00Sgll; Tue, 07 Nov 2017 15:13:21 +0100 From: Arnd Bergmann To: Bartlomiej Zolnierkiewicz Subject: [PATCH 1/2] fbdev: pxa3xx: use ktime_get_ts64 for time stamps Date: Tue, 7 Nov 2017 15:13:05 +0100 Message-Id: <20171107141319.3390036-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:zrBNnQy7F1GiLqfnkkgoEcPMZJOuxMKHnmtRX8/mcFKsQm8xXOY 87jJSDNXrdKvQ7EHawdYA5IiOIagJXFXNU34mz0X82uwR/6/PGasL6HxnvKCI47pGti8hH2 0i71d/X2wU3wnRgnlKnHr7IHVX5lnyZNW0++QUzsT2E8iSsXOttAsNDhGn1RvLocy0W+/ix QS0yHozoQeT/0FMVbAoRQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Mz1SyV0OOZY=:HvKuEUiB6h5Hj66HDHlOa8 NIdF9EkUSOz3vk/EXlXj2wi/l2XxLmu8Tv29EeAJ1lprjB9F/6XVoPMGKsbRxB1yFJOSkl3QL 75vF8vy6kAEX7p2iR64OTW5jShZOS4Y0B19ljsbJ2IXakeiKFG5sWZid7UETGplEFEaiDumLX lqBECiyt0d4FkwWRhL+A/p+nSWRJjTUccDlVHmdzNrjXcqSyVtjOflixROrxZC2ZnRXUgBXeu 3vp1lU/0itzg+cYbnoN3cJMquj7Vt8NI8XZAQycYa8fn9z9HNdwFOY3mi7YwBYpnF3CkxMZ8U XHNR7pCMPvuvz2IYt2wp0mIy1BpP+byeBjyoV+2NQeBM9ybm+vE1+h3wXMJ0AsZX6J4xKmNlD iGaIQLZDCGcrQvRnU5yKR1JEmbAKzZn0twh043NXmkc01BUQinnhm09jeXmzk3u1MgMoQkJM5 bvi/0ekvj0v5QpNkaztbtOer+sDmVBi82ZU0RlngZZx+ZhEXsZFdwaRnk7QQE+XfYnr7/TASC LQvQAd3EaJGo2DsMBulFjhGpqk6yEYgFavDDxblRrvi7AYCrp0AQkilYx8c5QcvlmWISdDl1x /Lv5trgLd2eY6WYh2vvPva58xk514rnnN9GT620rADSS4mySKrHcs4XU0kUuXgxupAfZx5/gc WFUaPkSrhqbJS5R6+UcX2NPCdi5YtfqwDkVh59gNC3xPutH5J3PrUtQY+B7SwtjewgxjmsX3j Dd21wVl6tG2D/stChH2ECmHr3Z1i9xSNYlErXQ== Cc: linux-fbdev@vger.kernel.org, Arnd Bergmann , "Gustavo A. R. Silva" , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Himanshu Jha X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/video/fbdev/pxa3xx-gcu.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index 3366076f9e0f..ddca4425adc8 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -104,7 +104,7 @@ struct pxa3xx_gcu_priv { wait_queue_head_t wait_idle; wait_queue_head_t wait_free; spinlock_t spinlock; - struct timeval base_time; + struct timespec64 base_time; struct pxa3xx_gcu_batch *free; struct pxa3xx_gcu_batch *ready; @@ -126,18 +126,20 @@ gc_writel(struct pxa3xx_gcu_priv *priv, unsigned int off, unsigned long val) #define QPRINT(priv, level, msg) \ do { \ - struct timeval tv; \ + struct timespec64 ts; \ struct pxa3xx_gcu_shared *shared = priv->shared; \ u32 base = gc_readl(priv, REG_GCRBBR); \ \ - do_gettimeofday(&tv); \ + ktime_get_ts64(&ts); \ + ts = timespec64_sub(ts, priv->base_time); \ \ - printk(level "%ld.%03ld.%03ld - %-17s: %-21s (%s, " \ + printk(level "%lld.%03ld.%03ld - %-17s: %-21s (%s, " \ "STATUS " \ "0x%02lx, B 0x%08lx [%ld], E %5ld, H %5ld, " \ "T %5ld)\n", \ - tv.tv_sec - priv->base_time.tv_sec, \ - tv.tv_usec / 1000, tv.tv_usec % 1000, \ + (s64)(tv.tv_sec), \ + tv.tv_usec / NSEC_PER_MSEC, \ + (tv.tv_usec % NSEC_PER_MSEC) / USEC_PER_MSEC, \ __func__, msg, \ shared->hw_running ? "running" : " idle", \ gc_readl(priv, REG_GCISCR), \ @@ -164,7 +166,7 @@ pxa3xx_gcu_reset(struct pxa3xx_gcu_priv *priv) priv->shared->buffer_phys = priv->shared_phys; priv->shared->magic = PXA3XX_GCU_SHARED_MAGIC; - do_gettimeofday(&priv->base_time); + ktime_get_ts64(&priv->base_time); /* set up the ring buffer pointers */ gc_writel(priv, REG_GCRBLR, 0);