From patchwork Tue Sep 15 15:49:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7187701 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36D81BEEC1 for ; Tue, 15 Sep 2015 15:52:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42580206A7 for ; Tue, 15 Sep 2015 15:52:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 560792069D for ; Tue, 15 Sep 2015 15:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754668AbbIOPtj (ORCPT ); Tue, 15 Sep 2015 11:49:39 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:50404 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817AbbIOPtc (ORCPT ); Tue, 15 Sep 2015 11:49:32 -0400 Received: from wuerfel.lan. ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0MVJlO-1Z6X4T2vyY-00Yk9Y; Tue, 15 Sep 2015 17:49:27 +0200 From: Arnd Bergmann To: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, y2038@lists.linaro.org, Mauro Carvalho Chehab , linux-api@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Arnd Bergmann Subject: [PATCH 4/7] [media] exynos4-is: use monotonic timestamps as advertized Date: Tue, 15 Sep 2015 17:49:05 +0200 Message-Id: <1442332148-488079-5-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.1.0.rc2 In-Reply-To: <1442332148-488079-1-git-send-email-arnd@arndb.de> References: <1442332148-488079-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:3s5kJnywpLvf9WJeqgHrEFVSFvwlLzEeDeqVUcJRrBSCpU90qx8 zBc0KLomwQ0Fb5hnAiIj+JGrNUHWtF7BXcwoVK/Dqe3a1uj3RV2Uf2D3m+dDCrTb9mCdgoy qVPLoc4n5xuYD9K2NpQxww7BtitZxZWcE9dArcN68Jz9piCn8rb7CRhSMNRelOGWpBAyXz6 p7VnXMlz83gwmftux7rYg== X-UI-Out-Filterresults: notjunk:1; V01:K0:/ENSl7Q5ujQ=:c0scthXACL+1BKpJB3LZAL Oy6E/AK+8HHtmv5m0lsOFWZ6rZ39lEPGqAgpf0IhCgI9dKDpPvADDHC3yr64mBYIzDk+OUXHo U8q9uH6QYni9uV2RHMJPufcG1hkJYLuP5m3shgj4f5aEZVVtSREAamouEmdzNZU8CvPwf2T25 WoMBReXziJrglRwqfiAG5MpdJkKbci3GROEmHWtZTLzC5pp3EATbZ5bqHAxtiDzj6dxAx34ip Jy1UpVWJkzhNGzkOwTTBOMLVgIwOA1v3XDfi+Xpx6imtuJHO9f94VlT6UCzxsUjqybfzhQjPO LKIsnHHPEbAWH2glGxRU51FbZpux2gmVRcqRe1JjpxORXC6CpieQZitR4dO8mYDkPjtjS974C +HF8BpuZ9QfUzXe9ZWLqmyCPWmZC+S/3LFDr4a4B+1JOwPcVHYspkMfQhB4rSXPv3DhkFFu/P clOGhe85CmH59wAKvZnUVjE+3nkSLbGxQXVz0Va8XaoY7LJxfLQxbvKajzoK68jIyB/U9iTWi YED3T4zT8lVb1ZIE3ZxU80aljWjDBPGt9xdrpCt6caxCBSo1Lu3O/3HbnQ+Jmt/KybfqkdXq3 4CewUz1GFcz+wmPQszAUWUeJkRKSBCjTAOeAXzUH9ZNkORFTKioGbPRWow8uXvBZMPoaCVKUY BKBHSDVQTJxzXa3wxReOPw6yi9rkMOTdiQMzkkGayDW/4JcEbgJ/Ze1cYzeFdpNRT/84= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The exynos4 fimc capture driver claims to use monotonic timestamps but calls ktime_get_real_ts(). This is both an incorrect API use, and a bad idea because of the y2038 problem and the fact that the wall clock time is not reliable for timestamps across suspend or settimeofday(). This changes the driver to use the normal v4l2_get_timestamp() function like all other drivers. Signed-off-by: Arnd Bergmann Acked-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-capture.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c index cfebf292e15a..776ea6d78d03 100644 --- a/drivers/media/platform/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/exynos4-is/fimc-capture.c @@ -183,8 +183,6 @@ void fimc_capture_irq_handler(struct fimc_dev *fimc, int deq_buf) struct v4l2_subdev *csis = p->subdevs[IDX_CSIS]; struct fimc_frame *f = &cap->ctx->d_frame; struct fimc_vid_buffer *v_buf; - struct timeval *tv; - struct timespec ts; if (test_and_clear_bit(ST_CAPT_SHUT, &fimc->state)) { wake_up(&fimc->irq_queue); @@ -193,13 +191,9 @@ void fimc_capture_irq_handler(struct fimc_dev *fimc, int deq_buf) if (!list_empty(&cap->active_buf_q) && test_bit(ST_CAPT_RUN, &fimc->state) && deq_buf) { - ktime_get_real_ts(&ts); - v_buf = fimc_active_queue_pop(cap); - tv = &v_buf->vb.v4l2_buf.timestamp; - tv->tv_sec = ts.tv_sec; - tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC; + v4l2_get_timestamp(&v_buf->vb.v4l2_buf.timestamp); v_buf->vb.v4l2_buf.sequence = cap->frame_count++; vb2_buffer_done(&v_buf->vb, VB2_BUF_STATE_DONE);