Skip to content

Commit

Permalink
r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set
Browse files Browse the repository at this point in the history
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: f1e911d ("r8169: add basic phylib support")
Signed-off-by: Heiner Kallweit <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
hkallweit authored and kuba-moo committed Feb 2, 2021
1 parent a11148e commit cc9f07a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/realtek/r8169_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4704,10 +4704,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,
Expand Down

0 comments on commit cc9f07a

Please sign in to comment.