mirror-linux/drivers/net/usb
Oleksij Rempel 312c816c6b net: usb: lan78xx: fix WARN in __netif_napi_del_locked on disconnect
Remove redundant netif_napi_del() call from disconnect path.

A WARN may be triggered in __netif_napi_del_locked() during USB device
disconnect:

  WARNING: CPU: 0 PID: 11 at net/core/dev.c:7417 __netif_napi_del_locked+0x2b4/0x350

This happens because netif_napi_del() is called in the disconnect path while
NAPI is still enabled. However, it is not necessary to call netif_napi_del()
explicitly, since unregister_netdev() will handle NAPI teardown automatically
and safely. Removing the redundant call avoids triggering the warning.

Full trace:
 lan78xx 1-1:1.0 enu1: Failed to read register index 0x000000c4. ret = -ENODEV
 lan78xx 1-1:1.0 enu1: Failed to set MAC down with error -ENODEV
 lan78xx 1-1:1.0 enu1: Link is Down
 lan78xx 1-1:1.0 enu1: Failed to read register index 0x00000120. ret = -ENODEV
 ------------[ cut here ]------------
 WARNING: CPU: 0 PID: 11 at net/core/dev.c:7417 __netif_napi_del_locked+0x2b4/0x350
 Modules linked in: flexcan can_dev fuse
 CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.16.0-rc2-00624-ge926949dab03 #9 PREEMPT
 Hardware name: SKOV IMX8MP CPU revC - bd500 (DT)
 Workqueue: usb_hub_wq hub_event
 pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : __netif_napi_del_locked+0x2b4/0x350
 lr : __netif_napi_del_locked+0x7c/0x350
 sp : ffffffc085b673c0
 x29: ffffffc085b673c0 x28: ffffff800b7f2000 x27: ffffff800b7f20d8
 x26: ffffff80110bcf58 x25: ffffff80110bd978 x24: 1ffffff0022179eb
 x23: ffffff80110bc000 x22: ffffff800b7f5000 x21: ffffff80110bc000
 x20: ffffff80110bcf38 x19: ffffff80110bcf28 x18: dfffffc000000000
 x17: ffffffc081578940 x16: ffffffc08284cee0 x15: 0000000000000028
 x14: 0000000000000006 x13: 0000000000040000 x12: ffffffb0022179e8
 x11: 1ffffff0022179e7 x10: ffffffb0022179e7 x9 : dfffffc000000000
 x8 : 0000004ffdde8619 x7 : ffffff80110bcf3f x6 : 0000000000000001
 x5 : ffffff80110bcf38 x4 : ffffff80110bcf38 x3 : 0000000000000000
 x2 : 0000000000000000 x1 : 1ffffff0022179e7 x0 : 0000000000000000
 Call trace:
  __netif_napi_del_locked+0x2b4/0x350 (P)
  lan78xx_disconnect+0xf4/0x360
  usb_unbind_interface+0x158/0x718
  device_remove+0x100/0x150
  device_release_driver_internal+0x308/0x478
  device_release_driver+0x1c/0x30
  bus_remove_device+0x1a8/0x368
  device_del+0x2e0/0x7b0
  usb_disable_device+0x244/0x540
  usb_disconnect+0x220/0x758
  hub_event+0x105c/0x35e0
  process_one_work+0x760/0x17b0
  worker_thread+0x768/0xce8
  kthread+0x3bc/0x690
  ret_from_fork+0x10/0x20
 irq event stamp: 211604
 hardirqs last  enabled at (211603): [<ffffffc0828cc9ec>] _raw_spin_unlock_irqrestore+0x84/0x98
 hardirqs last disabled at (211604): [<ffffffc0828a9a84>] el1_dbg+0x24/0x80
 softirqs last  enabled at (211296): [<ffffffc080095f10>] handle_softirqs+0x820/0xbc8
 softirqs last disabled at (210993): [<ffffffc080010288>] __do_softirq+0x18/0x20
 ---[ end trace 0000000000000000 ]---
 lan78xx 1-1:1.0 enu1: failed to kill vid 0081/0

