net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()
PATCH 1/1 net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()
After commit 2d1f90f9ba83 ("net: dsa/bcm_sf2: fix incorrect usage of state->link") the interface suspend path would call our mac_link_down() call back which would forcibly set the link down, thus preventing Wake-on-LAN packets from reaching our management port.
Fix this by looking at whether the port is enabled for Wake-on-LAN and not clearing the link status in that case to let packets go through.
--- drivers/net/dsa/bcm_sf2.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/dsa/bcm_sf2.c +3 -0
@@ -809,6 +809,9 @@ static void bcm_sf2_sw_mac_link_down(struct dsa_switch *ds, int port,struct bcm_sf2_priv *priv =bcm_sf2_to_priv (ds);u32 reg, offset; +if (priv->wol_ports_mask &BIT (port)) +return ; +if (port !=core_readl (priv,CORE_IMP0_PRT_ID )) {if (priv->type ==BCM4908_DEVICE_ID || priv->type ==BCM7445_DEVICE_ID )
Signature · 1 line
2.25.1
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Wed, 11 May 2022 19:17:31 -0700 you wrote:
After commit
2d1f90f9ba83("net: dsa/bcm_sf2: fix incorrect usage ofstate->link") the interface suspend path would call ourmac_link_down()call back which would forcibly set the link down, thus preventing Wake-on-LAN packets from reaching our management port.Fix this by looking at whether the port is enabled for Wake-on-LAN and not clearing the link status in that case to let packets go through.
[...]
Here is the summary with links:
- [net] net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()
https://git.kernel.org/netdev/net/c/b7be130c5d52
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html