netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
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>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	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 v7 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes
Date: Thu, 29 Feb 2024 21:19:34 +0000	[thread overview]
Message-ID: <ZeD05pY1RdKNtrDZ@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240229140800.3420180-6-o.rempel@pengutronix.de>

On Thu, Feb 29, 2024 at 03:07:57PM +0100, Oleksij Rempel wrote:
> +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) {
> +			phy_link_down(phydev);
> +			phy_link_up(phydev);

Unfortunately, this isn't sufficient in all cases. Phylink will be fine
with this though.

If we take a look at fec_enet_adjust_link(), then we can see it tests
phydev->link directly (which it has to, because there's nothing else
to determine whether the link is up or down. FEC will cope with its
fec_enet_adjust_link() being called with no changes however.

In order to properly resolve this, I think we need:

		if (phydev->link) {
			phydev->link = false;
			phy_link_down(phydev);
			phydev->link = true;
			phy_link_up(phydev);

to properly avoid the issue I've referred to.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2024-02-29 21:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 14:07 [PATCH net-next v7 0/8] net: ethernet: Rework EEE Oleksij Rempel
2024-02-29 14:07 ` [PATCH net-next v7 1/8] net: add helpers for EEE configuration Oleksij Rempel
2024-02-29 14:07 ` [PATCH net-next v7 2/8] net: phy: Add phydev->enable_tx_lpi to simplify adjust link callbacks Oleksij Rempel
2024-02-29 14:07 ` [PATCH net-next v7 3/8] net: phy: Add helper to set EEE Clock stop enable bit Oleksij Rempel
2024-02-29 14:07 ` [PATCH net-next v7 4/8] net: phy: Keep track of EEE configuration Oleksij Rempel
2024-02-29 14:07 ` [PATCH net-next v7 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes Oleksij Rempel
2024-02-29 21:19   ` Russell King (Oracle) [this message]
2024-02-29 14:07 ` [PATCH net-next v7 6/8] net: phy: Add phy_support_eee() indicating MAC support EEE Oleksij Rempel
2024-02-29 14:07 ` [PATCH net-next v7 7/8] net: fec: Move fec_enet_eee_mode_set() and helper earlier Oleksij Rempel
2024-02-29 14:08 ` [PATCH net-next v7 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=ZeD05pY1RdKNtrDZ@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=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=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;
as well as URLs for NNTP newsgroup(s).