umber-kernel/drivers/net/ethernet
Horatiu Vultur 0216721ce7 lan966x: Fix sleeping in atomic context
The following warning was seen when we try to connect using ssh to the device.

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:575
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 104, name: dropbear
preempt_count: 1, expected: 0
INFO: lockdep is turned off.
CPU: 0 UID: 0 PID: 104 Comm: dropbear Tainted: G        W           6.18.0-rc2-00399-g6f1ab1b109b9-dirty #530 NONE
Tainted: [W]=WARN
Hardware name: Generic DT based system
Call trace:
 unwind_backtrace from show_stack+0x10/0x14
 show_stack from dump_stack_lvl+0x7c/0xac
 dump_stack_lvl from __might_resched+0x16c/0x2b0
 __might_resched from __mutex_lock+0x64/0xd34
 __mutex_lock from mutex_lock_nested+0x1c/0x24
 mutex_lock_nested from lan966x_stats_get+0x5c/0x558
 lan966x_stats_get from dev_get_stats+0x40/0x43c
 dev_get_stats from dev_seq_printf_stats+0x3c/0x184
 dev_seq_printf_stats from dev_seq_show+0x10/0x30
 dev_seq_show from seq_read_iter+0x350/0x4ec
 seq_read_iter from seq_read+0xfc/0x194
 seq_read from proc_reg_read+0xac/0x100
 proc_reg_read from vfs_read+0xb0/0x2b0
 vfs_read from ksys_read+0x6c/0xec
 ksys_read from ret_fast_syscall+0x0/0x1c
Exception stack(0xf0b11fa8 to 0xf0b11ff0)
1fa0:                   00000001 00001000 00000008 be9048d8 00001000 00000001
1fc0: 00000001 00001000 00000008 00000003 be905920 0000001e 00000000 00000001
1fe0: 0005404c be9048c0 00018684 b6ec2cd8

It seems that we are using a mutex in a atomic context which is wrong.
Change the mutex with a spinlock.

