Skip to content

Commit 2a15cd2

Browse files
françois romieudavem330
authored andcommitted
r8169: runtime resume before shutdown.
With runtime PM, if the ethernet cable is disconnected, the device is transitioned to D3 state to conserve energy. If the system is shutdown in this state, any register accesses in rtl_shutdown are dropped on the floor. As the device was programmed by .runtime_suspend() to wake on link changes, it is thus brought back up as soon as the link recovers. Resuming every suspended device through the driver core would slow things down and it is not clear how many devices really need it now. Original report and D0 transition patch by Sameer Nanda. Patch has been changed to comply with advices by Rafael J. Wysocki and the PM folks. Reported-by: Sameer Nanda <[email protected]> Signed-off-by: Francois Romieu <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Hayes Wang <[email protected]> Cc: Alan Stern <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4648dc9 commit 2a15cd2

File tree

1 file changed

+5
-0
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+5
-0
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6194,6 +6194,9 @@ static void rtl_shutdown(struct pci_dev *pdev)
61946194
{
61956195
struct net_device *dev = pci_get_drvdata(pdev);
61966196
struct rtl8169_private *tp = netdev_priv(dev);
6197+
struct device *d = &pdev->dev;
6198+
6199+
pm_runtime_get_sync(d);
61976200

61986201
rtl8169_net_suspend(dev);
61996202

@@ -6215,6 +6218,8 @@ static void rtl_shutdown(struct pci_dev *pdev)
62156218
pci_wake_from_d3(pdev, true);
62166219
pci_set_power_state(pdev, PCI_D3hot);
62176220
}
6221+
6222+
pm_runtime_put_noidle(d);
62186223
}
62196224

62206225
static struct pci_driver rtl8169_pci_driver = {

0 commit comments

Comments
 (0)