mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Malladi, Meghana" <m-malladi@ti.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <vigneshr@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: Tue, 5 Nov 2024 17:31:13 +0530	[thread overview]
Message-ID: <e5c5c9ba-fca1-4fa3-a416-1fc972ebd258@ti.com> (raw)
In-Reply-To: <20241104185031.0c843951@kernel.org>



On 11/5/2024 8:20 AM, Jakub Kicinski wrote:
> 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
Ok thank you. I will add custom function for this and update the patch.

  reply	other threads:[~2024-11-05 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 11:10 Meghana Malladi
2024-11-01  1:59 ` Jakub Kicinski
2024-11-04 11:25   ` Malladi, Meghana
2024-11-05  2:50     ` Jakub Kicinski
2024-11-05 12:01       ` Malladi, Meghana [this message]
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=e5c5c9ba-fca1-4fa3-a416-1fc972ebd258@ti.com \
    --to=m-malladi@ti.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=diogo.ivo@siemens.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jan.kiszka@siemens.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®