netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: usb: enable the work after stop usbnet by ip down/up
@ 2025-07-08  8:16 Jun Miao
  2025-07-09  4:42 ` Oleksij Rempel
  2025-07-10  2:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Jun Miao @ 2025-07-08  8:16 UTC (permalink / raw)
  To: o.rempel, kuba, oneukum, qiang.zhang; +Cc: netdev, linux-usb, linux-kernel

From: Zqiang <qiang.zhang@linux.dev>

Oleksij reported that:
The smsc95xx driver fails after one down/up cycle, like this:
 $ nmcli device set enu1u1 managed no
 $ p a a 10.10.10.1/24 dev enu1u1
 $ ping -c 4 10.10.10.3
 $ ip l s dev enu1u1 down
 $ ip l s dev enu1u1 up
 $ ping -c 4 10.10.10.3
The second ping does not reach the host. Networking also fails on other interfaces.

Enable the work by replacing the disable_work_sync() with cancel_work_sync().

[Jun Miao: completely write the commit changelog]

Fixes: 2c04d279e857 ("net: usb: Convert tasklet API to new bottom half workqueue mechanism")
Reported-by: Oleksij Rempel <o.rempel@pengutronix.de>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Zqiang <qiang.zhang@linux.dev>
Signed-off-by: Jun Miao <jun.miao@intel.com>
---
 drivers/net/usb/usbnet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 9564478a79cc..6a3cca104af9 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -861,14 +861,14 @@ int usbnet_stop (struct net_device *net)
 	/* deferred work (timer, softirq, task) must also stop */
 	dev->flags = 0;
 	timer_delete_sync(&dev->delay);
-	disable_work_sync(&dev->bh_work);
+	cancel_work_sync(&dev->bh_work);
 	cancel_work_sync(&dev->kevent);
 
 	/* We have cyclic dependencies. Those calls are needed
 	 * to break a cycle. We cannot fall into the gaps because
 	 * we have a flag
 	 */
-	disable_work_sync(&dev->bh_work);
+	cancel_work_sync(&dev->bh_work);
 	timer_delete_sync(&dev->delay);
 	cancel_work_sync(&dev->kevent);
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: usb: enable the work after stop usbnet by ip down/up
  2025-07-08  8:16 [PATCH] net: usb: enable the work after stop usbnet by ip down/up Jun Miao
@ 2025-07-09  4:42 ` Oleksij Rempel
  2025-07-09  5:31   ` Miao, Jun
  2025-07-10  2:50 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Oleksij Rempel @ 2025-07-09  4:42 UTC (permalink / raw)
  To: Jun Miao; +Cc: kuba, oneukum, qiang.zhang, netdev, linux-usb, linux-kernel

Hi Jun,

please resend this patch with the name [PATCH net-next] and add all related
people suggested by scripts/get_maintainer.pl.

./scripts/get_maintainer.pl drivers/net/usb/usbnet.c 
Oliver Neukum <oneukum@suse.com> (maintainer:USB "USBNET" DRIVER FRAMEWORK)
Andrew Lunn <andrew+netdev@lunn.ch> (maintainer:NETWORKING DRIVERS)
"David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING DRIVERS)
Eric Dumazet <edumazet@google.com> (maintainer:NETWORKING DRIVERS)
Jakub Kicinski <kuba@kernel.org> (maintainer:NETWORKING DRIVERS)
Paolo Abeni <pabeni@redhat.com> (maintainer:NETWORKING DRIVERS)
netdev@vger.kernel.org (open list:USB "USBNET" DRIVER FRAMEWORK)
linux-usb@vger.kernel.org (open list:USB NETWORKING DRIVERS)
linux-kernel@vger.kernel.org (open list)

Best Regards,
Oleksij

On Tue, Jul 08, 2025 at 04:16:53PM +0800, Jun Miao wrote:
> From: Zqiang <qiang.zhang@linux.dev>
> 
> Oleksij reported that:
> The smsc95xx driver fails after one down/up cycle, like this:
>  $ nmcli device set enu1u1 managed no
>  $ p a a 10.10.10.1/24 dev enu1u1
>  $ ping -c 4 10.10.10.3
>  $ ip l s dev enu1u1 down
>  $ ip l s dev enu1u1 up
>  $ ping -c 4 10.10.10.3
> The second ping does not reach the host. Networking also fails on other interfaces.
> 
> Enable the work by replacing the disable_work_sync() with cancel_work_sync().
> 
> [Jun Miao: completely write the commit changelog]
> 
> Fixes: 2c04d279e857 ("net: usb: Convert tasklet API to new bottom half workqueue mechanism")
> Reported-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Signed-off-by: Zqiang <qiang.zhang@linux.dev>
> Signed-off-by: Jun Miao <jun.miao@intel.com>
> ---
>  drivers/net/usb/usbnet.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 9564478a79cc..6a3cca104af9 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -861,14 +861,14 @@ int usbnet_stop (struct net_device *net)
>  	/* deferred work (timer, softirq, task) must also stop */
>  	dev->flags = 0;
>  	timer_delete_sync(&dev->delay);
> -	disable_work_sync(&dev->bh_work);
> +	cancel_work_sync(&dev->bh_work);
>  	cancel_work_sync(&dev->kevent);
>  
>  	/* We have cyclic dependencies. Those calls are needed
>  	 * to break a cycle. We cannot fall into the gaps because
>  	 * we have a flag
>  	 */
> -	disable_work_sync(&dev->bh_work);
> +	cancel_work_sync(&dev->bh_work);
>  	timer_delete_sync(&dev->delay);
>  	cancel_work_sync(&dev->kevent);
>  
> -- 
> 2.32.0
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] net: usb: enable the work after stop usbnet by ip down/up
  2025-07-09  4:42 ` Oleksij Rempel
