linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()
@ 2022-05-12  2:17 Florian Fainelli
  2022-05-12 18:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2022-05-12  2:17 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Andrew Lunn, Vivien Didelot, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Russell King, open list

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(+)

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)
-- 
2.25.1


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

* Re: [PATCH net] net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()
  2022-05-12  2:17 [PATCH net] net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down() Florian Fainelli
@ 2022-05-12 18:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-12 18:40 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, andrew, vivien.didelot, olteanv, davem, edumazet, kuba,
	pabeni, rmk+kernel, linux-kernel

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-05-12 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12  2:17 [PATCH net] net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down() Florian Fainelli
2022-05-12 18:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).