Skip to content

Commit b7be130

Browse files
ffainellikuba-moo
authored andcommitted
net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()
After commit 2d1f90f ("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. Fixes: 2d1f90f ("net: dsa/bcm_sf2: fix incorrect usage of state->link") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20220512021731.2494261-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 810c2f0 commit b7be130

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/net/dsa/bcm_sf2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,9 @@ static void bcm_sf2_sw_mac_link_down(struct dsa_switch *ds, int port,
809809
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
810810
u32 reg, offset;
811811

812+
if (priv->wol_ports_mask & BIT(port))
813+
return;
814+
812815
if (port != core_readl(priv, CORE_IMP0_PRT_ID)) {
813816
if (priv->type == BCM4908_DEVICE_ID ||
814817
priv->type == BCM7445_DEVICE_ID)

0 commit comments

Comments
 (0)