r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 1 Feb 2021 20:50:56 +0000 (21:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2021 08:29:14 +0000 (09:29 +0100)
commit714c19bc13151962775c610b6ee507c455189d88
treecfdd86b1a6c62ada9cd086a532a74621538a2ec0
parent397ae1a245024bc68e371e9d40deea9f51451759
r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set

[ Upstream commit cc9f07a838c4988ed244d0907cb71d54b85482a5 ]

So far phy_disconnect() is called before free_irq(). If CONFIG_DEBUG_SHIRQ
is set and interrupt is shared, then free_irq() creates an "artificial"
interrupt by calling the interrupt handler. The "link change" flag is set
in the interrupt status register, causing phylib to eventually call
phy_suspend(). Because the net_device is detached from the PHY already,
the PHY driver can't recognize that WoL is configured and powers down the
PHY.

Fixes: f1e911d5d0df ("r8169: add basic phylib support")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/fe732c2c-a473-9088-3974-df83cfbd6efd@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/realtek/r8169_main.c