Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1451410 > unrolled thread
| Started by | Chunhao Lin <hau@realtek.com> |
|---|---|
| First post | 2016-07-27 19:00 +0200 |
| Last post | 2016-07-27 19:00 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH net 2/3] r8169:add checking driver's runtime pm status in rtl8169_get_ethtool_stats() Chunhao Lin <hau@realtek.com> - 2016-07-27 19:00 +0200
| From | Chunhao Lin <hau@realtek.com> |
|---|---|
| Date | 2016-07-27 19:00 +0200 |
| Subject | [PATCH net 2/3] r8169:add checking driver's runtime pm status in rtl8169_get_ethtool_stats() |
| Message-ID | <rZAlA-1Uf-13@gated-at.bofh.it> |
Not to call rtl8169_update_counters() to dump tally counter when driver is in
runtime suspend state.
Signed-off-by: Chunhao Lin <hau@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index f07604f..4a17342 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -2308,11 +2308,17 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
struct rtl8169_private *tp = netdev_priv(dev);
+ struct pci_dev *pdev = tp->pci_dev;
struct rtl8169_counters *counters = tp->counters;
ASSERT_RTNL();
- rtl8169_update_counters(dev);
+ pm_runtime_get_noresume(&pdev->dev);
+
+ if (pm_runtime_active(&pdev->dev))
+ rtl8169_update_counters(dev);
+
+ pm_runtime_put_noidle(&pdev->dev);
data[0] = le64_to_cpu(counters->tx_packets);
data[1] = le64_to_cpu(counters->rx_packets);
--
1.9.1
Back to top | Article view | linux.kernel
csiph-web