Skip to contentSkip to conversation

r8169: Disable clk during suspend / resume

PATCH Applied Hans de Goede 2 participants 2 messages Sep 27, 2018 – Sep 30, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 r8169: Disable clk during suspend / resume

Disable the clk during suspend to save power. Note that tp->clk may be NULL, the clk core functions handle this without problems.

---
 drivers/net/ethernet/realtek/r8169.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/realtek/r8169.c +5 -0
index 474229548731..c289350fb98f 100644
@@ -6852,8 +6852,10 @@ static int rtl8169_suspend(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
+	struct rtl8169_private *tp = netdev_priv(dev);
 
 	rtl8169_net_suspend(dev);
+	clk_disable_unprepare(tp->clk);
 
 	return 0;
 }
@@ -6881,6 +6883,9 @@ static int rtl8169_resume(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
+	struct rtl8169_private *tp = netdev_priv(dev);
+
+	clk_prepare_enable(tp->clk);
 
 	if (netif_running(dev))
 		__rtl8169_resume(dev);
Signature · 1 line
2.19.0