diff mbox series

[net] net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()

Message ID 20220512021731.2494261-1-f.fainelli@gmail.com (mailing list archive)
State Accepted
Commit b7be130c5d52e5224ac7d89568737b37b4c4b785
Delegated to: Netdev Maintainers
Headers show
Series [net] net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Florian Fainelli May 12, 2022, 2:17 a.m. UTC
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.

Fixes: 2d1f90f9ba83 ("net: dsa/bcm_sf2: fix incorrect usage of state->link")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/bcm_sf2.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org May 12, 2022, 6:40 p.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 11 May 2022 19:17:31 -0700 you wrote:
> 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.
> 
> [...]

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!
diff mbox series

Patch

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index cf82b1fa9725..87e81c636339 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -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)