diff options
author | hayeswang <hayeswang@realtek.com> | 2014-10-29 04:12:15 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-30 20:49:00 +0100 |
commit | 923e1ee3ff0b585cc4f56cf696c8455708537ffb (patch) | |
tree | f8706852ca3254b06a7a3bdf2070d1c8ab460616 /drivers/net | |
parent | inet: frags: remove the WARN_ON from inet_evict_bucket (diff) | |
download | linux-923e1ee3ff0b585cc4f56cf696c8455708537ffb.tar.xz linux-923e1ee3ff0b585cc4f56cf696c8455708537ffb.zip |
r8152: clear SELECTIVE_SUSPEND when autoresuming
The flag of SELECTIVE_SUSPEND should be cleared when autoresuming.
Otherwise, when the system suspend and resume occur, it may have
the wrong flow.
Besides, because the flag of SELECTIVE_SUSPEND couldn't be used
to check if the hw enables the relative feature, it should alwayes
be disabled in close().
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/usb/r8152.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index e3d84c322e4e..a17ca584182e 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -2955,10 +2955,7 @@ static int rtl8152_close(struct net_device *netdev) * be disable when autoresume occurs, because the * netif_running() would be false. */ - if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { - rtl_runtime_suspend_enable(tp, false); - clear_bit(SELECTIVE_SUSPEND, &tp->flags); - } + rtl_runtime_suspend_enable(tp, false); tasklet_disable(&tp->tl); tp->rtl_ops.down(tp); @@ -3253,6 +3250,8 @@ static int rtl8152_resume(struct usb_interface *intf) set_bit(WORK_ENABLE, &tp->flags); } usb_submit_urb(tp->intr_urb, GFP_KERNEL); + } else if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { + clear_bit(SELECTIVE_SUSPEND, &tp->flags); } mutex_unlock(&tp->control); |