[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5bc628cd-b638-df9a-c0bc-5b15105a8fb1@gmail.com>
Date: Tue, 17 Jul 2018 21:21:37 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Realtek linux nic maintainers <nic_swsd@...ltek.com>,
David Miller <davem@...emloft.net>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH net-next] r8169: power down chip in probe
The removed code would be called in two situations:
1. interface is brought up never or >10s after driver load
2. after close()
Case 1 we can handle cleaner by ensuring chip is powered down when
leaving probe(). open() callback will power up the chip.
In case 2 we call rtl_pll_power_down() twice currently, from the
close() callback and 10s later when entering runtime-suspend.
This is avoided by this patch.
Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
---
drivers/net/ethernet/realtek/r8169.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 9d5c7b17..e5f6f8c5 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7183,10 +7183,8 @@ static int rtl8169_runtime_suspend(struct device *device)
struct net_device *dev = pci_get_drvdata(pdev);
struct rtl8169_private *tp = netdev_priv(dev);
- if (!tp->TxDescArray) {
- rtl_pll_power_down(tp);
+ if (!tp->TxDescArray)
return 0;
- }
rtl_lock_work(tp);
__rtl8169_set_wol(tp, WAKE_ANY);
@@ -7645,6 +7643,9 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_drvdata(pdev, dev);
+ /* chip gets powered up in rtl_open() */
+ rtl_pll_power_down(tp);
+
rc = register_netdev(dev);
if (rc < 0)
return rc;
--
2.18.0
Powered by blists - more mailing lists