* [PATCH net 0/2] r8152: fix side effect @ 2019-08-23 8:53 Hayes Wang 2019-08-23 8:53 ` [PATCH net 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang ` (3 more replies) 0 siblings, 4 replies; 14+ messages in thread From: Hayes Wang @ 2019-08-23 8:53 UTC (permalink / raw) To: netdev; +Cc: nic_swsd, linux-kernel, jslaby, Hayes Wang 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. Hayes Wang (2): Revert "r8152: napi hangup fix after disconnect" r8152: avoid using napi_disable after netif_napi_del. drivers/net/usb/r8152.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.21.0 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net 1/2] Revert "r8152: napi hangup fix after disconnect" 2019-08-23 8:53 [PATCH net 0/2] r8152: fix side effect Hayes Wang @ 2019-08-23 8:53 ` Hayes Wang 2019-08-23 8:53 ` [PATCH net 2/2] r8152: avoid using napi_disable after netif_napi_del Hayes Wang ` (2 subsequent siblings) 3 siblings, 0 replies; 14+ messages in thread From: Hayes Wang @ 2019-08-23 8:53 UTC (permalink / raw) To: netdev; +Cc: nic_swsd, linux-kernel, jslaby, Hayes Wang This reverts commit 0ee1f4734967af8321ecebaf9c74221ace34f2d5. This conflicts with commit ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection"). Signed-off-by: Hayes Wang <hayeswang@realtek.com> --- drivers/net/usb/r8152.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 0cc03a9ff545..690a24d1ef82 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -4018,8 +4018,7 @@ static int rtl8152_close(struct net_device *netdev) #ifdef CONFIG_PM_SLEEP unregister_pm_notifier(&tp->pm_notifier); #endif - if (!test_bit(RTL8152_UNPLUG, &tp->flags)) - napi_disable(&tp->napi); + napi_disable(&tp->napi); clear_bit(WORK_ENABLE, &tp->flags); usb_kill_urb(tp->intr_urb); cancel_delayed_work_sync(&tp->schedule); -- 2.21.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net 2/2] r8152: avoid using napi_disable after netif_napi_del. 2019-08-23 8:53 [PATCH net 0/2] r8152: fix side effect Hayes Wang 2019-08-23 8:53 ` [PATCH net 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang @ 2019-08-23 8:53 ` Hayes Wang 2019-08-23 21:33 ` David Miller 2019-08-28 1:51 ` [PATCH net v3 0/2] r8152: fix side effect Hayes Wang 2019-08-28 12:56 ` [PATCH net v4 " Hayes Wang 3 siblings, 1 reply; 14+ messages in thread From: Hayes Wang @ 2019-08-23 8:53 UTC (permalink / raw) To: netdev; +Cc: nic_swsd, linux-kernel, jslaby, Hayes Wang Exchange netif_napi_del() and unregister_netdev() in rtl8152_disconnect() to avoid using napi_disable() after netif_napi_del(). Signed-off-by: Hayes Wang <hayeswang@realtek.com> --- drivers/net/usb/r8152.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 690a24d1ef82..29390eda5251 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -5364,8 +5364,8 @@ static void rtl8152_disconnect(struct usb_interface *intf) if (tp) { rtl_set_unplug(tp); - netif_napi_del(&tp->napi); unregister_netdev(tp->netdev); + netif_napi_del(&tp->napi); cancel_delayed_work_sync(&tp->hw_phy_work); tp->rtl_ops.unload(tp); free_netdev(tp->netdev); -- 2.21.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH net 2/2] r8152: avoid using napi_disable after netif_napi_del. 2019-08-23 8:53 ` [PATCH net 2/2] r8152: avoid using napi_disable after netif_napi_del Hayes Wang @ 2019-08-23 21:33 ` David Miller 0 siblings, 0 replies; 14+ messages in thread From: David Miller @ 2019-08-23 21:33 UTC (permalink / raw) To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, jslaby From: Hayes Wang <hayeswang@realtek.com> Date: Fri, 23 Aug 2019 16:53:02 +0800 > Exchange netif_napi_del() and unregister_netdev() in rtl8152_disconnect() > to avoid using napi_disable() after netif_napi_del(). > > Signed-off-by: Hayes Wang <hayeswang@realtek.com> > --- > drivers/net/usb/r8152.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c > index 690a24d1ef82..29390eda5251 100644 > --- a/drivers/net/usb/r8152.c > +++ b/drivers/net/usb/r8152.c > @@ -5364,8 +5364,8 @@ static void rtl8152_disconnect(struct usb_interface *intf) > if (tp) { > rtl_set_unplug(tp); > > - netif_napi_del(&tp->napi); > unregister_netdev(tp->netdev); > + netif_napi_del(&tp->napi); > cancel_delayed_work_sync(&tp->hw_phy_work); > tp->rtl_ops.unload(tp); > free_netdev(tp->netdev); This is completely redundant because free_netdev() will perform all of the necessary netif_napi_del() calls. ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net v3 0/2] r8152: fix side effect 2019-08-23 8:53 [PATCH net 0/2] r8152: fix side effect Hayes Wang 2019-08-23 8:53 ` [PATCH net 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang 2019-08-23 8:53 ` [PATCH net 2/2] r8152: avoid using napi_disable after netif_napi_del Hayes Wang @ 2019-08-28 1:51 ` Hayes Wang 2019-08-28 1:51 ` [PATCH net v3 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang ` (3 more replies) 2019-08-28 12:56 ` [PATCH net v4 " Hayes Wang 3 siblings, 4 replies; 14+ messages in thread From: Hayes Wang @ 2019-08-28 1:51 UTC (permalink / raw) To: netdev; +Cc: nic_swsd, linux-kernel, Hayes Wang 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. Hayes Wang (2): Revert "r8152: napi hangup fix after disconnect" r8152: remove calling netif_napi_del drivers/net/usb/r8152.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.21.0 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net v3 1/2] Revert "r8152: napi hangup fix after disconnect" 2019-08-28 1:51 ` [PATCH net v3 0/2] r8152: fix side effect Hayes Wang @ 2019-08-28 1:51 ` Hayes Wang 2019-08-28 1:51 ` [PATCH net v3 2/2] r8152: remove calling netif_napi_del Hayes Wang ` (2 subsequent siblings) 3 siblings, 0 replies; 14+ messages in thread From: Hayes Wang @ 2019-08-28 1:51 UTC (permalink / raw) To: netdev; +Cc: nic_swsd, linux-kernel, Hayes Wang This reverts commit 0ee1f4734967af8321ecebaf9c74221ace34f2d5. The commit 0ee1f4734967 ("r8152: napi hangup fix after disconnect") adds a check about RTL8152_UNPLUG to determine if calling napi_disable() is invalid in rtl8152_close(), when rtl8152_disconnect() is called. This avoids to use napi_disable() after calling netif_napi_del(). Howver, commit ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection") causes that RTL8152_UNPLUG is not always set when calling rtl8152_disconnect(). Therefore, I have to revert commit 0ee1f4734967 ("r8152: napi hangup fix after disconnect"), first. And submit another patch to fix it. Signed-off-by: Hayes Wang <hayeswang@realtek.com> --- drivers/net/usb/r8152.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index eee0f5007ee3..ad3abe26b51b 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) #ifdef CONFIG_PM_SLEEP unregister_pm_notifier(&tp->pm_notifier); #endif - if (!test_bit(RTL8152_UNPLUG, &tp->flags)) - napi_disable(&tp->napi); + napi_disable(&tp->napi); clear_bit(WORK_ENABLE, &tp->flags); usb_kill_urb(tp->intr_urb); cancel_delayed_work_sync(&tp->schedule); -- 2.21.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net v3 2/2] r8152: remove calling netif_napi_del 2019-08-28 1:51 ` [PATCH net v3 0/2] r8152: fix side effect Hayes Wang 2019-08-28 1:51 ` [PATCH net v3 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang @ 2019-08-28 1:51 ` Hayes Wang 2019-08-28 4:17 ` [PATCH net v3 0/2] r8152: fix side effect Jakub Kicinski 2019-08-28 23:02 ` David Miller 3 siblings, 0 replies; 14+ messages in thread From: Hayes Wang @ 2019-08-28 1:51 UTC (permalink / raw) To: netdev; +Cc: nic_swsd, linux-kernel, Hayes Wang Remove unnecessary use of netif_napi_del. This also avoids to call napi_disable() after netif_napi_del(). Signed-off-by: Hayes Wang <hayeswang@realtek.com> --- drivers/net/usb/r8152.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index ad3abe26b51b..04137ac373b0 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -5352,7 +5352,6 @@ static int rtl8152_probe(struct usb_interface *intf, return 0; out1: - netif_napi_del(&tp->napi); usb_set_intfdata(intf, NULL); out: free_netdev(netdev); @@ -5367,7 +5366,6 @@ static void rtl8152_disconnect(struct usb_interface *intf) if (tp) { rtl_set_unplug(tp); - netif_napi_del(&tp->napi); unregister_netdev(tp->netdev); cancel_delayed_work_sync(&tp->hw_phy_work); tp->rtl_ops.unload(tp); -- 2.21.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH net v3 0/2] r8152: fix side effect 2019-08-28 1:51 ` [PATCH net v3 0/2] r8152: fix side effect Hayes Wang 2019-08-28 1:51 ` [PATCH net v3 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang 2019-08-28 1:51 ` [PATCH net v3 2/2] r8152: remove calling netif_napi_del Hayes Wang @ 2019-08-28 4:17 ` Jakub Kicinski 2019-08-28 23:02 ` David Miller 3 siblings, 0 replies; 14+ messages in thread From: Jakub Kicinski @ 2019-08-28 4:17 UTC (permalink / raw) To: Hayes Wang; +Cc: netdev, nic_swsd, linux-kernel On Wed, 28 Aug 2019 09:51:40 +0800, Hayes Wang wrote: > 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. LGTM, seems like if we were to add a Fixes tag it'd point to the ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection") commit, then? So only net needs it, v5.2 is fine. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net v3 0/2] r8152: fix side effect 2019-08-28 1:51 ` [PATCH net v3 0/2] r8152: fix side effect Hayes Wang ` (2 preceding siblings ...) 2019-08-28 4:17 ` [PATCH net v3 0/2] r8152: fix side effect Jakub Kicinski @ 2019-08-28 23:02 ` David Miller 3 siblings, 0 replies; 14+ messages in thread From: David Miller @ 2019-08-28 23:02 UTC (permalink / raw) To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel From: Hayes Wang <hayeswang@realtek.com> Date: Wed, 28 Aug 2019 09:51:40 +0800 > 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. Series applied, thank you. ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net v4 0/2] r8152: fix side effect 2019-08-23 8:53 [PATCH net 0/2] r8152: fix side effect Hayes Wang ` (2 preceding siblings ...) 2019-08-28 1:51 ` [PATCH net v3 0/2] r8152: fix side effect Hayes Wang @ 2019-08-28 12:56 ` Hayes Wang 2019-08-28 12:56 ` [PATCH net v4 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang ` (2 more replies) 3 siblings, 3 replies; 14+ messages in thread From: Hayes Wang @ 2019-08-28 12:56 UTC (permalink / raw) To: netdev; +Cc: nic_swsd, linux-kernel, Hayes Wang v4: Add Fixes tag for both patch #1 and #2. 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. Hayes Wang (2): Revert "r8152: napi hangup fix after disconnect" r8152: remove calling netif_napi_del drivers/net/usb/r8152.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.21.0 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net v4 1/2] Revert "r8152: napi hangup fix after disconnect" 2019-08-28 12:56 ` [PATCH net v4 " Hayes Wang @ 2019-08-28 12:56 ` Hayes Wang 2019-08-28 12:56 ` [PATCH net v4 2/2] r8152: remove calling netif_napi_del Hayes Wang 2019-08-28 23:17 ` [PATCH net v4 0/2] r8152: fix side effect David Miller 2 siblings, 0 replies; 14+ messages in thread From: Hayes Wang @ 2019-08-28 12:56 UTC (permalink / raw) To: netdev; +Cc: nic_swsd, linux-kernel, Hayes Wang This reverts commit 0ee1f4734967af8321ecebaf9c74221ace34f2d5. The commit 0ee1f4734967 ("r8152: napi hangup fix after disconnect") adds a check about RTL8152_UNPLUG to determine if calling napi_disable() is invalid in rtl8152_close(), when rtl8152_disconnect() is called. This avoids to use napi_disable() after calling netif_napi_del(). However, commit ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection") causes that RTL8152_UNPLUG is not always set when calling rtl8152_disconnect(). Therefore, I have to revert commit 0ee1f4734967 ("r8152: napi hangup fix after disconnect"), first. And submit another patch to fix it. Fixes: ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection") Signed-off-by: Hayes Wang <hayeswang@realtek.com> --- drivers/net/usb/r8152.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index eee0f5007ee3..ad3abe26b51b 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) #ifdef CONFIG_PM_SLEEP unregister_pm_notifier(&tp->pm_notifier); #endif - if (!test_bit(RTL8152_UNPLUG, &tp->flags)) - napi_disable(&tp->napi); + napi_disable(&tp->napi); clear_bit(WORK_ENABLE, &tp->flags); usb_kill_urb(tp->intr_urb); cancel_delayed_work_sync(&tp->schedule); -- 2.21.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net v4 2/2] r8152: remove calling netif_napi_del 2019-08-28 12:56 ` [PATCH net v4 " Hayes Wang 2019-08-28 12:56 ` [PATCH net v4 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang @ 2019-08-28 12:56 ` Hayes Wang 2019-08-28 23:17 ` [PATCH net v4 0/2] r8152: fix side effect David Miller 2 siblings, 0 replies; 14+ messages in thread From: Hayes Wang @ 2019-08-28 12:56 UTC (permalink / raw) To: netdev; +Cc: nic_swsd, linux-kernel, Hayes Wang Remove unnecessary use of netif_napi_del. This also avoids to call napi_disable() after netif_napi_del(). Fixes: ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection") Signed-off-by: Hayes Wang <hayeswang@realtek.com> --- drivers/net/usb/r8152.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index ad3abe26b51b..04137ac373b0 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -5352,7 +5352,6 @@ static int rtl8152_probe(struct usb_interface *intf, return 0; out1: - netif_napi_del(&tp->napi); usb_set_intfdata(intf, NULL); out: free_netdev(netdev); @@ -5367,7 +5366,6 @@ static void rtl8152_disconnect(struct usb_interface *intf) if (tp) { rtl_set_unplug(tp); - netif_napi_del(&tp->napi); unregister_netdev(tp->netdev); cancel_delayed_work_sync(&tp->hw_phy_work); tp->rtl_ops.unload(tp); -- 2.21.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH net v4 0/2] r8152: fix side effect 2019-08-28 12:56 ` [PATCH net v4 " Hayes Wang 2019-08-28 12:56 ` [PATCH net v4 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang 2019-08-28 12:56 ` [PATCH net v4 2/2] r8152: remove calling netif_napi_del Hayes Wang @ 2019-08-28 23:17 ` David Miller 2019-08-29 1:08 ` Hayes Wang 2 siblings, 1 reply; 14+ messages in thread From: David Miller @ 2019-08-28 23:17 UTC (permalink / raw) To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel From: Hayes Wang <hayeswang@realtek.com> Date: Wed, 28 Aug 2019 20:56:11 +0800 > v4: > Add Fixes tag for both patch #1 and #2. I applied v3, sorry. I think it is OK as I will backport things to v5.2 -stable anyways. ^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH net v4 0/2] r8152: fix side effect 2019-08-28 23:17 ` [PATCH net v4 0/2] r8152: fix side effect David Miller @ 2019-08-29 1:08 ` Hayes Wang 0 siblings, 0 replies; 14+ messages in thread From: Hayes Wang @ 2019-08-29 1:08 UTC (permalink / raw) To: David Miller; +Cc: netdev, nic_swsd, linux-kernel David Miller [mailto:davem@davemloft.net] > Sent: Thursday, August 29, 2019 7:18 AM [...] > > v4: > > Add Fixes tag for both patch #1 and #2. > > I applied v3, sorry. > > I think it is OK as I will backport things to v5.2 -stable anyways. Thanks. Best Regards, Hayes ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-08-29 1:08 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-08-23 8:53 [PATCH net 0/2] r8152: fix side effect Hayes Wang 2019-08-23 8:53 ` [PATCH net 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang 2019-08-23 8:53 ` [PATCH net 2/2] r8152: avoid using napi_disable after netif_napi_del Hayes Wang 2019-08-23 21:33 ` David Miller 2019-08-28 1:51 ` [PATCH net v3 0/2] r8152: fix side effect Hayes Wang 2019-08-28 1:51 ` [PATCH net v3 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang 2019-08-28 1:51 ` [PATCH net v3 2/2] r8152: remove calling netif_napi_del Hayes Wang 2019-08-28 4:17 ` [PATCH net v3 0/2] r8152: fix side effect Jakub Kicinski 2019-08-28 23:02 ` David Miller 2019-08-28 12:56 ` [PATCH net v4 " Hayes Wang 2019-08-28 12:56 ` [PATCH net v4 1/2] Revert "r8152: napi hangup fix after disconnect" Hayes Wang 2019-08-28 12:56 ` [PATCH net v4 2/2] r8152: remove calling netif_napi_del Hayes Wang 2019-08-28 23:17 ` [PATCH net v4 0/2] r8152: fix side effect David Miller 2019-08-29 1:08 ` Hayes Wang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).