summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/r8152.c
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2014-07-08 14:49:28 +0800
committerDavid S. Miller <davem@davemloft.net>2014-07-08 19:41:43 -0700
commit0b0302449110ca5ca4350458ed57b971fcb78ec1 (patch)
treeb5d0bf07e41250e5883cd1ea8b0f567152d65fdc /drivers/net/usb/r8152.c
parent36beddc272c111689f3042bf3d10a64d8a805f93 (diff)
r8152: wake up the device before dumping the hw counter
The device should be waked up from runtime suspend before dumping the hw counter. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/r8152.c')
-rw-r--r--drivers/net/usb/r8152.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 25431965a62..a795ecf8d5b 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3204,8 +3204,13 @@ static void rtl8152_get_ethtool_stats(struct net_device *dev,
struct r8152 *tp = netdev_priv(dev);
struct tally_counter tally;
+ if (usb_autopm_get_interface(tp->intf) < 0)
+ return;
+
generic_ocp_read(tp, PLA_TALLYCNT, sizeof(tally), &tally, MCU_TYPE_PLA);
+ usb_autopm_put_interface(tp->intf);
+
data[0] = le64_to_cpu(tally.tx_packets);
data[1] = le64_to_cpu(tally.rx_packets);
data[2] = le64_to_cpu(tally.tx_errors);