> 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 >