[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4KuS_5vwBmwyilU@shell.armlinux.org.uk>
Date: Sat, 11 Jan 2025 17:45:47 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>
Cc: Heiner Kallweit <hkallweit1@...il.com>, Paolo Abeni <pabeni@...hat.com>,
Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Simon Horman <horms@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 5/9] net: phy: improve phy_disable_eee_mode
On Sat, Jan 11, 2025 at 06:38:07PM +0100, Andrew Lunn wrote:
> On Sat, Jan 11, 2025 at 10:07:43AM +0100, Heiner Kallweit wrote:
> > If a mode is to be disabled, remove it from advertising_eee.
> > Disabling EEE modes shall be done before calling phy_start(),
> > warn if that's not the case.
> >
> > Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
> > ---
> > include/linux/phy.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/include/linux/phy.h b/include/linux/phy.h
> > index ad71d3a3b..fce29aaa9 100644
> > --- a/include/linux/phy.h
> > +++ b/include/linux/phy.h
> > @@ -1333,7 +1333,10 @@ static inline bool phy_is_started(struct phy_device *phydev)
> > */
> > static inline void phy_disable_eee_mode(struct phy_device *phydev, u32 link_mode)
> > {
> > + WARN_ON(phy_is_started(phydev));
> > +
> > linkmode_set_bit(link_mode, phydev->eee_disabled_modes);
> > + linkmode_clear_bit(link_mode, phydev->advertising_eee);
> > }
>
> Thinking out loud...
>
> Maybe we should make this more like phy_remove_link_mode()? That
> function also removes the link mode from phydev->supported at the same
> time.
That's what I would expect, but phydev->supported_eee is also used to
determine which registers are programmed. So, removing linkmodes from
it risks not programming a register to disable an EEE mode.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists