linux/drivers
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
..
accel accel/amdxdna: Use a different name for latest firmware 2026-02-25 13:51:31 -08:00
accessibility
acpi Merge branch 'acpi-pm' 2026-02-26 21:51:33 +01:00
amba
android
ata ata: libata-core: fix cancellation of a port deferred qc work 2026-02-24 09:38:55 +09:00
atm
auxdisplay
base device property: Allow secondary lookup in fwnode_get_next_child_node() 2026-02-23 00:10:31 +01:00
bcma
block block-7.0-20260227 2026-02-27 10:42:02 -08:00
bluetooth Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
bus
cache
cdrom
cdx
char Bug fixes for the IPMI driver 2026-02-26 14:34:21 -08:00
clk clk: scu/imx8qxp: do not register driver in probe() 2026-02-24 12:54:17 +01:00
clocksource
comedi
connector
counter
cpufreq cpufreq: intel_pstate: Fix crash during turbo disable 2026-02-25 14:39:19 +01:00
cpuidle
crypto
cxl cxl/region: Test CXL_DECODER_F_NORMALIZED_ADDRESSING as a bitmask 2026-02-24 08:33:30 -07:00
dax
dca
devfreq
dibs
dio
dma
dma-buf
dpll Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
edac
eisa
extcon
firewire firewire: ohci: initialize page array to use alloc_pages_bulk() correctly 2026-02-28 10:09:24 -08:00
firmware
fpga
fsi
fwctl
gnss
gpib
gpio gpiolib: normalize the return value of gc->get() on behalf of buggy drivers 2026-02-23 11:49:23 +01:00
gpu amd-drm-fixes-7.0-2026-02-26: 2026-02-27 09:19:47 +10:00
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband RDMA/uverbs: Import DMA-BUF module in uverbs_std_types_dmabuf file 2026-02-26 04:58:24 -05:00
input
interconnect
iommu
ipack
irqchip Arm: 2026-03-01 15:34:47 -08:00
isdn
leds
macintosh
mailbox
mcb
md
media [GIT PULL for v7.0-rc3] media fixes 2026-03-04 08:12:06 -08:00
memory
memstick
message
mfd
misc
mmc mmc: sdhci-brcmstb: use correct register offset for V1 pin_sel restore 2026-02-23 12:05:20 +01:00
most
mtd
mux
net net: usb: lan78xx: fix WARN in __netif_napi_del_locked on disconnect 2026-03-09 19:48:33 -07:00
nfc Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci PCI: dwc: ep: Flush MSI-X write before unmapping its ATU entry 2026-02-25 15:44:20 -06:00
pcmcia
peci
perf
phy
pinctrl pinctrl: cy8c95x0: Don't miss reading the last bank registers 2026-02-26 23:41:04 +01:00
platform
pmdomain pmdomain: imx: gpcv2: Discard pm_runtime_put() return value 2026-02-23 14:05:38 +01:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: Kconfig: fix a typo 2026-02-24 17:31:56 +00:00
remoteproc
resctrl
reset
rpmsg
rtc RTC for 7.0 2026-02-22 09:43:11 -08:00
s390
sbus
scsi Merge branch '7.0/scsi-queue' into 7.0/scsi-fixes 2026-02-23 13:39:58 -05:00
sh
siox
slimbus
soc
soundwire
spi spi: stm32: fix missing pointer assignment in case of dma chaining 2026-02-26 23:16:12 +00:00
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
ufs scsi: ufs: core: Fix shift out of bounds when MAXQ=32 2026-02-24 14:23:07 -05:00
uio
usb
vdpa
vfio
vhost
video
virt
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile