]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: usb: enable the work after stop usbnet by ip down/up
authorZqiang <qiang.zhang@linux.dev>
Tue, 8 Jul 2025 08:16:53 +0000 (16:16 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Jul 2025 02:31:26 +0000 (19:31 -0700)
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>
Link: https://patch.msgid.link/20250708081653.307815-1-jun.miao@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/usbnet.c

index 9564478a79cc378b49db29e8f1d31d3ae792b5bd..6a3cca104af90109edc6c44b454b195c58e93a5c 100644 (file)
@@ -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);