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: 118577 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp8079899qgn; Fri, 10 Nov 2017 07:38:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMZCPePYECY+LADnBXD2Lrk0O9kBbkpBJZdvqdoMSqICTH1G5uXJdnBbZCbSkmtVtKdp9IxT X-Received: by 10.98.249.5 with SMTP id o5mr803729pfh.54.1510328317535; Fri, 10 Nov 2017 07:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510328317; cv=none; d=google.com; s=arc-20160816; b=fvZOQYCVVR5yhx2NatNz6p4hcxKU1UAVmPpOF9zidRbh5XhX1kPf3a8WCSvUZX/X+E OLzfNYYrxlZ5XIL2OLw7DCF2NJbTaJJ9q9ghUlRuc8cXt+Wn6tSYXBHhQlCSBo6hj+bB IhWgnX1kumsKIyjdcD31uyYdS7mmaZP360egQmjFt6GwbbR0GMDThyboU+Dhe/ExFALG sJ2oWIIxHxl8ntvs7/qwTuPCQWeyqiFn9uONH22j2BvbTPuuJz5xwMhlgNohENF093qj cscABfRxeI7Bv60t/4DTD6PcEKYTcf9TiFM5P4DnkY7uXmGdLJFcVfRHuWDHS0G9fWEK sr0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=V8+bYpjv4DeLkSnW5QUn1ZCU3rdsuPAGJrLZ/DUwmmk=; b=RwU0U+ujn25x3MjrN7B9W83emVrjhN9fxVRQhvWq2tdVdC8iu+uDENnlAiAPTYrlVH S00zzZ1rAHimwdSH88vkcIzxqM+R0EER/yHsexao4ppKrit3uNWonU9IMbmXv9xozqIi yrchgLpCa2opuzESZ+j4a0+581Iz22IBkqeSGTgx13BtWQSGiDU9m8jbnn405xS34U+r N1WED8SpO38+EFPEhhpuvHKhOPvhQeoVAupp3ePiFgExnceD1u1zkUdqAFATa5ydSNey uOjoRKkfNYpVV9xDKT7iERhB/VjvPp2/9cmm197c+mN8tSf7z1x3S+QeMNkl1UkPksVn eBDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 a91si9181285pld.674.2017.11.10.07.38.37; Fri, 10 Nov 2017 07:38:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262AbdKJPhu (ORCPT + 23 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 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