netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set
@ 2021-02-01 20:50 Heiner Kallweit
  2021-02-02 16:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2021-02-01 20:50 UTC (permalink / raw)
  To: Jakub Kicinski, David Miller, Realtek linux nic maintainers; +Cc: netdev

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>
---
 drivers/net/ethernet/realtek/r8169_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 4253d51a9..53c2079c7 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4667,10 +4667,10 @@ static int rtl8169_close(struct net_device *dev)
 
 	cancel_work_sync(&tp->wk.work);
 
-	phy_disconnect(tp->phydev);
-
 	free_irq(pci_irq_vector(pdev, 0), tp);
 
+	phy_disconnect(tp->phydev);
+
 	dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
 			  tp->RxPhyAddr);
 	dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
-- 
2.30.0


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

* Re: [PATCH net] r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set
  2021-02-01 20:50 [PATCH net] r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set Heiner Kallweit
@ 2021-02-02 16:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-02 16:50 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: kuba, davem, nic_swsd, netdev

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Mon, 1 Feb 2021 21:50:56 +0100 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net] r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set
    https://git.kernel.org/netdev/net/c/cc9f07a838c4

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:[~2021-02-02 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 20:50 [PATCH net] r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set Heiner Kallweit
2021-02-02 16:50 ` 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).