From patchwork Sat Mar 21 21:39:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 453045 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 94CE114015A for ; Sun, 22 Mar 2015 08:40:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=gYF885k1; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752167AbbCUVkj (ORCPT ); Sat, 21 Mar 2015 17:40:39 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:36842 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752135AbbCUVke (ORCPT ); Sat, 21 Mar 2015 17:40:34 -0400 Received: by wgra20 with SMTP id a20so116367674wgr.3; Sat, 21 Mar 2015 14:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jq31DqQdQ+mEoJKZGU3u/hRUgVjDSg3hfvEhG0h+rLY=; b=gYF885k179a/bIMQ7+t1lCFuvNqyTPxvuPPWK9kQZx0mTSDnNxYdVbpLAQ5bQQ7QyW wYXYEfa+jz0tulkG6xOnEdW0CH+sb6cetIsfk2FPgu+BQdGBNvcplfGdtG+C/BxdDfGX Y2wdNE7aAbrRPX13RKzqmryTYbVTRne51L2//QZa+5GwB3Gaa29akvU4UFu4amclwCMg OdhhLY7pTVJb5vspw0vfuN+zC1REg5r6h+bM4f/HZtSKCHIjQ5T8s5wpiOdPhNW04QeV 6bKbMVGWbG4N2RPWh0bbZfGk3bDjSfhN01SQNlL9uhk1E/Qk4v7vt9a1djrveRn/3ZpS gj4g== X-Received: by 10.180.126.69 with SMTP id mw5mr7299680wib.12.1426974032376; Sat, 21 Mar 2015 14:40:32 -0700 (PDT) Received: from hoboy.home (194-96-185-227.adsl.highway.telekom.at. [194.96.185.227]) by mx.google.com with ESMTPSA id k6sm4047198wia.6.2015.03.21.14.40.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Mar 2015 14:40:31 -0700 (PDT) From: Richard Cochran To: Cc: , Amir Vadai , Ariel Elior , Arnd Bergmann , Baolin Wang , Ben Hutchings , Bruce Allan , Carolyn Wyborny , Chris Metcalf , David Miller , Frank Li , Giuseppe Cavallaro , Jeff Kirsher , John Stultz , Luwei Zhou , Matthew Vick , Michael Chan , Prashant Sreedharan , Shradha Shah , Solarflare linux maintainers , Sonic Zhang , =?UTF-8?q?Stefan=20S=C3=B8rensen?= , Thomas Gleixner , Tom Lendacky Subject: [PATCH net-next V2 19/23] ptp: tilegx: convert to the 64 bit get/set time methods. Date: Sat, 21 Mar 2015 22:39:37 +0100 Message-Id: <8bc233b19d08308c01015936841d9be8d4441ece.1426973658.git.richardcochran@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This driver calls code (via gxio_mpipe_get/set_timestamp) that makes the assumption that the tv_sec field is 64 bits wide. So apparently this driver is 64 bit only. So maybe this driver and device are ready for 2038, but maybe not. Not even compile tested. Signed-off-by: Richard Cochran Acked-by: Chris Metcalf --- drivers/net/ethernet/tile/tilegx.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c index bea8cd2..614ea83 100644 --- a/drivers/net/ethernet/tile/tilegx.c +++ b/drivers/net/ethernet/tile/tilegx.c @@ -838,24 +838,28 @@ static int ptp_mpipe_adjtime(struct ptp_clock_info *ptp, s64 delta) return ret; } -static int ptp_mpipe_gettime(struct ptp_clock_info *ptp, struct timespec *ts) +static int ptp_mpipe_gettime(struct ptp_clock_info *ptp, + struct timespec64 *ts64) { int ret = 0; struct mpipe_data *md = container_of(ptp, struct mpipe_data, caps); + struct timespec ts; mutex_lock(&md->ptp_lock); - if (gxio_mpipe_get_timestamp(&md->context, ts)) + if (gxio_mpipe_get_timestamp(&md->context, &ts)) ret = -EBUSY; mutex_unlock(&md->ptp_lock); + *ts64 = timespec_to_timespec64(ts); return ret; } static int ptp_mpipe_settime(struct ptp_clock_info *ptp, - const struct timespec *ts) + const struct timespec64 *ts64) { int ret = 0; + struct timespec ts = timespec64_to_timespec(*ts64); struct mpipe_data *md = container_of(ptp, struct mpipe_data, caps); mutex_lock(&md->ptp_lock); - if (gxio_mpipe_set_timestamp(&md->context, ts)) + if (gxio_mpipe_set_timestamp(&md->context, &ts)) ret = -EBUSY; mutex_unlock(&md->ptp_lock); return ret; @@ -876,8 +880,8 @@ static struct ptp_clock_info ptp_mpipe_caps = { .pps = 0, .adjfreq = ptp_mpipe_adjfreq, .adjtime = ptp_mpipe_adjtime, - .gettime = ptp_mpipe_gettime, - .settime = ptp_mpipe_settime, + .gettime64 = ptp_mpipe_gettime, + .settime64 = ptp_mpipe_settime, .enable = ptp_mpipe_enable, };