Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2298488ybc; Wed, 13 Nov 2019 12:07:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxWXuH1NvSw0QnSxRNZI7rkjLH+D/WMBmTdFMFIY4uBHUvh0Tr+W4Nm0cwNGr7K/uSfrbeB X-Received: by 2002:aa7:d64e:: with SMTP id v14mr5779702edr.88.1573675638432; Wed, 13 Nov 2019 12:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573675638; cv=none; d=google.com; s=arc-20160816; b=UKlNOc6JAuRUpQ9YcXunUd0gSycsX4zE5mpAE8af2qZ8LmLsfWzh258uzyILDQwN2+ MjcY4X7iaMj/TbBFWpRx7Y50BJs4ByIRwAoekbNe/IvdWX8MW4w7g7/K1TkSM6QitgTh ae+Yb/u2y7AXf7TWSVFUkzuGyc6qGB1AyyfnQhblvsePMUlPXH6fwS1KpqHZBLsX6F4j dCb+QctIQg3eHQ5NzFAPybldM335NiQStSef/rhE5+EIxrOebr7yn71+GrJ2yD5b0Ffb HfE1ufK0OyM50q1p9tvgL5lTHnS60sHAUihVL47qDbgrlL8Hx2QfvZIsJNJgIN3ddVlN pjmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Ws1cG4tWR3qU8CKRybu4a3mcm8/xCCktRQdNlvzZyvA=; b=Gu8EwAR4/N/HOXntnQ5r+4UlAJv85J/WA5TaoTpFoFmImPciDXW51uDaL+MdX6XKox 7/PWYVUlyf1ABR01/l6m5W0xGJtA44QYp8L3Iu8GG3ZhAIGusroEcictiCpDKw/ITOFZ i6JU6ncSe6+CNcSDPbSkK5haX6yjgU0rluRbRuRti8vLbmxFAJqpPqFrDP9niSki07Mc +seOi6u5WVkAPe0Oh+iJFxd9HHUBvRzQYZoTalfNRaKWSuluGZPnBCg8fC/v+87QoPd4 tOT70R68JAlxFWTXY+JAJtzBdWUXWNseFO5QFYfrzq/RGXudeu6mJD8eIdLBE0//SZJD 9gsA== 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 k35si2254066edb.84.2019.11.13.12.06.53; Wed, 13 Nov 2019 12:07:18 -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 S1726480AbfKMUFI (ORCPT + 99 others); Wed, 13 Nov 2019 15:05:08 -0500 Received: from einhorn-mail.in-berlin.de ([217.197.80.20]:47951 "EHLO einhorn-mail.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726173AbfKMUFI (ORCPT ); Wed, 13 Nov 2019 15:05:08 -0500 X-Envelope-From: stefanr@s5r6.in-berlin.de Received: from authenticated.user (localhost [127.0.0.1]) by einhorn.in-berlin.de with ESMTPSA id xADK4blA015292 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 13 Nov 2019 21:04:37 +0100 Date: Wed, 13 Nov 2019 21:04:37 +0100 From: Stefan Richter To: Arnd Bergmann Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, Clemens Ladisch , Thomas Gleixner , Will Deacon , Greg Kroah-Hartman , Richard Fontana , linux1394-devel@lists.sourceforge.net Subject: Re: [PATCH 16/16] firewire: ohci: stop using get_seconds() for BUS_TIME Message-ID: <20191113210437.323f9acd@kant> In-Reply-To: <20191108213257.3097633-17-arnd@arndb.de> References: <20191108213257.3097633-1-arnd@arndb.de> <20191108213257.3097633-17-arnd@arndb.de> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Nov 08 Arnd Bergmann wrote: > The ohci driver uses the get_seconds() function to implement the 32-bit > CSR_BUS_TIME register. This was added in 2010 commit a48777e03ad5 > ("firewire: add CSR BUS_TIME support"). > > As get_seconds() returns a 32-bit value (on 32-bit architectures), it > seems like a good fit for that register, but it is also deprecated because > of the y2038/y2106 overflow problem, and should be replaced throughout > the kernel with either ktime_get_real_seconds() or ktime_get_seconds(). > > I'm using the latter here, which uses monotonic time. This has the > advantage of behaving better during concurrent settimeofday() updates > or leap second adjustments and won't overflow a 32-bit integer, but > the downside of using CLOCK_MONOTONIC instead of CLOCK_REALTIME is > that the observed values are not related to external clocks. > > If we instead need UTC but can live with clock jumps or overflows, > then we should use ktime_get_real_seconds() instead, retaining the > existing behavior. > > Reviewed-by: Clemens Ladisch > Cc: Stefan Richter > Link: https://lore.kernel.org/lkml/20180711124923.1205200-1-arnd@arndb.de/ > Signed-off-by: Arnd Bergmann Committed to linux1394.git:for-next. Thank you for the patch and your extraordinary patience. > --- > drivers/firewire/ohci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c > index 522f3addb5bd..33269316f111 100644 > --- a/drivers/firewire/ohci.c > +++ b/drivers/firewire/ohci.c > @@ -1752,7 +1752,7 @@ static u32 update_bus_time(struct fw_ohci *ohci) > > if (unlikely(!ohci->bus_time_running)) { > reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_cycle64Seconds); > - ohci->bus_time = (lower_32_bits(get_seconds()) & ~0x7f) | > + ohci->bus_time = (lower_32_bits(ktime_get_seconds()) & ~0x7f) | > (cycle_time_seconds & 0x40); > ohci->bus_time_running = true; > } -- Stefan Richter -======---== =-== -==-= http://arcgraph.de/sr/