netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: 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>,
	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>
Subject: Re: [PATCH net-next v5 6/8] net: phy: Add phy_support_eee() indicating MAC support EEE
Date: Fri, 23 Feb 2024 06:47:49 +0100	[thread overview]
Message-ID: <ZdgxhVuT6d-N0M5T@pengutronix.de> (raw)
In-Reply-To: <9e37a9e9-7722-407c-a2a5-b8c04b68f594@gmail.com>

On Thu, Feb 22, 2024 at 08:52:25PM -0800, Florian Fainelli wrote:
> 
> 
> On 2/20/2024 10:21 PM, Oleksij Rempel wrote:
> > From: Andrew Lunn <andrew@lunn.ch>
> > 
> > In order for EEE to operate, both the MAC and the PHY need to support
> > it, similar to how pause works.
> 
> Kinda, a number of PHYs have added support for SmartEEE or AutoGrEEEn in
> order to provide some EEE-like power savings with non-EEE capable MACs.

Will reword it.

> Oleksij  did not you have a patch series at some point that introduced a
> smarteee field in the phy_device structure to reflect that? I thought that
> had been accepted, but maybe not.

Ack. They are pending at the end of EEE refactoring queue :)

> > Copy the pause concept and add the
> > call phy_support_eee() which the MAC makes after connecting the PHY to
> > indicate it supports EEE. phylib will then advertise EEE when auto-neg
> > is performed.
> > 
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > ---
> >   drivers/net/phy/phy_device.c | 18 ++++++++++++++++++
> >   include/linux/phy.h          |  3 ++-
> >   2 files changed, 20 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> > index 2eefee970851..269d3c7f0849 100644
> > --- a/drivers/net/phy/phy_device.c
> > +++ b/drivers/net/phy/phy_device.c
> > @@ -2910,6 +2910,24 @@ void phy_advertise_eee_all(struct phy_device *phydev)
> >   }
> >   EXPORT_SYMBOL_GPL(phy_advertise_eee_all);
> > +/**
> > + * phy_support_eee - Enable support of EEE
> > + * @phydev: target phy_device struct
> > + *
> > + * Description: Called by the MAC to indicate is supports Energy
> > + * Efficient Ethernet. This should be called before phy_start() in
> > + * order that EEE is negotiated when the link comes up as part of
> > + * phy_start(). EEE is enabled by default when the hardware supports
> > + * it.
> 
> That comment is a bit confusing without mentioning how the hardware default
> state wrt. EEE is being factored in, can we have some details here?

If I see it correctly, this function set initial EEE policy for the PHY.
It should be called only once at PHY registration by the MAC and/or by
the PHY in case of SmartEEE or AutoGrEEEn PHY.

The advertisement configuration will be based on already filtered set of
supported modes.

-- 
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:[~2024-02-23  5:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21  6:20 [PATCH net-next v5 0/8] net: ethernet: Rework EEE Oleksij Rempel
2024-02-21  6:21 ` [PATCH net-next v5 1/8] net: add helpers for EEE configuration Oleksij Rempel
2024-02-23  4:53   ` Florian Fainelli
2024-02-21  6:21 ` [PATCH net-next v5 2/8] net: phy: Add phydev->enable_tx_lpi to simplify adjust link callbacks Oleksij Rempel
2024-02-23  5:36   ` Wei Fang
2024-02-23  6:58     ` Heiner Kallweit
2024-02-21  6:21 ` [PATCH net-next v5 3/8] net: phy: Add helper to set EEE Clock stop enable bit Oleksij Rempel
2024-02-23  4:47   ` Florian Fainelli
2024-02-23  8:54     ` Oleksij Rempel
2024-02-21  6:21 ` [PATCH net-next v5 4/8] net: phy: Keep track of EEE configuration Oleksij Rempel
2024-02-23  3:25   ` Jakub Kicinski
2024-02-23  4:53   ` Florian Fainelli
2024-02-21  6:21 ` [PATCH net-next v5 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes Oleksij Rempel
2024-02-23  4:51   ` Florian Fainelli
2024-02-21  6:21 ` [PATCH net-next v5 6/8] net: phy: Add phy_support_eee() indicating MAC support EEE Oleksij Rempel
2024-02-23  4:52   ` Florian Fainelli
2024-02-23  5:47     ` Oleksij Rempel [this message]
2024-02-23 11:21     ` Russell King (Oracle)
2024-02-21  6:21 ` [PATCH net-next v5 7/8] net: fec: Move fec_enet_eee_mode_set() and helper earlier Oleksij Rempel
2024-02-23  6:03   ` Wei Fang
2024-02-21  6:21 ` [PATCH net-next v5 8/8] net: fec: Fixup EEE Oleksij Rempel
2024-02-23  6:03   ` 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=ZdgxhVuT6d-N0M5T@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.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=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.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;
as well as URLs for NNTP newsgroup(s).