Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Bryan Whitehead <bryan.whitehead@microchip.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Marcin Wojtas <marcin.s.wojtas@gmail.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH RFC net-next 10/10] net: dsa: allow use of phylink managed EEE support
Date: Tue, 14 Jan 2025 21:26:56 +0200	[thread overview]
Message-ID: <20250114192656.l5xlipbe4fkirkq4@skbuf> (raw)
In-Reply-To: <E1tXhVK-000n18-3C@rmk-PC.armlinux.org.uk>

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@armlinux.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
> 


  reply	other threads:[~2025-01-14 20:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 13:58 [PATCH RFC net-next 00/10] net: add phylink managed EEE support Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 01/10] net: mdio: add definition for clock stop capable bit Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 02/10] net: phy: add support for querying PHY clock stop capability Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 03/10] net: phylink: add phylink_link_is_up() helper Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 04/10] net: phylink: add EEE management Russell King (Oracle)
2025-01-15 15:55   ` Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 05/10] net: mvneta: convert to phylink EEE implementation Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 06/10] net: mvpp2: add " Russell King (Oracle)
2025-01-15 14:53   ` Maxime Chevallier
2025-01-15 15:46     ` Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 07/10] net: lan743x: use netdev in lan743x_phylink_mac_link_down() Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 08/10] net: lan743x: convert to phylink managed EEE Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 09/10] net: stmmac: convert to phylink managed EEE support Russell King (Oracle)
2025-01-14 14:02 ` [PATCH RFC net-next 10/10] net: dsa: allow use of " Russell King (Oracle)
2025-01-14 19:26   ` Vladimir Oltean [this message]
2025-01-14 20:02     ` Russell King (Oracle)
2025-01-14 20:28       ` Vladimir Oltean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250114192656.l5xlipbe4fkirkq4@skbuf \
    --to=olteanv@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=marcin.s.wojtas@gmail.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox