mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Oleksij Rempel <o.rempel@pengutronix.de>
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>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	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 v8 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes
Date: Fri, 1 Mar 2024 23:38:52 +0100	[thread overview]
Message-ID: <8cafe975-e898-4f6a-9389-0a655d6dae22@lunn.ch> (raw)
In-Reply-To: <20240301100153.927743-6-o.rempel@pengutronix.de>

On Fri, Mar 01, 2024 at 11:01:50AM +0100, Oleksij Rempel wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> 
> The MAC driver changes its EEE hardware configuration in its
> adjust_link callback. This is called when auto-neg
> completes. Disabling EEE via eee_enabled false will trigger an
> autoneg, and as a result the adjust_link callback will be called with
> phydev->enable_tx_lpi set to false. Similarly, eee_enabled set to true
> and with a change of advertised link modes will result in a new
> autoneg, and a call the adjust_link call.
> 
> If set_eee is called with only a change to tx_lpi_enabled which does
> not trigger an auto-neg, it is necessary to call the adjust_link
> callback so that the MAC is reconfigured to take this change into
> account.
> 
> When setting phydev->enable_tx_lpi, take both eee_enabled and
> tx_lpi_enabled into account, so the MAC drivers just needs to act on
> phydev->enable_tx_lpi and not the whole EEE configuration.
> The same check should be done for tx_lpi_timer too.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

> +static void phy_ethtool_set_eee_noneg(struct phy_device *phydev,
> +				      struct ethtool_keee *data)
> +{
> +	if (phydev->eee_cfg.tx_lpi_enabled != data->tx_lpi_enabled ||
> +	    phydev->eee_cfg.tx_lpi_timer != data->tx_lpi_timer) {
> +		eee_to_eeecfg(data, &phydev->eee_cfg);
> +		phydev->enable_tx_lpi = eeecfg_mac_can_tx_lpi(&phydev->eee_cfg);
> +		if (phydev->link) {
> +			phydev->link = false;
> +			phy_link_down(phydev);
> +			phydev->link = true;
> +			phy_link_up(phydev);
> +		}
> +	}
> +}
> +

Thanks

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  reply	other threads:[~2024-03-01 22:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 10:01 [PATCH net-next v7 0/8] net: ethernet: Rework EEE Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 1/8] net: add helpers for EEE configuration Oleksij Rempel
2024-03-01 22:38   ` Heiner Kallweit
2024-03-01 10:01 ` [PATCH net-next v8 2/8] net: phy: Add phydev->enable_tx_lpi to simplify adjust link callbacks Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 3/8] net: phy: Add helper to set EEE Clock stop enable bit Oleksij Rempel
2024-03-02 17:16   ` Heiner Kallweit
2024-03-02 17:25     ` Russell King (Oracle)
2024-03-02 18:38       ` Andrew Lunn
2024-03-02 18:44         ` Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 4/8] net: phy: Keep track of EEE configuration Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes Oleksij Rempel
2024-03-01 22:38   ` Andrew Lunn [this message]
2024-03-01 10:01 ` [PATCH net-next v8 6/8] net: phy: Add phy_support_eee() indicating MAC support EEE Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 7/8] net: fec: Move fec_enet_eee_mode_set() and helper earlier Oleksij Rempel
2024-03-01 10:01 ` [PATCH net-next v8 8/8] net: fec: Fixup EEE Oleksij Rempel

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=8cafe975-e898-4f6a-9389-0a655d6dae22@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.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=o.rempel@pengutronix.de \
    --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

all inboxes | Powered by JetHome®