From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Nicolai Buchwitz <nb@tipi-net.de>, netdev@vger.kernel.org
Cc: opendmb@gmail.com, bcm-kernel-feedback-list@broadcom.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, o.rempel@pengutronix.de,
rmk+kernel@armlinux.org.uk, Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH net] net: bcmgenet: fix broken EEE by converting to phylib-managed state
Date: Fri, 6 Mar 2026 15:59:23 -0800 [thread overview]
Message-ID: <f604ba58-f8ea-43d6-a49e-400e781c23ae@broadcom.com> (raw)
In-Reply-To: <20260306083120.1076104-1-nb@tipi-net.de>
On 3/6/26 00:31, Nicolai Buchwitz wrote:
> The bcmgenet EEE implementation is broken in several ways.
> phy_support_eee() is never called, so the PHY never advertises EEE
> and phylib never sets phydev->enable_tx_lpi. bcmgenet_mac_config()
> checks priv->eee.eee_enabled to decide whether to enable the MAC
> LPI logic, but that field is never initialised to true, so the MAC
> never enters Low Power Idle even when EEE is negotiated - wasting
> the power savings EEE is designed to provide. The only way to get
> EEE working at all is a manual 'ethtool --set-eee eth0 eee on' after
> every link-up, and even then bcmgenet_get_eee() immediately clobbers
> the reported state because phy_ethtool_get_eee() overwrites
> eee_enabled and tx_lpi_enabled with the uninitialised PHY eee_cfg
> values. Finally, bcmgenet_mac_config() is only called on link-up,
> so EEE is never disabled in hardware on link-down.
>
> Fix all of this by removing the MAC-side EEE state tracking
> (priv->eee) and aligning with the pattern used by other non-phylink
> MAC drivers such as FEC.
>
> Call phy_support_eee() in bcmgenet_mii_probe() so the PHY advertises
> EEE link modes and phylib tracks negotiation state. Move the EEE
> hardware control to bcmgenet_mii_setup(), which is called on every
> link event, and drive it directly from phydev->enable_tx_lpi - the
> flag phylib sets when EEE is negotiated and the user has not disabled
> it. This enables EEE automatically once the link partner agrees and
> disables it cleanly on link-down.
>
> Make bcmgenet_get_eee() and bcmgenet_set_eee() pure passthroughs to
> phy_ethtool_get_eee() and phy_ethtool_set_eee(), with the MAC
> hardware register read/written for tx_lpi_timer. Drop struct
> ethtool_keee eee from struct bcmgenet_priv.
>
> Fixes: fe0d4fd9285e ("net: phy: Keep track of EEE configuration")
> Link: https://lore.kernel.org/netdev/d352039f-4cbb-41e6-9aeb-0b4f3941b54c@lunn.ch/
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
next prev parent reply other threads:[~2026-03-06 23:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 8:31 [PATCH net] net: bcmgenet: fix broken EEE by converting to phylib-managed state Nicolai Buchwitz
2026-03-06 23:59 ` Florian Fainelli [this message]
2026-03-10 1:37 ` Jakub Kicinski
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=f604ba58-f8ea-43d6-a49e-400e781c23ae@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
/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