Fixes: e110bc8258 ("net: usb: lan78xx: Convert to PHYLINK for improved PHY and MAC management")
Cc: stable@vger.kernel.org
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20260305143429.530909-5-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-03-09 19:48:33 -07:00
..
Kconfig net: usb: sr9700: remove code to drive nonexistent multicast filter 2026-02-03 19:42:15 -08:00
Makefile
aqc111.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
aqc111.h
asix.h net: usb: remove unnecessary get_drvinfo code and driver versions 2026-01-30 17:44:18 -08:00
asix_common.c net: usb: remove unnecessary get_drvinfo code and driver versions 2026-01-30 17:44:18 -08:00
asix_devices.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ax88172a.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ax88179_178a.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
catc.c net: usb: catc: enable basic endpoint checking 2026-02-17 11:53:36 +01:00
cdc-phonet.c
cdc_eem.c
cdc_ether.c cdc_ether|r8152: ThinkPad Hybrid USB-C/A Dock quirk 2025-03-17 21:25:25 +01:00
cdc_mbim.c net: usb: cdc_mbim: fix Telit Cinterion FE990A name 2025-02-28 17:55:02 -08:00
cdc_ncm.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cdc_subset.c
ch9200.c net: ch9200: fix uninitialised access during mii_nway_restart 2025-05-28 19:10:04 -07:00
cx82310_eth.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm9601.c net: usb: introduce usbnet_mii_ioctl helper function 2026-02-03 19:41:19 -08:00
gl620a.c usbnet: gl620a: fix endpoint checking in genelink_bind() 2025-02-27 11:35:10 +01:00
hso.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
huawei_cdc_ncm.c
int51x1.c net: usb: int51x1: use usbnet_cdc_update_filter 2026-01-27 17:55:32 -08:00
ipheth.c usbnet: ipheth: document scope of NCM implementation 2025-01-28 12:16:32 +01:00
kalmia.c net: usb: kalmia: validate USB endpoints 2026-02-25 18:56:43 -08:00
kaweth.c net: usb: kaweth: validate USB endpoints 2026-02-25 18:58:05 -08:00
lan78xx.c net: usb: lan78xx: fix WARN in __netif_napi_del_locked on disconnect 2026-03-09 19:48:33 -07:00
lan78xx.h net: usb: lan78xx: fix silent drop of packets with checksum errors 2026-03-09 19:48:33 -07:00
lg-vl600.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mcs7830.c net: usb: introduce usbnet_mii_ioctl helper function 2026-02-03 19:41:19 -08:00
net1080.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
pegasus.c Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
pegasus.h
plusb.c
qmi_wwan.c qmi_wwan: allow max_mtu above hard_mtu to control rx_urb_size 2026-03-06 16:31:41 -08:00
r8152.c net: usb: r8152: add TRENDnet TUC-ET2G 2026-02-27 19:27:31 -08:00
r8153_ecm.c cdc_ether|r8152: ThinkPad Hybrid USB-C/A Dock quirk 2025-03-17 21:25:25 +01:00
rndis_host.c Revert "rndis_host: Flag RNDIS modems as WWAN devices" 2025-04-25 18:46:13 -07:00
rtl8150.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
sierra_net.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smsc75xx.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
smsc75xx.h
smsc95xx.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smsc95xx.h
sr9700.c net: usb: sr9700: remove code to drive nonexistent multicast filter 2026-02-03 19:42:15 -08:00
sr9700.h net: usb: sr9700: remove code to drive nonexistent multicast filter 2026-02-03 19:42:15 -08:00
sr9800.c net: usb: introduce usbnet_mii_ioctl helper function 2026-02-03 19:41:19 -08:00
sr9800.h net: usb: remove unnecessary get_drvinfo code and driver versions 2026-01-30 17:44:18 -08:00
usbnet.c qmi_wwan: allow max_mtu above hard_mtu to control rx_urb_size 2026-03-06 16:31:41 -08:00
zaurus.c