Re: [PATCH net 12/12] net: systemport: Complete resource teardown even on DMA disable timeout

From: Nicolai Buchwitz

Date: Tue Sep 22 2026 - 05:56:07 EST


Hi Florian

On 22.9.2026 01:13, Florian Fainelli wrote:
In bcm_sysport_stop(), if tdma_enable_set() or rdma_enable_set() timed
out, the function returned early with an error code. However, ndo_stop()
callers in the networking core ignore error returns, leaving the
software ring structures allocated, interrupts registered, PHY
connected, and clock enabled. If the interface was subsequently brought
up again, request_irq() and PHY connection would fail or leak.

Ensure all software ring teardown, interrupt freeing, PHY
disconnection, and clock disabling steps are executed regardless of DMA
disable timeouts.

Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Assisted-by: LLM
Signed-off-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
---
drivers/net/ethernet/broadcom/bcmsysport.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index e5bb7fa84fda..2b064da4eb7c 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -2088,19 +2088,15 @@ static int bcm_sysport_stop(struct net_device *dev)
umac_enable_set(priv, CMD_RX_EN, 0);

ret = tdma_enable_set(priv, 0);
- if (ret) {
+ if (ret)
netdev_err(dev, "timeout disabling TDMA\n");
- return ret;
- }

/* Wait for a maximum packet size to be drained */
usleep_range(2000, 3000);

ret = rdma_enable_set(priv, 0);
- if (ret) {
+ if (ret)
netdev_err(dev, "timeout disabling RDMA\n");
- return ret;
- }

If TDMA or RDMA don't stop, the rings get freed while the hardware may
still use them. Maybe topctrl_flush() before freeing?

The same pattern would probably apply to bcm_sysport_suspend().

[...]

Thanks,
Nicolai