summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/r8152.c
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2014-10-29 04:12:16 +0100
committerDavid S. Miller <davem@davemloft.net>2014-10-30 20:49:00 +0100
commitf4c7476b041d200c3b347f019eebf05e6d0b47f9 (patch)
tree15725bc40b85bfacf6f2f7aca23e06bcc3383d21 /drivers/net/usb/r8152.c
parentr8152: clear SELECTIVE_SUSPEND when autoresuming (diff)
downloadlinux-f4c7476b041d200c3b347f019eebf05e6d0b47f9.tar.xz
linux-f4c7476b041d200c3b347f019eebf05e6d0b47f9.zip
r8152: reset tp->speed before autoresuming in open function
If (tp->speed & LINK_STATUS) is not zero, the rtl8152_resume() would call rtl_start_rx() before enabling the tx/rx. Avoid this by resetting it to zero. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-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 a17ca584182e..f2242316525e 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2891,6 +2891,9 @@ static int rtl8152_open(struct net_device *netdev)
if (res)
goto out;
+ /* set speed to 0 to avoid autoresume try to submit rx */
+ tp->speed = 0;
+
res = usb_autopm_get_interface(tp->intf);
if (res < 0) {
free_all_mem(tp);
@@ -2904,6 +2907,8 @@ static int rtl8152_open(struct net_device *netdev)
clear_bit(WORK_ENABLE, &tp->flags);
usb_kill_urb(tp->intr_urb);
cancel_delayed_work_sync(&tp->schedule);
+
+ /* disable the tx/rx, if the workqueue has enabled them. */
if (tp->speed & LINK_STATUS)
tp->rtl_ops.disable(tp);
}