Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.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:23:50 +0100	[thread overview]
Message-ID: <40dbae2a-5ca1-4f04-b48f-a74aeaf11ab1@bootlin.com> (raw)
In-Reply-To: <axVP7a_l0kHA3ASk@lore-desk>

Hi,

On 12/6/26 13:07, Lorenzo Bianconi wrote:
>> 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

Quickly looking at it, it's complex but not as bad as I expected, this can be
a nice series on its own :)

It's important we get this right, the RXC thing have been a never ending source
of problems with dwmac, and we have the plumbing in phylink to deal with that,
I'd be very happy with this being behind us !

but hey we know how it goes now, 3 patches in a small series, a few sashiko replies
and suddently we have a 20-patches backlog...

Do you feel like sending your more complete change ?

Maxime



  reply	other threads:[~2026-12-06 12:24 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
2026-12-06 12:23     ` Maxime Chevallier [this message]
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=40dbae2a-5ca1-4f04-b48f-a74aeaf11ab1@bootlin.com \
    --to=maxime.chevallier@bootlin.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=lorenzo.bianconi@oss.qualcomm.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