From: Jakub Kicinski <kuba@kernel.org>
To: "Malladi, Meghana" <m-malladi@ti.com>
Cc: <vigneshr@ti.com>, <grygorii.strashko@ti.com>, <horms@kernel.org>,
<jan.kiszka@siemens.com>, <diogo.ivo@siemens.com>,
<pabeni@redhat.com>, <edumazet@google.com>, <davem@davemloft.net>,
<andrew+netdev@lunn.ch>, <linux-kernel@vger.kernel.org>,
<netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<srk@ti.com>, Roger Quadros <rogerq@kernel.org>,
<danishanwar@ti.com>, Vadim Fedorenko <vadim.fedorenko@linux.dev>
Subject: Re: [PATCH net v3] net: ti: icssg-prueth: Fix 1 PPS sync
Date: Mon, 4 Nov 2024 18:50:31 -0800 [thread overview]
Message-ID: <20241104185031.0c843951@kernel.org> (raw)
In-Reply-To: <7c3318f4-a2d4-4cbf-8a93-33c6a8afd6c4@ti.com>
On Mon, 4 Nov 2024 16:55:46 +0530 Malladi, Meghana wrote:
> On 11/1/2024 7:29 AM, Jakub Kicinski wrote:
> > On Mon, 28 Oct 2024 16:40:52 +0530 Meghana Malladi wrote:
> >> The first PPS latch time needs to be calculated by the driver
> >> (in rounded off seconds) and configured as the start time
> >> offset for the cycle. After synchronizing two PTP clocks
> >> running as master/slave, missing this would cause master
> >> and slave to start immediately with some milliseconds
> >> drift which causes the PPS signal to never synchronize with
> >> the PTP master.
> >
> > You're reading a 64b value in chunks, is it not possible that it'd wrap
> > in between reads? This can be usually detected by reading high twice and
> > making sure it didn't change.
> >
> > Please fix or explain in the commit message why this is not a problem..
> Yes I agree that there might be a wrap if the read isn't atomic. As
> suggested by Andrew I am currently not using custom read where I can
> implement the logic you suggested
Right but I think Andrew was commenting on a patch which contained pure
re-implementation of read low / hi with no extra bells or whistles.
> (reading high twice and making sure if
> didn't change). Can you share me some references where this logic is
> implemented in the kernel, so I can directly use that instead of writing
> custom functions.
I think you need to write a custom one. Example:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/drivers/net/ethernet/meta/fbnic/fbnic_time.c#n40
next prev parent reply other threads:[~2024-11-05 2:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 11:10 [PATCH net v3] net: ti: icssg-prueth: Fix 1 PPS sync Meghana Malladi
2024-11-01 1:59 ` Jakub Kicinski
2024-11-04 11:25 ` Malladi, Meghana
2024-11-05 2:50 ` Jakub Kicinski [this message]
2024-11-05 12:01 ` Malladi, Meghana
2024-11-05 21:00 ` Andrew Lunn
2024-11-06 6:47 ` Malladi, Meghana
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=20241104185031.0c843951@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=diogo.ivo@siemens.com \
--cc=edumazet@google.com \
--cc=grygorii.strashko@ti.com \
--cc=horms@kernel.org \
--cc=jan.kiszka@siemens.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m-malladi@ti.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rogerq@kernel.org \
--cc=srk@ti.com \
--cc=vadim.fedorenko@linux.dev \
--cc=vigneshr@ti.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).