public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Wei Fang <wei.fang@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>
Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Shenwei Wang <shenwei.wang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Amit Cohen <amcohen@nvidia.com>, Gal Pressman <gal@nvidia.com>,
	Alexandru Tachici <alexandru.tachici@analog.com>,
	Piergiorgio Beruto <piergiorgio.beruto@gmail.com>,
	Willem de Bruijn <willemb@google.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net-next v2 6/8] net: phy: at803x: Make SmartEEE support optional and configurable via ethtool
Date: Tue, 28 Mar 2023 14:05:14 +0200	[thread overview]
Message-ID: <20230328120514.GF15196@pengutronix.de> (raw)
In-Reply-To: <20230327142202.3754446-7-o.rempel@pengutronix.de>

On Mon, Mar 27, 2023 at 04:22:00PM +0200, Oleksij Rempel wrote:
> This commit makes SmartEEE support in the AR8035 PHY optional and
> configurable through the ethtool eee_set/get interface. Before this
> patch, SmartEEE was always enabled except when a device tree option was
> preventing it. Since EEE support not only provides advantages in power
> management, but can also uncover compatibility issues and other bugs, it
> is beneficial to allow users to control this functionality.
> 
> By making SmartEEE support optional and configurable via ethtool, the
> at803x driver can adapt to different MAC configurations and properly
> handle EEE and LPI features. This flexibility empowers users to manage
> the trade-offs between power management, compatibility, and overall
> performance as needed.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  drivers/net/phy/at803x.c | 126 ++++++++++++++++++++++++++++++++++++---
>  1 file changed, 118 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> index 653d27a2e62b..4f65b3ebf806 100644
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -165,8 +165,18 @@
>  
>  #define AT803X_MMD3_SMARTEEE_CTL1		0x805b
>  #define AT803X_MMD3_SMARTEEE_CTL2		0x805c
> +#define AT803X_MMD3_SMARTEEE_LPI_TIME_LOW	GENMASK(15, 0)
> +#define AT803X_MMD3_SMARTEEE_LPI_TIME_15_0	GENMASK(15, 0)
>  #define AT803X_MMD3_SMARTEEE_CTL3		0x805d
>  #define AT803X_MMD3_SMARTEEE_CTL3_LPI_EN	BIT(8)
> +#define AT803X_MMD3_SMARTEEE_LPI_TIME_HIGH	GENMASK(7, 0)
> +#define AT803X_MMD3_SMARTEEE_LPI_TIME_23_16	GENMASK(23, 16)
> +/* Tx LPI timer resolution */
> +#define AT803X_MMD3_SMARTEEE_LPI_TIME_RESOL_NS	163840
> +#define AT803X_MMD3_SMARTEEE_LPI_TIME_MAX_US	\
> +	((GENMASK(23, 0) * AT803X_MMD3_SMARTEEE_LPI_TIME_RESOL_NS) / \
> +	       NSEC_PER_USEC)
> +#define AT803X_MMD3_SMARTEEE_LPI_TIME_DEF_US	335544
>  
>  #define ATH9331_PHY_ID				0x004dd041
>  #define ATH8030_PHY_ID				0x004dd076
> @@ -302,6 +312,8 @@ struct at803x_priv {
>  	u8 smarteee_lpi_tw_100m;
>  	bool is_fiber;
>  	bool is_1000basex;
> +	bool tx_lpi_on;

@Andrew, this variable can be replace by your phydev->tx_lpi_enabled
variable. Should I wait for your patches went mainline?

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2023-03-28 12:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 14:21 [PATCH net-next v2 0/8] Make SmartEEE support controllable Oleksij Rempel
2023-03-27 14:21 ` [PATCH net-next v2 1/8] net: phy: Add driver-specific get/set_eee support for non-standard PHYs Oleksij Rempel
2023-03-27 16:41   ` Andrew Lunn
2023-03-27 14:21 ` [PATCH net-next v2 2/8] net: phy: add is_smart_eee_phy variable for SmartEEE support Oleksij Rempel
2023-03-27 14:21 ` [PATCH net-next v2 3/8] net: phy: Add mac_supports_eee variable for EEE support and LPI handling Oleksij Rempel
2023-03-27 14:21 ` [PATCH net-next v2 4/8] ethtool: eee: Rework get/set handler for SmartEEE-capable PHYs with non-EEE MACs Oleksij Rempel
2023-03-27 20:45   ` kernel test robot
2023-03-28  3:36   ` kernel test robot
2023-03-27 14:21 ` [PATCH net-next v2 5/8] net: phy: at803x: Indicate SmartEEE support for AR8035 and AR8031 PHYs Oleksij Rempel
2023-03-27 14:22 ` [PATCH net-next v2 6/8] net: phy: at803x: Make SmartEEE support optional and configurable via ethtool Oleksij Rempel
2023-03-28 12:05   ` Oleksij Rempel [this message]
2023-03-28 12:49     ` Andrew Lunn
2023-03-28 13:00       ` Oleksij Rempel
2023-03-27 14:22 ` [PATCH net-next v2 7/8] net: phy: at803x: Fix SmartEEE support for some link configurations Oleksij Rempel
2023-03-27 14:22 ` [PATCH net-next v2 8/8] net: fec: Indicate EEE (LPI) support for some FEC Ethernet controllers Oleksij Rempel
2023-03-28  1:48   ` Wei Fang

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=20230328120514.GF15196@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=alexandru.tachici@analog.com \
    --cc=amcohen@nvidia.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=piergiorgio.beruto@gmail.com \
    --cc=shenwei.wang@nxp.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=willemb@google.com \
    --cc=xiaoning.wang@nxp.com \
    /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