Netdev List
 help / color / mirror / Atom feed
* [PATCH net] net: bcmgenet: keep RBUF EEE/PM disabled
@ 2026-05-20 18:43 Nicolai Buchwitz
  2026-05-20 18:45 ` Florian Fainelli
  2026-05-21 15:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolai Buchwitz @ 2026-05-20 18:43 UTC (permalink / raw)
  To: opendmb, florian.fainelli, andrew+netdev, davem, edumazet, kuba,
	pabeni
  Cc: justin.chen, phil, bcm-kernel-feedback-list, netdev, linux-kernel,
	stable, Nicolai Buchwitz

Setting RBUF_EEE_EN | RBUF_PM_EN in RBUF_ENERGY_CTRL breaks the RX
path on GENET hardware once MAC EEE becomes active. RX traffic stops
flowing while the link stays up and the usual descriptor/RX error
counters remain quiet. In that state the MAC still accepts frames
(rbuf_ovflow_cnt keeps climbing) but RBUF no longer forwards them to
DMA, so rx_packets is no longer incremented at the netdev level. On
some boards the corruption ends up as a paging fault in
skb_release_data via bcmgenet_rx_poll on an LPI exit.

Reproduced on Pi 4B (BCM2711 + BCM54213PE) and confirmed by Florian
Fainelli on an internal Broadcom 4908-family board with the same crash
signature. RBUF_PM_EN is not publicly documented.

This shows up more often now that phy_support_eee() enables EEE by
default, but it also affects older kernels as soon as TX LPI is
turned on via ethtool, so it is not specific to recent changes.

Always clear RBUF_EEE_EN | RBUF_PM_EN in bcmgenet_eee_enable_set so
the bits stay off across resets. UMAC and TBUF setup is left alone so
TX-side EEE keeps working.

Link: https://github.com/raspberrypi/linux/issues/7304
Fixes: 6ef398ea60d9 ("net: bcmgenet: add EEE support")
Cc: stable@vger.kernel.org
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 54f71b1e85fc..7c11cf916762 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -1368,13 +1368,12 @@ void bcmgenet_eee_enable_set(struct net_device *dev, bool enable)
 		reg &= ~(TBUF_EEE_EN | TBUF_PM_EN);
 	bcmgenet_writel(reg, priv->base + off);
 
-	/* Do the same for thing for RBUF */
+	/* RBUF EEE/PM can break the RX path on GENET. Keep it disabled. */
 	reg = bcmgenet_rbuf_readl(priv, RBUF_ENERGY_CTRL);
-	if (enable)
-		reg |= RBUF_EEE_EN | RBUF_PM_EN;
-	else
+	if (reg & (RBUF_EEE_EN | RBUF_PM_EN)) {
 		reg &= ~(RBUF_EEE_EN | RBUF_PM_EN);
-	bcmgenet_rbuf_writel(priv, reg, RBUF_ENERGY_CTRL);
+		bcmgenet_rbuf_writel(priv, reg, RBUF_ENERGY_CTRL);
+	}
 
 	if (!enable && priv->clk_eee_enabled) {
 		clk_disable_unprepare(priv->clk_eee);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: bcmgenet: keep RBUF EEE/PM disabled
  2026-05-20 18:43 [PATCH net] net: bcmgenet: keep RBUF EEE/PM disabled Nicolai Buchwitz
@ 2026-05-20 18:45 ` Florian Fainelli
  2026-05-21 15:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2026-05-20 18:45 UTC (permalink / raw)
  To: Nicolai Buchwitz, opendmb, andrew+netdev, davem, edumazet, kuba,
	pabeni
  Cc: justin.chen, phil, bcm-kernel-feedback-list, netdev, linux-kernel,
	stable

On 5/20/26 11:43, Nicolai Buchwitz wrote:
> Setting RBUF_EEE_EN | RBUF_PM_EN in RBUF_ENERGY_CTRL breaks the RX
> path on GENET hardware once MAC EEE becomes active. RX traffic stops
> flowing while the link stays up and the usual descriptor/RX error
> counters remain quiet. In that state the MAC still accepts frames
> (rbuf_ovflow_cnt keeps climbing) but RBUF no longer forwards them to
> DMA, so rx_packets is no longer incremented at the netdev level. On
> some boards the corruption ends up as a paging fault in
> skb_release_data via bcmgenet_rx_poll on an LPI exit.
> 
> Reproduced on Pi 4B (BCM2711 + BCM54213PE) and confirmed by Florian
> Fainelli on an internal Broadcom 4908-family board with the same crash
> signature. RBUF_PM_EN is not publicly documented.
> 
> This shows up more often now that phy_support_eee() enables EEE by
> default, but it also affects older kernels as soon as TX LPI is
> turned on via ethtool, so it is not specific to recent changes.
> 
> Always clear RBUF_EEE_EN | RBUF_PM_EN in bcmgenet_eee_enable_set so
> the bits stay off across resets. UMAC and TBUF setup is left alone so
> TX-side EEE keeps working.
> 
> Link: https://github.com/raspberrypi/linux/issues/7304
> Fixes: 6ef398ea60d9 ("net: bcmgenet: add EEE support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>

Thank you Nicolai!
-- 
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: bcmgenet: keep RBUF EEE/PM disabled
  2026-05-20 18:43 [PATCH net] net: bcmgenet: keep RBUF EEE/PM disabled Nicolai Buchwitz
  2026-05-20 18:45 ` Florian Fainelli
@ 2026-05-21 15:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-21 15:50 UTC (permalink / raw)
  To: Nicolai Buchwitz
  Cc: opendmb, florian.fainelli, andrew+netdev, davem, edumazet, kuba,
	pabeni, justin.chen, phil, bcm-kernel-feedback-list, netdev,
	linux-kernel, stable

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 20 May 2026 20:43:20 +0200 you wrote:
> Setting RBUF_EEE_EN | RBUF_PM_EN in RBUF_ENERGY_CTRL breaks the RX
> path on GENET hardware once MAC EEE becomes active. RX traffic stops
> flowing while the link stays up and the usual descriptor/RX error
> counters remain quiet. In that state the MAC still accepts frames
> (rbuf_ovflow_cnt keeps climbing) but RBUF no longer forwards them to
> DMA, so rx_packets is no longer incremented at the netdev level. On
> some boards the corruption ends up as a paging fault in
> skb_release_data via bcmgenet_rx_poll on an LPI exit.
> 
> [...]

Here is the summary with links:
  - [net] net: bcmgenet: keep RBUF EEE/PM disabled
    https://git.kernel.org/netdev/net/c/9a1730245e41

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-21 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20 18:43 [PATCH net] net: bcmgenet: keep RBUF EEE/PM disabled Nicolai Buchwitz
2026-05-20 18:45 ` Florian Fainelli
2026-05-21 15:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox