[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250114192656.l5xlipbe4fkirkq4@skbuf>
Date: Tue, 14 Jan 2025 21:26:56 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
Bryan Whitehead <bryan.whitehead@...rochip.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
Marcin Wojtas <marcin.s.wojtas@...il.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>, netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH RFC net-next 10/10] net: dsa: allow use of phylink
managed EEE support
On Tue, Jan 14, 2025 at 02:02:50PM +0000, Russell King (Oracle) wrote:
> In order to allow DSA drivers to use phylink managed EEE, changes are
> necessary to the DSA .set_eee() and .get_eee() methods. Where drivers
> make use of phylink managed EEE, these should just pass the method on
> to their phylink implementation without calling the DSA specific
> operations.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> ---
What is the reason for including this patch with this set, where
it is of no use until at least one DSA driver provides the new API
implementations?
> net/dsa/user.c | 25 ++++++++++++++++---------
> 1 file changed, 16 insertions(+), 9 deletions(-)
>
> diff --git a/net/dsa/user.c b/net/dsa/user.c
> index c74f2b2b92de..6912d2d57486 100644
> --- a/net/dsa/user.c
> +++ b/net/dsa/user.c
> @@ -1233,16 +1233,23 @@ static int dsa_user_set_eee(struct net_device *dev, struct ethtool_keee *e)
> if (!ds->ops->support_eee || !ds->ops->support_eee(ds, dp->index))
> return -EOPNOTSUPP;
>
> - /* Port's PHY and MAC both need to be EEE capable */
> - if (!dev->phydev)
> - return -ENODEV;
> -
> - if (!ds->ops->set_mac_eee)
> - return -EOPNOTSUPP;
> + /* If the port is using phylink managed EEE, then get_mac_eee is
set_mac_eee() is what is unnecessary.
> + * unnecessary.
> + */
> + if (!ds->phylink_mac_ops ||
> + !ds->phylink_mac_ops->mac_disable_tx_lpi ||
> + !ds->phylink_mac_ops->mac_enable_tx_lpi) {
Does it make sense to export pl->mac_supports_eee_ops wrapped into a
helper function and call that here? To avoid making DSA too tightly
coupled with the phylink MAC operation names.
> + /* Port's PHY and MAC both need to be EEE capable */
> + if (!dev->phydev)
> + return -ENODEV;
> +
> + if (!ds->ops->set_mac_eee)
> + return -EOPNOTSUPP;
>
> - ret = ds->ops->set_mac_eee(ds, dp->index, e);
> - if (ret)
> - return ret;
> + ret = ds->ops->set_mac_eee(ds, dp->index, e);
> + if (ret)
> + return ret;
> + }
>
> return phylink_ethtool_set_eee(dp->pl, e);
> }
> --
> 2.30.2
>
Powered by blists - more mailing lists