netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net v2] net: phy: fix phy_ethtool_set_eee() incorrectly enabling LPI
Date: Sat, 23 Nov 2024 14:03:28 +0000	[thread overview]
Message-ID: <Z0HgsAJWcJ_JzUxG@shell.armlinux.org.uk> (raw)
In-Reply-To: <77732422-1675-4e64-a6e5-42e21f2a2caa@gmail.com>

On Fri, Nov 22, 2024 at 09:28:04PM +0100, Heiner Kallweit wrote:
> On 22.11.2024 21:04, Heiner Kallweit wrote:
> > This part collides with a pending patch:
> > https://patchwork.kernel.org/project/netdevbpf/patch/a5efc274-ce58-49f3-ac8a-5384d9b41695@gmail.com/
> > I think you have to rebase and resubmit once the pending patch has been applied.
> 
> Merge of both changes should result in something like this:
> 
> static void phy_ethtool_set_eee_noneg(struct phy_device *phydev,
>                                       const struct eee_config *old_cfg)
> {
>         bool enable_tx_lpi;
> 
>         if (!phydev->link)
>                 return;
> 
>         enable_tx_lpi = phydev->eee_cfg.tx_lpi_enabled && phydev->eee_active;
> 
>         if (enable_tx_lpi != old_cfg->tx_lpi_enabled ||
>             phydev->eee_cfg.tx_lpi_timer != old_cfg->tx_lpi_timer) {
>                 phydev->enable_tx_lpi = false;
>                 phydev->link = false;
>                 phy_link_down(phydev);
>                 phydev->enable_tx_lpi = enable_tx_lpi;
>                 phydev->link = true;
>                 phy_link_up(phydev);
>         }
> }

Thanks for pointing this out - I've now merged your patch into my tree
and rebased on top. Your resolution isn't quite right - the if()
statement should be:

+       if (phydev->enable_tx_lpi != enable_tx_lpi ||
            phydev->eee_cfg.tx_lpi_timer != old_cfg->tx_lpi_timer) {

Since we only need to bounce the link if the LPI timer or the MAC LPI
enable state has changed. I'll send a replacement patch shortly.

-- 
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-11-23 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 12:22 [PATCH net v2] net: phy: fix phy_ethtool_set_eee() incorrectly enabling LPI Russell King (Oracle)
2024-11-22 13:10 ` Andrew Lunn
2024-11-22 20:04 ` Heiner Kallweit
2024-11-22 20:28   ` Heiner Kallweit
2024-11-23 14:03     ` Russell King (Oracle) [this message]

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=Z0HgsAJWcJ_JzUxG@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).