[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c4692bc-18e9-4195-82e9-1be83645c8a4@lunn.ch>
Date: Sat, 11 Jan 2025 18:38:07 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: 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>,
Russell King - ARM Linux <linux@...linux.org.uk>,
"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 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.
Andrew
Powered by blists - more mailing lists