Netdev List
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>,
	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>,
	Russell King <linux@armlinux.org.uk>,
	"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	Jacob Keller <jacob.e.keller@intel.com>,
	netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net] net: stmmac: keep RXC running for atomic filter updates
Date: Sun, 6 Dec 2026 13:07:09 +0100	[thread overview]
Message-ID: <axVP7a_l0kHA3ASk@lore-desk> (raw)
In-Reply-To: <ab898725-46fb-4793-82b5-8a9aba269910@bootlin.com>

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

> Hi,
> 
> On 12/5/26 18:31, Lorenzo Bianconi wrote:
> > stmmac_phylink_setup() allows the PHY to stop the RX clock in LPI
> > whenever the platform does not need RXC in LPI and no VLAN features are
> > advertised. The VLAN feature check was only a proxy for "the driver may
> > program RXC-dependent registers from atomic context":
> > stmmac_set_rx_mode() and the VLAN filter callbacks run with bottom
> > halves disabled and cannot use phylink_rx_clk_stop_block().
> > 
> > That proxy is fragile because it changes with the advertised offload
> > set, and it does not cover CONFIG_VLAN_8021Q=n. A filter update while the
> > link is in LPI with RXC stopped can be lost, leaving the hardware filter
> > out of sync with the software address lists.
> > 
> > Since the driver cannot know whether a filter update will happen while
> > RXC is stopped, keep RXC running and never let the PHY stop it during
> > LPI. A platform that has verified its filter programming does not need
> > RXC can restore the power saving in a follow-up with an explicit opt-in.
> > 
> > STMMAC_FLAG_RX_CLK_RUNS_IN_LPI is now redundant, so remove it and its
> > qcs404 setting; keeping RXC running everywhere supersedes it.
> 
> That would introduce some power consumption impacts though no ?

Yes, you are right. I guess this is a trade-off between correctness and
simplicity of the fix.
If we disable CONFIG_VLAN_8021Q (CONFIG_VLAN_8021Q=n) there are multiple spots
(not just ndo_set_rx_mode_async()) where we can access sensible DMA/MAC regs
while the RXC clock is gated.
I drafted a possible fix in [0] but as you can see it is much more complex :)

Regards,
Lorenzo

[0] https://github.com/LorenzoBianconi/net-next/commit/87da83ada7e971e78908ccbd5bbe104b00654124

> 
> Besides that, we have an async version of the .set_rx_mode() NDO
> now: ndo_set_rx_mode_async()
> 
> Maybe the right move is to switch to that ?
> 
> Maxime
> 

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

  reply	other threads:[~2026-12-06 12:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 17:31 [PATCH net] net: stmmac: keep RXC running for atomic filter updates Lorenzo Bianconi
2026-12-05 17:36 ` netdev-bot+sinfo
2026-12-05 17:39   ` Lorenzo Bianconi
2026-12-05 21:11 ` Maxime Chevallier
2026-12-06 12:07   ` Lorenzo Bianconi [this message]
2026-12-06 12:23     ` Maxime Chevallier
2026-12-06 12:32       ` Lorenzo Bianconi

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=axVP7a_l0kHA3ASk@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=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mohd.anwar@oss.qualcomm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /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