Fixes: 12c2d0a5b8 ("net: lan966x: add ethtool configuration and statistics")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20251105074955.1766792-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-11-06 07:31:34 -08:00
..
3com
8390
actions
adaptec
adi
aeroflex
agere
airoha net: airoha: Take into account out-of-order tx completions in airoha_dev_xmit() 2025-10-14 12:33:46 +02:00
alacritech
allwinner
alteon
altera
amazon net: ena: return 0 in ena_get_rxfh_key_size() when RSS hash key is not configurable 2025-09-29 18:33:53 -07:00
amd amd-xgbe: Avoid spurious link down messages during interface toggle 2025-10-14 10:30:34 +02:00
apm
apple
aquantia
arc
asix
atheros net: Use netif_threaded_enable instead of netif_set_threaded in drivers 2025-07-24 18:34:55 -07:00
broadcom bnxt_en: Fix warning in bnxt_dl_reload_down() 2025-11-04 17:25:19 -08:00
brocade
cadence Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-10-01 10:14:49 +02:00
calxeda
cavium net: WQ_PERCPU added to alloc_workqueue users 2025-09-22 17:40:30 -07:00
chelsio net: cxgb4/ch_ipsec: fix potential use-after-free in ch_ipsec_xfrm_add_state() callback 2025-10-28 18:40:20 -07:00
cirrus
cisco
cortina
davicom
dec net: Fix typos 2025-07-25 10:29:07 -07:00
dlink net: dlink: use dev_kfree_skb_any instead of dev_kfree_skb 2025-10-21 18:38:38 -07:00
emulex benet: fix BUG when creating VFs 2025-08-04 17:17:31 -07:00
engleder
ezchip
faraday net: ftgmac100: fix potential NULL pointer access in ftgmac100_phy_disconnect 2025-08-05 16:00:53 -07:00
freescale dpaa2-eth: fix the pointer passed to PTR_ALIGN on Tx path 2025-10-17 16:31:40 -07:00
fujitsu
fungible ethtool: add FEC bins histogram report 2025-09-26 16:49:18 -07:00
google gve: Implement settime64 with -EOPNOTSUPP 2025-10-31 15:55:32 -07:00
hisilicon net: hibmcge: fix the inappropriate netif_device_detach() 2025-10-28 19:11:04 -07:00
huawei hinic3: Fix NULL vs IS_ERR() check in hinic3_alloc_rxqs_res() 2025-09-19 07:05:51 -07:00
i825xx
ibm ibmvnic: Increase max subcrq indirect entries with fallback 2025-08-26 09:45:50 +02:00
intel libie: depend on DEBUG_FS when building LIBIE_FWLOG 2025-11-05 17:38:03 -08:00
litex
marvell octeontx2-pf: Fix devm_kcalloc() error checking 2025-11-03 17:23:44 -08:00
mediatek net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM 2025-10-12 18:14:55 +01:00
mellanox net/mlx5e: SHAMPO, Fix header formulas for higher MTUs and 64K pages 2025-11-05 17:48:37 -08:00
meta eth: fbnic: fix reporting of alloc_failed qstats 2025-10-09 11:10:02 +02:00
micrel net: Fix typos 2025-07-25 10:29:07 -07:00
microchip lan966x: Fix sleeping in atomic context 2025-11-06 07:31:34 -08:00
microsoft net: mana: Reduce waiting time if HWC not responding 2025-09-14 11:54:07 -07:00
moxa
mscc net: mscc: ocelot: Fix use-after-free caused by cyclic delayed work 2025-10-06 11:12:52 -07:00
myricom
natsemi net: natsemi: fix `rx_dropped` double accounting on `netif_rx()` failure 2025-09-15 19:06:25 -07:00
neterion net: Fix typos 2025-07-25 10:29:07 -07:00
netronome nfp: xsk: fix memory leak in nfp_net_alloc() 2025-10-29 17:38:23 -07:00
ni
nvidia
nxp
oki-semi
packetengines
pasemi
pensando net: ionic: map SKB after pseudo-header checksum prep 2025-11-03 17:19:21 -08:00
qlogic pci-v6.18-changes 2025-10-06 10:41:03 -07:00
qualcomm net: ethernet: qualcomm: QCOM_PPE should depend on ARCH_QCOM 2025-09-01 12:53:38 -07:00
rdc
realtek r8169: fix packet truncation after S4 resume on RTL8168H/RTL8111H 2025-10-13 17:33:56 -07:00
renesas net: ravb: Ensure memory write completes before ringing TX doorbell 2025-10-22 18:15:14 -07:00
rocker
samsung
seeq
sfc sfc: fix potential memory leak in efx_mae_process_mport() 2025-10-27 17:55:41 -07:00
sgi
silan
sis
smsc smsc911x: add second read of EEPROM mac when possible corruption seen 2025-09-04 19:09:44 -07:00
socionext
spacemit net: spacemit: Check netif_running() in emac_set_pauseparam() 2025-11-03 17:23:48 -08:00
stmicro net: stmmac: est: Fix GCL bounds checks 2025-10-29 18:49:24 -07:00
sun net: Fix typos 2025-07-25 10:29:07 -07:00
sunplus
synopsys
tehuti net: Fix typos 2025-07-25 10:29:07 -07:00
ti net: ti: icssg-prueth: Fix fdb hash size configuration 2025-11-05 17:43:08 -08:00
toshiba
tundra
vertexcom
via
wangxun net: libwx: fix device bus LAN ID 2025-11-05 17:52:13 -08:00
wiznet net: WQ_PERCPU added to alloc_workqueue users 2025-09-22 17:40:30 -07:00
xilinx net: xilinx: axienet: Fix kernel-doc warnings for missing return descriptions 2025-09-22 16:37:36 -07:00
xircom xirc2ps_cs: fix register access when enabling FullDuplex 2025-08-29 19:05:11 -07:00
xscale
Kconfig net: spacemit: Add K1 Ethernet MAC 2025-09-16 12:43:49 +02:00
Makefile net: spacemit: Add K1 Ethernet MAC 2025-09-16 12:43:49 +02:00
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
korina.c
lantiq_etop.c
lantiq_xrx200.c
oa_tc6.c net: ethernet: oa_tc6: Handle failure of spi_setup 2025-08-29 19:42:07 -07:00