From: hayeswang Date: Tue, 8 Jul 2014 06:49:28 +0000 (+0800) Subject: r8152: wake up the device before dumping the hw counter X-Git-Tag: v4.9.8~6099^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b0302449110ca5ca4350458ed57b971fcb78ec1;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2543196..a795ecf 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);