From: Arnd Bergmann <arnd@arndb.de>
To: Bryan.Whitehead@microchip.com
Cc: UNGLinuxDriver@microchiptechnology.mail.onmicrosoft.com,
David Miller <davem@davemloft.net>,
YueHaibing <yuehaibing@huawei.com>,
Networking <netdev@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH] net: lan743x_ptp: convert to ktime_get_clocktai_ts64
Date: Wed, 15 Aug 2018 22:44:34 +0200 [thread overview]
Message-ID: <CAK8P3a3guebtDLNhbQwNmA2nq=raKiP8ztGRpb03r0XD8h+ZNA@mail.gmail.com> (raw)
In-Reply-To: <90A7E81AE28BAE4CBDDB3B35F187D2644073EA26@CHN-SV-EXMX02.mchp-main.com>
On Wed, Aug 15, 2018 at 10:41 PM <Bryan.Whitehead@microchip.com> wrote:
>
> > > > Question: this is the only ptp driver that sets the hardware time to
> > > > the current system time in TAI. Why does it do that?
> > >
> > > This is done when the driver starts up after reset. Otherwise the clock is off
> > by 48 years.
> > > It seemed to me that the system time was the most appropriate clock to
> > sync to.
> > > If my reasoning is incorrect, please enlighten me.
> >
> > I've never worked with PTP, but my understanding from looking at the other
> > drivers is that the time normally gets set either from another host through
> > the PTP protocol, or using clock_settime() from user space with the current
> > time.
>
> Those methods will still work. But if it's not set by those methods, I thought the
> clock should at least be set once on driver startup to align with the system clock.
> After that, other methods are free to reset it again.
(adding Richard Cochran to Cc for more insight here)
I would argue that it's more important that the driver behaves like all other
PTP implementations. If we want the behavior to be that the initial PTP time is
set to the ktime_get_clocktai_ts64() value, then this should be done by the
PTP core rather than the device driver. If there is a good reason that the
other drivers don't do it like this, then I would assume the same reason applies
to lan743x.
Arnd
next prev parent reply other threads:[~2018-08-15 20:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-15 17:49 [PATCH] net: lan743x_ptp: convert to ktime_get_clocktai_ts64 Arnd Bergmann
2018-08-15 18:03 ` Bryan.Whitehead
2018-08-15 20:33 ` Arnd Bergmann
2018-08-15 20:41 ` Bryan.Whitehead
2018-08-15 20:44 ` Arnd Bergmann [this message]
2018-08-15 20:50 ` Bryan.Whitehead
2018-08-17 16:25 ` Richard Cochran
2018-08-17 19:29 ` Arnd Bergmann
2018-08-18 0:09 ` Richard Cochran
2018-08-19 17:58 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK8P3a3guebtDLNhbQwNmA2nq=raKiP8ztGRpb03r0XD8h+ZNA@mail.gmail.com' \
--to=arnd@arndb.de \
--cc=Bryan.Whitehead@microchip.com \
--cc=UNGLinuxDriver@microchiptechnology.mail.onmicrosoft.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).