All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: microchip: Fix KSZ9477 HSR port setup issue
@ 2025-08-19  1:04 Tristram.Ha
  2025-08-19  7:22 ` Łukasz Majewski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tristram.Ha @ 2025-08-19  1:04 UTC (permalink / raw)
  To: Woojung Huh, Andrew Lunn, Vladimir Oltean, Frieder Schrempf
  Cc: Łukasz Majewski, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, UNGLinuxDriver, netdev, linux-kernel,
	Tristram Ha

From: Tristram Ha <tristram.ha@microchip.com>

ksz9477_hsr_join() is called once to setup the HSR port membership, but
the port can be enabled later, or disabled and enabled back and the port
membership is not set correctly inside ksz_update_port_member().  The
added code always use the correct HSR port membership for HSR port that
is enabled.

Fixes: 2d61298fdd7b ("net: dsa: microchip: Enable HSR offloading for KSZ9477")
Reported-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
---
 drivers/net/dsa/microchip/ksz_common.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 4cb14288ff0f..9568cc391fe3 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -2457,6 +2457,12 @@ static void ksz_update_port_member(struct ksz_device *dev, int port)
 		dev->dev_ops->cfg_port_member(dev, i, val | cpu_port);
 	}
 
+	/* HSR ports are setup once so need to use the assigned membership
+	 * when the port is enabled.
+	 */
+	if (!port_member && p->stp_state == BR_STATE_FORWARDING &&
+	    (dev->hsr_ports & BIT(port)))
+		port_member = dev->hsr_ports;
 	dev->dev_ops->cfg_port_member(dev, port, port_member | cpu_port);
 }
 
-- 
2.34.1


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

end of thread, other threads:[~2025-08-21  2:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19  1:04 [PATCH net] net: dsa: microchip: Fix KSZ9477 HSR port setup issue Tristram.Ha
2025-08-19  7:22 ` Łukasz Majewski
2025-08-19  7:30 ` Frieder Schrempf
2025-08-21  2:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.