net: dsa: microchip: Fix KSZ9477 HSR port setup issue
PATCH 1/1 net: dsa: microchip: Fix KSZ9477 HSR port setup issue
From: Tristram Ha <[email protected]>
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.
--- drivers/net/dsa/microchip/ksz_common.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/dsa/microchip/ksz_common.c +6 -0
@@ -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); }
Signature · 1 line
2.34.1
Quoted 31 lines · On Mon, 18 Aug 2025 18:04:57 -0700 <[email protected]> wrote:
From: Tristram Ha <[email protected]>
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 insideksz_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 forKSZ9477") Reported-by: Frieder Schrempf <[email protected]>
Signed-off-by Tristram Ha <[email protected]>--- drivers/net/dsa/microchip/ksz_common.c | 6 ++++++ 1 file changed, 6 insertions(+)(quoted diff) +0
-0
b/drivers/net/dsa/microchip/ksz_common.cindex4cb14288ff0f..9568cc391fe3100644 ---a/drivers/net/dsa/microchip/ksz_common.c+++b/drivers/net/dsa/microchip/ksz_common.c@@ -2457,6 +2457,12 @@ static voidksz_update_port_member(struct ksz_device *dev, int port)dev->dev_ops->cfg_port_member(dev, i, val | cpu_port); }(quoted diff) +1
-0+ /* HSR ports are setup once so need to use the assignedmembership
drivers/net/dsa/microchip/ksz_common.c +5
-0+* 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 |
Quoted 2 lines
cpu_port); }
Signature · 10 lines
Best regards, Lukasz Majewski -- Nabla Software Engineering GmbH HRB 40522 Augsburg Phone: +49 821 45592596 E-Mail: [email protected] Geschftsfhrer : Stefano Babic
Am 19.08.25 um 03:04 schrieb [email protected]:
Quoted 11 lines
From: Tristram Ha <[email protected]>
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 insideksz_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 <[email protected]>Signed-off-by Tristram Ha <[email protected]>
Quoted 21 lines
--- drivers/net/dsa/microchip/ksz_common.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/net/dsa/microchip/ksz_common.c +6
-0@@ -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); }
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Mon, 18 Aug 2025 18:04:57 -0700 you wrote:
From: Tristram Ha <[email protected]>
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 insideksz_update_port_member(). The added code always use the correct HSR port membership for HSR port that is enabled.[...]
Here is the summary with links:
- [net] net: dsa: microchip: Fix KSZ9477 HSR port setup issue
https://git.kernel.org/netdev/net/c/e318cd671459
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html