On Dec 06, Maxime Chevallier wrote:
> 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 ?
sure, I am fine with that. I will test it a bit more and then I will post it. I guess we should target net, agree? Regards, Lorenzo
> > Maxime >