From patchwork Fri Nov 10 15:37:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10053371 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 7DBBF60631 for ; Fri, 10 Nov 2017 15:39:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EA372B375 for ; Fri, 10 Nov 2017 15:39:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63AD52B377; Fri, 10 Nov 2017 15:39:01 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E1EE2B375 for ; Fri, 10 Nov 2017 15:39:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753219AbdKJPhu (ORCPT ); Fri, 10 Nov 2017 10:37:50 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:49938 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752929AbdKJPhs (ORCPT ); Fri, 10 Nov 2017 10:37:48 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lkxnh-1ekrUs1VbR-00apFp; Fri, 10 Nov 2017 16:37:31 +0100 From: Arnd Bergmann To: Anil Gurumurthy , Sudarsana Kalluru , "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, y2038@lists.linaro.org, hch@lst.de, hare@suse.com, jthumshirn@suse.de, Arnd Bergmann Subject: [PATCH 1/7] scsi: bfa: use ktime_get_real_ts64 for firmware timestamp Date: Fri, 10 Nov 2017 16:37:09 +0100 Message-Id: <20171110153715.1929456-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171110153715.1929456-1-arnd@arndb.de> References: <20171110153715.1929456-1-arnd@arndb.de> X-Provags-ID: V03:K0:KaLg+egeRfhBIhP6+g1ypHG2oA09owQTKOQOIcnN76U/6hroPi3 T6z0iVsaWLyrnsRWp3hgmq/yQGn8e4LjswQ6X96zOSvXNa9JPBCURYqYMewvDXfvWVCQtBi epGKEX8/hpKZSb78n8wI1qDuNq3BTZ9NPn9kTJR3qmLwqwLQmRij1D/GgTHd+ONk4Xtd0Z0 R0qBrdVcONjqrOk9QRBeg== X-UI-Out-Filterresults: notjunk:1; V01:K0:wkTVqXffYcg=:o5At62PTY2h+2lnkS0VC0o qNX1vKMLyz3UUbVIx52ItMyK27w4AXjGp+i0GmnP0Ey4xKuO6+5waGAvKdjYk6e6MpcHl+wba Mxnc0HEwiXBMVdzNWCyImK28Pvg2C2DSuysXwu3I9miQbPOVLNZpWrLhm/8evGRYFFRSFyt0t LF2dVzP9nE8n9wF4vCF1NvVOCDr5k38rdKe/pEAOw6rhCTIt2zWesg60LZfi+1WTobT4tglQ+ paHy5857KvNnv1iNugdtLhiMW0T/d/D+ehYirDdOJTB+jVo0zrxBb935nIUKFLp91DEtB8fxm jadgYDapdG50GicP9lARPdKwDR8EQCUarIDj5bKd5xEGLACsHh3076/zeyh4SAy1E9aw6bjiy IzroeqHJUvb1B00fAtvcCsnY6yKESWWrhWpJSe2ZgS4FeKSWJ+YlZfHoufkCL4x/8G+vJ0K9b n7y5vBqb3JTygQ16yPL3Mq/t9hYnrtUR/Z2PIcgwXFg2wzKd4kzNsa73o8alAAudHy+Xv3mNn YahgZ7QUPv+g3VCCySmdwfFf5nGptetkCI668gzDuqacAQp41fsUL/vfG3GPlzOgd3hdCWxCV sJBFcT8U0Bc+AWdZ7J+9wYd+5obBIgWNH+ZeYFYNZWGzDlh6ALopvcyDlzwebLF4cV2b9WUIN I4IxmQfIHzRKLptO8XNEsRevVXlwAceKSiOZmzM/tBHbl9RcXqBGhiSIuR44DoRoKKmfmBLxp BSuMqj4SYhN/N2bkXT1Z1ws21IVgeCsY8ZxpZQ== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP BFA_TRC_TS() calculates a 32-bit microsecond timestamp using the deprecated do_gettimeofday() function. This overflows roughly every 71 minutes, so it's obviously not used as an absolute time stamp, but it seems wrong to use a time base for it that will jump during settimeofday() calls, leap seconds, or the y2038 overflow. This converts it to ktime_get_ts64(), which has none of those problems but is not synchronized to wall-clock time. Signed-off-by: Arnd Bergmann --- drivers/scsi/bfa/bfa_cs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/bfa/bfa_cs.h b/drivers/scsi/bfa/bfa_cs.h index df6760ca0911..9685efc59b16 100644 --- a/drivers/scsi/bfa/bfa_cs.h +++ b/drivers/scsi/bfa/bfa_cs.h @@ -35,10 +35,10 @@ #define BFA_TRC_TS(_trcm) \ ({ \ - struct timeval tv; \ + struct timespec64 ts; \ \ - do_gettimeofday(&tv); \ - (tv.tv_sec*1000000+tv.tv_usec); \ + ktime_get_ts64(&ts); \ + (ts.tv_sec*1000000+ts.tv_nsec / 1000); \ }) #ifndef BFA_TRC_TS