diff options
author | Chun-Hao Lin <hau@realtek.com> | 2016-07-29 04:37:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-31 23:34:05 -0400 |
commit | e06362369ae1e5b0ba70b66f8703ff08bcb63b23 (patch) | |
tree | 651fcc709247bce7d570bdc9534ee561a6aeb120 | |
parent | 5fa80a326d9dbd79d83148768c618e2da69e98e0 (diff) |
r8169: add checking driver's runtime pm status in rtl8169_get_ethtool_stats()
Not to call rtl8169_update_counters() to dump tally counter when driver
is in runtime suspend state.
Calling rtl8169_update_counters() in runtime suspend state will produce
warning message "rtl_counters_cond == 1 (loop: 1000, delay: 10)".
Signed-off-by: Chunhao Lin <hau@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/realtek/r8169.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 00c387bf41b7..d0b5cae2825f 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, | |||
2308 | struct ethtool_stats *stats, u64 *data) | 2308 | struct ethtool_stats *stats, u64 *data) |
2309 | { | 2309 | { |
2310 | struct rtl8169_private *tp = netdev_priv(dev); | 2310 | struct rtl8169_private *tp = netdev_priv(dev); |
2311 | struct device *d = &tp->pci_dev->dev; | ||
2311 | struct rtl8169_counters *counters = tp->counters; | 2312 | struct rtl8169_counters *counters = tp->counters; |
2312 | 2313 | ||
2313 | ASSERT_RTNL(); | 2314 | ASSERT_RTNL(); |
2314 | 2315 | ||
2315 | rtl8169_update_counters(dev); | 2316 | pm_runtime_get_noresume(d); |
2317 | |||
2318 | if (pm_runtime_active(d)) | ||
2319 | rtl8169_update_counters(dev); | ||
2320 | |||
2321 | pm_runtime_put_noidle(d); | ||
2316 | 2322 | ||
2317 | data[0] = le64_to_cpu(counters->tx_packets); | 2323 | data[0] = le64_to_cpu(counters->tx_packets); |
2318 | data[1] = le64_to_cpu(counters->rx_packets); | 2324 | data[1] = le64_to_cpu(counters->rx_packets); |