mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yannick Vignon <yannick.vignon@oss.nxp.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Rayagond Kokatanur <rayagond@vayavyalabs.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, sebastien.laveze@oss.nxp.com,
	Vladimir Oltean <olteanv@gmail.com>,
	Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
	mingkai.hu@nxp.com, Joakim Zhang <qiangqing.zhang@nxp.com>,
	Yannick Vignon <yannick.vignon@nxp.com>
Subject: Re: [PATCH net] net: stmmac: ensure PTP time register reads are consistent
Date: Thu, 3 Feb 2022 17:38:10 +0100	[thread overview]
Message-ID: <13dc6f72-8ef4-6990-1c67-2b92c6894e87@oss.nxp.com> (raw)
In-Reply-To: <YfwCnV2TV8fznZ33@shell.armlinux.org.uk>

On 2/3/2022 5:28 PM, Russell King (Oracle) wrote:
> On Thu, Feb 03, 2022 at 05:00:25PM +0100, Yannick Vignon wrote:
>> From: Yannick Vignon <yannick.vignon@nxp.com>
>>
>> Even if protected from preemption and interrupts, a small time window
>> remains when the 2 register reads could return inconsistent values,
>> each time the "seconds" register changes. This could lead to an about
>> 1-second error in the reported time.
> 
> Have you checked whether the hardware protects against this (i.o.w. the
> hardware latches the PTP_STSR value when PTP_STNSR is read, or vice
> versa? Several PTP devices I've looked at do this to allow consistent
> reading.
> 

It doesn't. I was able to observe inconsistent values doing reads in 
either order, and we had already observed the issue with that same IP on 
another device (Cortex-M based, not running Linux). It's not easy to 
reproduce, the time window is small, but it's there.

  reply	other threads:[~2022-02-03 16:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 16:00 Yannick Vignon
2022-02-03 16:28 ` Russell King (Oracle)
2022-02-03 16:38   ` Yannick Vignon [this message]
2022-02-03 16:44     ` Russell King (Oracle)
2022-02-03 22:10 ` patchwork-bot+netdevbpf

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=13dc6f72-8ef4-6990-1c67-2b92c6894e87@oss.nxp.com \
    --to=yannick.vignon@oss.nxp.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=davem@davemloft.net \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mingkai.hu@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=peppe.cavallaro@st.com \
    --cc=qiangqing.zhang@nxp.com \
    --cc=rayagond@vayavyalabs.com \
    --cc=sebastien.laveze@oss.nxp.com \
    --cc=xiaoliang.yang_1@nxp.com \
    --cc=yannick.vignon@nxp.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®