From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1D82C433EF for ; Mon, 30 May 2022 17:07:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235511AbiE3RHt (ORCPT ); Mon, 30 May 2022 13:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229836AbiE3RHt (ORCPT ); Mon, 30 May 2022 13:07:49 -0400 Received: from smtp7.emailarray.com (smtp7.emailarray.com [65.39.216.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73CAA52E77 for ; Mon, 30 May 2022 10:07:47 -0700 (PDT) Received: (qmail 29942 invoked by uid 89); 30 May 2022 17:07:46 -0000 Received: from unknown (HELO localhost) (amxlbW9uQGZsdWdzdmFtcC5jb21AMTYzLjExNC4xMzIuNw==) (POLARISLOCAL) by smtp7.emailarray.com with SMTP; 30 May 2022 17:07:46 -0000 Date: Mon, 30 May 2022 10:07:44 -0700 From: Jonathan Lemon To: Richard Cochran Cc: netdev@vger.kernel.org, f.fainelli@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, bcm-kernel-feedback-list@broadcom.com, kernel-team@fb.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com Subject: Re: [PATCH net-next v5 2/2] net: phy: broadcom: Add PTP support for some Broadcom PHYs. Message-ID: <20220530170744.zs6urci5lcytl2j4@bsd-mbp.dhcp.thefacebook.com> References: <20220518223935.2312426-1-jonathan.lemon@gmail.com> <20220518223935.2312426-3-jonathan.lemon@gmail.com> <20220529003447.GA32026@hoboy.vegasvil.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220529003447.GA32026@hoboy.vegasvil.org> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, May 28, 2022 at 05:34:47PM -0700, Richard Cochran wrote: > On Wed, May 18, 2022 at 03:39:35PM -0700, Jonathan Lemon wrote: > > > +static int bcm_ptp_adjtime_locked(struct bcm_ptp_private *priv, > > + s64 delta_ns) > > +{ > > + struct timespec64 ts; > > + int err; > > + > > + err = bcm_ptp_gettime_locked(priv, &ts, NULL); > > + if (!err) { > > + set_normalized_timespec64(&ts, ts.tv_sec, > > + ts.tv_nsec + delta_ns); > > This also takes a LONG time when delta is large... Didn't we just go through this? What constitutes a "large" offset here? The current version seems acceptable to me: root@rpi:~/src/rpi # time phc_ctl /dev/ptp0 -- adj 86400 phc_ctl[766492.486]: adjusted clock by 86400.000000 seconds real 0m0.009s user 0m0.002s sys 0m0.007s root@rpi:~/src/rpi # time phc_ctl /dev/ptp0 -- adj -86400 phc_ctl[766494.647]: adjusted clock by -86400.000000 seconds real 0m0.009s user 0m0.009s sys 0m0.000s -- Jonathan