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: 118175 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4029228qgn; Tue, 7 Nov 2017 06:13:47 -0800 (PST) X-Google-Smtp-Source: ABhQp+Q/xP6tFSYt5Nryji56LPcV7p5TgHR7HC2pEEzR9OfYdQXiS01shtGSoS415v6NhOkLsWXL X-Received: by 10.99.121.130 with SMTP id u124mr19259601pgc.124.1510064027168; Tue, 07 Nov 2017 06:13:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510064027; cv=none; d=google.com; s=arc-20160816; b=cjNb7P0GVYBjVafOG4MOhT1gIDegpjoGTNaklpRkmVElagat1HPW8FvwmLBO1piMFy 1+dSTAULGhuJ3LUhf/sVfDZX8at5+oV8YNsq/ZUodVcMa2kFH90u2eBVii/rUw3+pw4j Qadd7Jmiu5zCQjJFPn1MNhoGu+uhJg/h8FHAS4vaj5IvTaqhU9aVPtDoKCPDBeWxcaCy bUlmkcEwxj3j7tYWy4lXKg5yH77SbDKG6p3FD74de3sfKYwcyU+VME8+85jSKxIf78tN ssmicIyUJVug+SPNX1PgepwY/JLsHm3XtKUtdJGybO5AZGZZDgoVdU4NJ+ST/nGvkMEd xOAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XgpRJlz5WA1k6BNdJ1lIGNEFd2bQTQTfeRHC51jC0VE=; b=shiYCwJnXLPXhkA04rH2BwwqICHjPmeQddIvpbD78uPY6sDRuz0HaZd32EDysSKCwG XE4De1ntieCEFzhbzOjDH9OOqobS98253VHmsoroV3zPeXUS5WfIbCqo18W5+GwOZ5Om 7ThvICUrhfDoK+9Ob1TXr/JF4/28YRaRbSpBQX2s/es7yMstAeDGqQcCNWzX8kG9KeSq O9FwrSH8IJvG3wKdxlUxjJ3XH8KF8VAPdCXiNUXElOO1K0rsNxkuTu9eAs/TqolrW+nW ehyzVr7AkyYu9kNMpxc7qCZGo+XubfleLOY0VZKdx1Ytfn1LX1aiID7DRQ/451xU2TxC xgUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-fbdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-fbdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si1261378ply.815.2017.11.07.06.13.46; Tue, 07 Nov 2017 06:13:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-fbdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-fbdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-fbdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933565AbdKGONp (ORCPT + 2 others); Tue, 7 Nov 2017 09:13:45 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:65035 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932671AbdKGONo (ORCPT ); Tue, 7 Nov 2017 09:13:44 -0500 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 Cc: Arnd Bergmann , Himanshu Jha , "Gustavo A. R. Silva" , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org 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== Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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(-) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);