[PATCH net 3/4] net: bcmgenet: let the interface be reopened after a failed resume
From: Nicolai Buchwitz
Date: Sat Oct 17 2026 - 08:00:02 EST
bcmgenet_suspend() detaches the device and a resume that fails in
bcmgenet_init_dma() never attaches it again, so an ifdown and ifup cannot
bring the interface back:
# ip link set eth0 up
RTNETLINK answers: No such device
That resume also gates the clock and powers the block down before it
returns. Close and the next suspend_noirq then release a clock that is
already released, which the clock core warns about. Leave the hardware as
bcmgenet_resume_noirq() set it up, so the clock stays on while the
interface is up and close or suspend releases it once.
Attach again in close, where __dev_close_many() has already cleared
__LINK_STATE_START, so no queue is woken.
Fixes: b6e978e50444 ("net: bcmgenet: add suspend/resume callbacks")
Signed-off-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index fe3338ba81980..cb9951d6036fb 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3508,6 +3508,9 @@ static int bcmgenet_close(struct net_device *dev)
free_irq(priv->irq0, priv);
free_irq(priv->irq1, priv);
+ /* A failed resume left the device detached, __dev_open() refuses that */
+ netif_device_attach(dev);
+
if (priv->internal_phy)
ret = bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
@@ -4324,8 +4327,9 @@ static int bcmgenet_resume(struct device *d)
/* Reinitialize TDMA and RDMA and SW housekeeping */
ret = bcmgenet_init_dma(priv, false);
if (ret) {
+ /* Leave the block clocked, close and suspend tear it down */
netdev_err(dev, "failed to initialize DMA\n");
- goto out_clk_disable;
+ return ret;
}
if (!device_may_wakeup(d))
@@ -4336,12 +4340,6 @@ static int bcmgenet_resume(struct device *d)
netif_device_attach(dev);
return 0;
-
-out_clk_disable:
- if (priv->internal_phy)
- bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
- clk_disable_unprepare(priv->clk);
- return ret;
}
static int bcmgenet_suspend(struct device *d)
--
2.53.0