@ 2025-07-09  5:31   ` Miao, Jun
  0 siblings, 0 replies; 4+ messages in thread
From: Miao, Jun @ 2025-07-09  5:31 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: kuba@kernel.org, oneukum@suse.com, qiang.zhang@linux.dev,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org

>
>Hi Jun,
>
>please resend this patch with the name [PATCH net-next] and add all related
>people suggested by scripts/get_maintainer.pl.
>
Ok, I will resend again.
If you have any suggestions for patch commits, please tell me ?

Thanks 
Jun.Miao



>./scripts/get_maintainer.pl drivers/net/usb/usbnet.c Oliver Neukum
><oneukum@suse.com> (maintainer:USB "USBNET" DRIVER FRAMEWORK)
>Andrew Lunn <andrew+netdev@lunn.ch> (maintainer:NETWORKING DRIVERS)
>"David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING DRIVERS)
>Eric Dumazet <edumazet@google.com> (maintainer:NETWORKING DRIVERS)
>Jakub Kicinski <kuba@kernel.org> (maintainer:NETWORKING DRIVERS) Paolo
>Abeni <pabeni@redhat.com> (maintainer:NETWORKING DRIVERS)
>netdev@vger.kernel.org (open list:USB "USBNET" DRIVER FRAMEWORK) linux-
>usb@vger.kernel.org (open list:USB NETWORKING DRIVERS) linux-
>kernel@vger.kernel.org (open list)
>
>Best Regards,
>Oleksij
>
>On Tue, Jul 08, 2025 at 04:16:53PM +0800, Jun Miao wrote:
>> From: Zqiang <qiang.zhang@linux.dev>
>>
>> Oleksij reported that:
>> The smsc95xx driver fails after one down/up cycle, like this:
>>  $ nmcli device set enu1u1 managed no
>>  $ p a a 10.10.10.1/24 dev enu1u1
>>  $ ping -c 4 10.10.10.3
>>  $ ip l s dev enu1u1 down
>>  $ ip l s dev enu1u1 up
>>  $ ping -c 4 10.10.10.3
>> The second ping does not reach the host. Networking also fails on other
>interfaces.
>>
>> Enable the work by replacing the disable_work_sync() with
>cancel_work_sync().
>>
>> [Jun Miao: completely write the commit changelog]
>>
>> Fixes: 2c04d279e857 ("net: usb: Convert tasklet API to new bottom half
>> workqueue mechanism")
>> Reported-by: Oleksij Rempel <o.rempel@pengutronix.de>
>> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
>> Signed-off-by: Zqiang <qiang.zhang@linux.dev>
>> Signed-off-by: Jun Miao <jun.miao@intel.com>
>> ---
>>  drivers/net/usb/usbnet.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index
>> 9564478a79cc..6a3cca104af9 100644
>> --- a/drivers/net/usb/usbnet.c
>> +++ b/drivers/net/usb/usbnet.c
>> @@ -861,14 +861,14 @@ int usbnet_stop (struct net_device *net)
>>  	/* deferred work (timer, softirq, task) must also stop */
>>  	dev->flags = 0;
>>  	timer_delete_sync(&dev->delay);
>> -	disable_work_sync(&dev->bh_work);
>> +	cancel_work_sync(&dev->bh_work);
>>  	cancel_work_sync(&dev->kevent);
>>
>>  	/* We have cyclic dependencies. Those calls are needed
>>  	 * to break a cycle. We cannot fall into the gaps because
>>  	 * we have a flag
>>  	 */
>> -	disable_work_sync(&dev->bh_work);
>> +	cancel_work_sync(&dev->bh_work);
>>  	timer_delete_sync(&dev->delay);
>>  	cancel_work_sync(&dev->kevent);
>>
>> --
>> 2.32.0
>>
>>
>
>--
>Pengutronix e.K.                           |                             |
>Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
>31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: usb: enable the work after stop usbnet by ip down/up
  2025-07-08  8:16 [PATCH] net: usb: enable the work after stop usbnet by ip down/up Jun Miao
  2025-07-09  4:42 ` Oleksij Rempel
@ 2025-07-10  2:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-10  2:50 UTC (permalink / raw)
  To: Miao, Jun
  Cc: o.rempel, kuba, oneukum, qiang.zhang, netdev, linux-usb,
	linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  8 Jul 2025 16:16:53 +0800 you wrote:
> From: Zqiang <qiang.zhang@linux.dev>
> 
> Oleksij reported that:
> The smsc95xx driver fails after one down/up cycle, like this:
>  $ nmcli device set enu1u1 managed no
>  $ p a a 10.10.10.1/24 dev enu1u1
>  $ ping -c 4 10.10.10.3
>  $ ip l s dev enu1u1 down
>  $ ip l s dev enu1u1 up
>  $ ping -c 4 10.10.10.3
> The second ping does not reach the host. Networking also fails on other interfaces.
> 
> [...]

Here is the summary with links:
  - net: usb: enable the work after stop usbnet by ip down/up
    https://git.kernel.org/netdev/net-next/c/6dfcbd7d1d65

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-10  2:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08  8:16 [PATCH] net: usb: enable the work after stop usbnet by ip down/up Jun Miao
2025-07-09  4:42 ` Oleksij Rempel
2025-07-09  5:31   ` Miao, Jun
2025-07-10  2:50 ` patchwork-bot+netdevbpf

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).