diff options
author | David S. Miller <davem@davemloft.net> | 2019-08-28 19:02:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-28 19:02:32 -0400 |
commit | 80a6a5d62da9ec1a4a949c0f95baa80d7efbfef5 (patch) | |
tree | a4bc8fadbefa7f9f6ded6c72ed900167069bc48b | |
parent | 092e22e586236bba106a82113826a68080a03506 (diff) | |
parent | 973dc6cfc0e2c43ff29ca5645ceaf1ae694ea110 (diff) |
Merge branch 'r8152-fix-side-effect'
Hayes Wang says:
====================
r8152: fix side effect
v3:
Update the commit message for patch #1.
v2:
Replace patch #2 with "r8152: remove calling netif_napi_del".
v1:
The commit 0ee1f4734967 ("r8152: napi hangup fix after disconnect")
add a check to avoid using napi_disable after netif_napi_del. However,
the commit ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real
disconnection") let the check useless.
Therefore, I revert commit 0ee1f4734967 ("r8152: napi hangup fix
after disconnect") first, and add another patch to fix it.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/usb/r8152.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index eee0f5007ee3..04137ac373b0 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -4021,8 +4021,7 @@ static int rtl8152_close(struct net_device *netdev) | |||
4021 | #ifdef CONFIG_PM_SLEEP | 4021 | #ifdef CONFIG_PM_SLEEP |
4022 | unregister_pm_notifier(&tp->pm_notifier); | 4022 | unregister_pm_notifier(&tp->pm_notifier); |
4023 | #endif | 4023 | #endif |
4024 | if (!test_bit(RTL8152_UNPLUG, &tp->flags)) | 4024 | napi_disable(&tp->napi); |
4025 | napi_disable(&tp->napi); | ||
4026 | clear_bit(WORK_ENABLE, &tp->flags); | 4025 | clear_bit(WORK_ENABLE, &tp->flags); |
4027 | usb_kill_urb(tp->intr_urb); | 4026 | usb_kill_urb(tp->intr_urb); |
4028 | cancel_delayed_work_sync(&tp->schedule); | 4027 | cancel_delayed_work_sync(&tp->schedule); |
@@ -5353,7 +5352,6 @@ static int rtl8152_probe(struct usb_interface *intf, | |||
5353 | return 0; | 5352 | return 0; |
5354 | 5353 | ||
5355 | out1: | 5354 | out1: |
5356 | netif_napi_del(&tp->napi); | ||
5357 | usb_set_intfdata(intf, NULL); | 5355 | usb_set_intfdata(intf, NULL); |
5358 | out: | 5356 | out: |
5359 | free_netdev(netdev); | 5357 | free_netdev(netdev); |
@@ -5368,7 +5366,6 @@ static void rtl8152_disconnect(struct usb_interface *intf) | |||
5368 | if (tp) { | 5366 | if (tp) { |
5369 | rtl_set_unplug(tp); | 5367 | rtl_set_unplug(tp); |
5370 | 5368 | ||
5371 | netif_napi_del(&tp->napi); | ||
5372 | unregister_netdev(tp->netdev); | 5369 | unregister_netdev(tp->netdev); |
5373 | cancel_delayed_work_sync(&tp->hw_phy_work); | 5370 | cancel_delayed_work_sync(&tp->hw_phy_work); |
5374 | tp->rtl_ops.unload(tp); | 5371 | tp->rtl_ops.unload(tp); |