Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5758357imm; Mon, 23 Jul 2018 05:41:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe1Y0SXvYNl2gcwZaZJu2hQfbftne5ELPZHiLE0s2ZRNO8O+5AWf17sLDp3+LjBalQjBNaA X-Received: by 2002:a62:229a:: with SMTP id p26-v6mr13116759pfj.53.1532349707624; Mon, 23 Jul 2018 05:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532349707; cv=none; d=google.com; s=arc-20160816; b=X+Uv0zWS7TIdobL6bmDl9AN9Ixe9MR6tc2JgRta3kXRzjXT4APdTv5gLLQjjjtg0jE qVKl/otw6I4lNi0vwKJJ7vDiUSiQ5DbFCydUp4WVwXK+ALkVPqK7A0WBvGWh8nQugy6Q EyeZ7+7E5yOW+FjWITiwufEsVP6Mn/HQilhpBUghToRasaIcGkSXeBRXis0RrlE4RYr3 HgYfjNoJl8RQBBB/kgsV7XiOF1bi1F/7y3WLLF2+l39ZX8kIRGKR/m2kqZR358P2Y1H8 Dg03PdL9XzIkg2054CtMkuzZm85+5NmeO1SSzbBOKZypy8CqS19NSkDEnFskEBd8aRCS nLOg== 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 :arc-authentication-results; bh=IMOVyljCsiKLGaCAekoAeY0KAn+Hjir6gwwFfO9OBJI=; b=RekeLvLAnABJ9eCJln59nNGLo51HecQ14a4LdoLhIDuvcQeZNphUxtQURPqYtoK3Z4 xmY7Gphrj0lcYBjYGNOfz/W1aLZ7g7EPCP53guAvqzEulYo1OT1IpUWxlnfycbFry8lh 7sQUVFWylbaZCTUDmMVBP7gZ4pmXI6YQkhx1x9cRz3FxuVTnV3g+CBz6kyo6y5jRcxyJ e/NaDQCWi+gpvpZoQZH6tsPFihqaush/vDFyW3Vd+IP4hHUsNeX8fcpznRvve8vQdt5K kVQ2uJgFM8SdcIYtLNbY9Ff/F3TCZoB8htTxZFpu035UrukgbWbsuMtV0ErX0a9KiwnY o5Vw== 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 e93-v6si8254185plb.135.2018.07.23.05.41.33; Mon, 23 Jul 2018 05:41:47 -0700 (PDT) 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 S2388507AbeGWNlJ (ORCPT + 99 others); Mon, 23 Jul 2018 09:41:09 -0400 Received: from einhorn-mail.in-berlin.de ([217.197.80.20]:53933 "EHLO einhorn-mail.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387909AbeGWNlI (ORCPT ); Mon, 23 Jul 2018 09:41:08 -0400 X-Envelope-From: stefanr@s5r6.in-berlin.de Received: from authenticated.user (localhost [127.0.0.1]) by einhorn.in-berlin.de with ESMTP id w6NCcwuq013870 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Jul 2018 14:38:58 +0200 Date: Mon, 23 Jul 2018 14:38:58 +0200 From: Stefan Richter To: Arnd Bergmann Cc: y2038@lists.linaro.org, Clemens Ladisch , Ingo Molnar , "Paul E. McKenney" , Mark Rutland , Hector Martin , linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [RESEND] firewire: ohci: stop using get_seconds() for BUS_TIME Message-ID: <20180723143858.27558e27@kant> In-Reply-To: <20180711124923.1205200-1-arnd@arndb.de> References: <20180711124923.1205200-1-arnd@arndb.de> X-Mailer: Claws Mail 3.15.0-dirty (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 Jul 11 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 > Signed-off-by: Arnd Bergmann > --- > I notice that Stefan Richter has not been active on the mailing lists > since February 2018. Thanks Arnd and Clemens. I resurrected and updated one of my FireWire enabled PCs, and try to get pack to reasonable response times to firewire driver patches. The switch from CLOCK_REALTIME to CLOCK_MONOTONIC looks good to me, but I'll have another look at the context. > Andrew, could you pick it up in the meantime? > --- > 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 45c048751f3b..5125841ea338 100644 > --- a/drivers/firewire/ohci.c > +++ b/drivers/firewire/ohci.c > @@ -1765,7 +1765,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/