]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
r8152: check WORK_ENABLE in suspend function
authorhayeswang <hayeswang@realtek.com>
Wed, 29 Oct 2014 03:12:17 +0000 (11:12 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Oct 2014 19:49:00 +0000 (15:49 -0400)
Avoid unnecessary behavior when autosuspend occurs during open().
The relative processes should only be run after finishing open().

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/r8152.c

index f2242316525ef9faab978f2b1847cb1b138a7259..ca3c5d5f93eb2571080ef060d79a4122064a33e8 100644 (file)
@@ -3207,7 +3207,7 @@ static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message)
                netif_device_detach(netdev);
        }
 
-       if (netif_running(netdev)) {
+       if (netif_running(netdev) && test_bit(WORK_ENABLE, &tp->flags)) {
                clear_bit(WORK_ENABLE, &tp->flags);
                usb_kill_urb(tp->intr_urb);
                tasklet_disable(&tp->tl);