net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 12 May 2022 02:17:31 +0000 (19:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 May 2022 08:26:51 +0000 (10:26 +0200)
commite3e02d681d129eb98ac22bd2ab5137d11e3d7617
tree72f211edd545777360ff8963d712c372fc258602
parent18f03c3343d2094fede038dcff8f2b09bdea5e3c
net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()

[ Upstream commit b7be130c5d52e5224ac7d89568737b37b4c4b785 ]

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>
Link: https://lore.kernel.org/r/20220512021731.2494261-1-f.fainelli@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/bcm_sf2.c