All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Richard Cochran <richardcochran@gmail.com>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net] net: stmmac: keep est_lock across PTP clock adjustment
Date: Thu, 5 Nov 2026 10:52:23 +0100	[thread overview]
Message-ID: <auxR19bfAdOc288M@lore-desk> (raw)
In-Reply-To: <b7102713-8bc6-4a5a-bf33-b79a646f4126@bootlin.com>

[-- Attachment #1: Type: text/plain, Size: 1632 bytes --]

> Hi,
> 
> On 11/2/26 18:37, Lorenzo Bianconi wrote:
> > stmmac_adjust_time() disables EST, drops est_lock to step the PTP clock,
> > and then reacquires the lock to reprogram EST using a base time computed
> > from the new clock value.
> > 
> > That leaves a window where a concurrent tc_taprio_configure() can program
> > EST enabled with a base time derived from the pre-step clock.  The gate
> > schedule then runs across the PTP step with a stale base time until
> > stmmac_adjust_time() reprograms it.
> > 
> > Keep est_lock held for the whole disable/step/reprogram sequence so no
> > other EST user can program the block while the clock is being stepped.
> > 
> > This does not introduce a new lock ordering: __stmmac_setup_est() already
> > takes ptp_lock through gettimex64() while holding est_lock, and
> > stmmac_adjust_systime() uses readl_poll_timeout_atomic(), so it does not
> > sleep under ptp_lock.
> > 
> > Fixes: 23d96de472f7 ("net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()")
> > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
> 
> I couldn't really figure out why the lock was released in the first
> place, LGTM :)

same here :)

> 
> Do you plan on addressing the sashiko pre-existing stuff ? seems to be
> rare conditions but still :( sorry you end up having to deal with these...

yes, I am planning to post a fix for it, I am just awaiting to avoid to post
new patches on the ML before these ones are applied.

Regards,
Lorenzo

> 
> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> 
> Maxime
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2026-11-05  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 17:37 [PATCH net] net: stmmac: keep est_lock across PTP clock adjustment Lorenzo Bianconi
2026-11-02 17:44 ` netdev-bot+sinfo
2026-11-02 21:51   ` Lorenzo Bianconi
2026-11-03 17:41 ` netdev-bot+sashiko
2026-11-03 21:33   ` Lorenzo Bianconi
2026-11-05  9:47 ` Maxime Chevallier
2026-11-05  9:52   ` Lorenzo Bianconi [this message]

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=auxR19bfAdOc288M@lore-desk \
    --to=lorenzo.bianconi@oss.qualcomm.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.