Re: [PATCH net 11/12] net: systemport: Update TDMA queue mapping dynamically on changeupper
flat view
From: Nicolai Buchwitz <nb@tipi-net.de>
Date: 2026-09-22 09:42:23
Also in:
lkml
Hi Florian On 22.9.2026 01:13, Florian Fainelli wrote:
quoted hunk ↗ jump to hunk
When DSA upper devices are dynamically attached or detached while the master SYSTEMPORT interface is already up and running (netif_running()), bcm_sysport_map_queues() and bcm_sysport_unmap_queues() updated the internal software mappings but did not update the TDMA_DESC_RING_MAPPING hardware registers, because programming was previously deferred until bcm_sysport_init_tx_ring(). Update TDMA_DESC_RING_MAPPING registers immediately if netif_running() is true during map_queues and unmap_queues. Fixes: 1593cd40d785 ("net: systemport: use standard netdevice notifier to detect DSA presence") Assisted-by: LLM Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> --- drivers/net/ethernet/broadcom/bcmsysport.c | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index dd5a7c9dd90f..e5bb7fa84fda 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c
[...]
quoted hunk ↗ jump to hunk
@@ -2390,6 +2399,14 @@ static int bcm_sysport_unmap_queues(struct net_device *dev, qp = ring->switch_queue; if (qp + port * num_tx_queues < ARRAY_SIZE(priv->ring_map)) priv->ring_map[qp + port * num_tx_queues] = NULL; + + if (netif_running(dev)) { + reg = tdma_readl(priv, TDMA_DESC_RING_MAPPING(q)); + reg &= ~(RING_QID_MASK | + RING_PORT_ID_MASK << RING_PORT_ID_SHIFT); + reg |= RING_IGNORE_STATUS; + tdma_writel(priv, reg, TDMA_DESC_RING_MAPPING(q)); + }
RING_IGNORE_STATUS is never cleared in init_tx_rings(), so
echo <sf2-node> > /sys/bus/platform/drivers/brcm-sf2/unbind
ip link set eth0 down
echo <sf2-node> > /sys/bus/platform/drivers/brcm-sf2/bind
ip link set eth0 up
keeps the bit set from unmap. Clear it in init_tx_ring() too?
[...]
Thanks, Nicolai