From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754620AbbI3H0m (ORCPT ); Wed, 30 Sep 2015 03:26:42 -0400 Received: from www.linutronix.de ([62.245.132.108]:56937 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754279AbbI3H0k (ORCPT ); Wed, 30 Sep 2015 03:26:40 -0400 Date: Wed, 30 Sep 2015 09:26:01 +0200 (CEST) From: Thomas Gleixner To: Arnd Bergmann cc: y2038@lists.linaro.org, John Stultz , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Rodolfo Giometti , linux-net-drivers@solarflare.com, Shradha Shah , Richard Cochran Subject: Re: [PATCH 5/5] net: sfc: avoid using timespec In-Reply-To: <1443471692-2946597-6-git-send-email-arnd@arndb.de> Message-ID: References: <1443471692-2946597-1-git-send-email-arnd@arndb.de> <1443471692-2946597-6-git-send-email-arnd@arndb.de> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Sep 2015, Arnd Bergmann wrote: > The sfc driver internally uses a time format based on 32-bit (unsigned) > seconds and 32-bit nanoseconds. This means it will overflow in 2106, > but the value we pass into it is a signed 32-bit tv_sec that already > overflows in 2038 to a negative value. > > This patch changes the logic to use the lower 32 bits of the timespec64 > tv_sec in efx_ptp_ns_to_s_ns, which will have the correct value beyond the overflow. > While this does not change any of the register values, it lets us > keep using the driver after we deprecate the use of the timespec type > in the kernel. > > In the efx_ptp_process_times function, the change to use timespec64 > is similar, in that the tv_sec portion is ignored anyway and we only > care about the nanosecond portion that remains unchanged. > > Signed-off-by: Arnd Bergmann Reviewed-by: Thomas Gleixner