linux/drivers/net
Vivian Wang 3562601287 net: spacemit: Make stats_lock softirq-safe
While most of the statistics functions (emac_get_stats64() and such) are
called with softirqs enabled, emac_stats_timer() is, as its name
suggests, also called from a timer, i.e. called in softirq context.

All of these take stats_lock. Therefore, make stats_lock softirq-safe by
changing spin_lock() into spin_lock_bh() for the functions that get
statistics.

Also, instead of directly calling emac_stats_timer() in emac_up() and
emac_resume(), set the timer to trigger instead, so that
emac_stats_timer() is only called from the timer. It will keep using
spin_lock().

This fixes a lockdep warning, and potential deadlock when stats_timer is
triggered in the middle of getting statistics.

Fixes: bfec6d7f20 ("net: spacemit: Add K1 Ethernet MAC")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Closes: https://lore.kernel.org/all/a52c0cf5-0444-41aa-b061-a0a1d72b02fe@samsung.com/
Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://patch.msgid.link/20250919-k1-ethernet-fix-lock-v1-1-c8b700aa4954@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-09-22 11:50:40 -07:00
..
arcnet
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-09-18 11:26:06 -07:00
caif
can can: rcar_can: rcar_can_resume(): fix s2ram with PSCI 2025-09-10 17:12:05 +02:00
dsa net: dsa: dsa_loop: remove duplicated definition of NUM_FIXED_PHYS 2025-09-19 07:06:42 -07:00
ethernet net: spacemit: Make stats_lock softirq-safe 2025-09-22 11:50:40 -07:00
fddi
fjes
hamradio
hippi
hyperv net: hv_netvsc: fix loss of early receive events from host during channel open. 2025-08-26 18:15:19 -07:00
ieee802154
ipa
ipvlan ipv4: Convert ->flowi4_tos to dscp_t. 2025-08-26 17:34:31 -07:00
mctp net: mctp: usb: initialise mac header in RX path 2025-09-02 14:48:19 +02:00
mdio of: mdio: warn if deprecated fixed-link binding is used 2025-09-15 18:15:41 -07:00
netdevsim devlink: Move graceful period parameter to reporter ops 2025-08-26 17:24:16 -07:00
ovpn
pcs net: pcs: Kconfig: Fix unmet dependency warning 2025-09-17 14:57:52 -07:00
phy net: phy: micrel: use %pe in print format 2025-09-19 17:01:57 -07:00
plip
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-09-04 13:33:00 -07:00
pse-pd net: pse-pd: Add Si3474 PSE controller driver 2025-08-28 14:41:59 +02:00
slip
team
thunderbolt
usb Revert "net: usb: asix: ax88772: drop phylink use in PM to avoid MDIO runtime PM wakeups" 2025-09-11 16:46:04 +02:00
vmxnet3
vxlan vxlan: Make vxlan_fdb_find_uc() more robust against NPDs 2025-09-09 18:27:33 -07:00
wan wan: framer: pef2256: use %pe in print format 2025-09-19 07:27:24 -07:00
wireguard wireguard: queueing: always return valid online CPU in wg_cpumask_choose_online() 2025-09-11 18:52:21 -07:00
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-09-18 11:26:06 -07:00
wwan net: wwan: iosm: use int type to store negative error codes 2025-08-27 18:17:15 -07:00
xen-netback
amt.c ipv4: Convert ->flowi4_tos to dscp_t. 2025-08-26 17:34:31 -07:00
bareudp.c
dummy.c
eql.c
geneve.c geneve: Avoid -Wflex-array-member-not-at-end warning 2025-09-11 18:49:16 -07:00
gtp.c ipv4: Convert ->flowi4_tos to dscp_t. 2025-08-26 17:34:31 -07:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-09-11 17:40:13 -07:00
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
netkit.c
nlmon.c
ntb_netdev.c
pfcp.c
rionet.c
Space.c
sungem_phy.c
tap.c
tun_vnet.h
tun.c
veth.c
virtio_net.c net: virtio_net: add get_rxrings ethtool callback for RX ring queries 2025-09-18 07:07:39 -07:00
vrf.c ipv4: Convert ->flowi4_tos to dscp_t. 2025-08-26 17:34:31 -07:00
vsockmon.c
xen-netfront.c