linux/drivers/net
Horatiu Vultur 9b2bfdbf43 phy: mscc: Stop taking ts_lock for tx_queue and use its own lock
When transmitting a PTP frame which is timestamp using 2 step, the
following warning appears if CONFIG_PROVE_LOCKING is enabled:
=============================
[ BUG: Invalid wait context ]
6.17.0-rc1-00326-ge6160462704e #427 Not tainted
-----------------------------
ptp4l/119 is trying to lock:
c2a44ed4 (&vsc8531->ts_lock){+.+.}-{3:3}, at: vsc85xx_txtstamp+0x50/0xac
other info that might help us debug this:
context-{4:4}
4 locks held by ptp4l/119:
 #0: c145f068 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x58/0x1440
 #1: c29df974 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: __dev_queue_xmit+0x5c4/0x1440
 #2: c2aaaad0 (_xmit_ETHER#2){+.-.}-{2:2}, at: sch_direct_xmit+0x108/0x350
 #3: c2aac170 (&lan966x->tx_lock){+.-.}-{2:2}, at: lan966x_port_xmit+0xd0/0x350
stack backtrace:
CPU: 0 UID: 0 PID: 119 Comm: ptp4l Not tainted 6.17.0-rc1-00326-ge6160462704e #427 NONE
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 __lock_acquire+0x8e8/0x29dc
 __lock_acquire from lock_acquire+0x108/0x38c
 lock_acquire from __mutex_lock+0xb0/0xe78
 __mutex_lock from mutex_lock_nested+0x1c/0x24
 mutex_lock_nested from vsc85xx_txtstamp+0x50/0xac
 vsc85xx_txtstamp from lan966x_fdma_xmit+0xd8/0x3a8
 lan966x_fdma_xmit from lan966x_port_xmit+0x1bc/0x350
 lan966x_port_xmit from dev_hard_start_xmit+0xc8/0x2c0
 dev_hard_start_xmit from sch_direct_xmit+0x8c/0x350
 sch_direct_xmit from __dev_queue_xmit+0x680/0x1440
 __dev_queue_xmit from packet_sendmsg+0xfa4/0x1568
 packet_sendmsg from __sys_sendto+0x110/0x19c
 __sys_sendto from sys_send+0x18/0x20
 sys_send from ret_fast_syscall+0x0/0x1c
Exception stack(0xf0b05fa8 to 0xf0b05ff0)
5fa0:                   00000001 0000000e 0000000e 0004b47a 0000003a 00000000
5fc0: 00000001 0000000e 00000000 00000121 0004af58 00044874 00000000 00000000
5fe0: 00000001 bee9d420 00025a10 b6e75c7c

So, instead of using the ts_lock for tx_queue, use the spinlock that
skb_buff_head has.

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Fixes: 7d272e63e0 ("net: phy: mscc: timestamping and PHC support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://patch.msgid.link/20250902121259.3257536-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-09-04 07:48:29 -07:00
..
arcnet
bonding bonding: send LACPDUs periodically in passive mode after receiving partner's LACPDU 2025-08-21 09:35:20 +02:00
caif
can treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
dsa net: dsa: mv88e6xxx: Fix fwnode reference leaks in mv88e6xxx_port_setup_leds 2025-09-02 17:04:03 -07:00
ethernet net: xilinx: axienet: Add error handling for RX metadata pointer retrieval 2025-09-04 07:13:08 -07:00
fddi
fjes
hamradio hamradio: ignore ops-locked netdevs 2025-08-08 13:22:28 -07:00
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 ipa: fix compile-testing with qcom-mdt=m 2025-08-04 17:15:15 -07:00
ipvlan net: s/dev_pre_changeaddr_notify/netif_pre_changeaddr_notify/ 2025-07-18 17:27:47 -07:00
mctp net: mctp: usb: initialise mac header in RX path 2025-09-02 14:48:19 +02:00
mdio net: mdio: mdio-bcm-unimac: Correct rate fallback logic 2025-08-01 14:46:50 -07:00
netdevsim netdevsim: Fix wild pointer access in nsim_queue_free(). 2025-08-13 17:26:39 -07:00
ovpn Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-17 11:00:33 -07:00
pcs net: pcs: rzn1-miic: Correct MODCTRL register offset 2025-09-02 16:37:52 -07:00
phy phy: mscc: Stop taking ts_lock for tx_queue and use its own lock 2025-09-04 07:48:29 -07:00
plip
ppp ppp: fix memory leak in pad_compress_skb 2025-09-04 07:25:48 -07:00
pse-pd net: pse-pd: pd692x0: Skip power budget configuration when undefined 2025-08-21 07:56:08 -07:00
slip
team
thunderbolt
usb net: usb: qmi_wwan: add Telit Cinterion LE910C4-WWX new compositions 2025-08-26 17:08:42 -07:00
vmxnet3
vxlan vxlan: Fix NPD in {arp,neigh}_reduce() when using nexthop objects 2025-09-02 16:57:00 -07:00
wan net: lapbether: ignore ops-locked netdevs 2025-08-08 13:22:28 -07:00
wireguard wireguard: peer: Replace sockaddr with sockaddr_inet 2025-07-25 15:29:58 -07:00
wireless ath.git update for v6.17-rc5 2025-09-03 09:40:20 +02:00
wwan relayfs: abolish prev_padding 2025-07-09 22:57:51 -07:00
xen-netback
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c macsec: read MACSEC_SA_ATTR_PN with nla_get_uint 2025-09-01 13:31:33 -07:00
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
netkit.c netkit: Remove location field in netkit_link 2025-07-11 11:01:09 -07:00
nlmon.c
ntb_netdev.c
pfcp.c
rionet.c
Space.c
sungem_phy.c
tap.c net: s/dev_get_mac_address/netif_get_mac_address/ 2025-07-18 17:27:46 -07:00
tun_vnet.h
tun.c net: s/dev_get_mac_address/netif_get_mac_address/ 2025-07-18 17:27:46 -07:00
veth.c
virtio_net.c virtio_net: adjust the execution order of function virtnet_close during freeze 2025-08-26 03:38:20 -04:00
vrf.c vrf: Drop existing dst reference in vrf_ip6_input_dst 2025-07-26 11:28:45 -07:00
vsockmon.c
xen-netfront.c xen/netfront: Fix TX response spurious interrupts 2025-07-23 13:11:03 +02:00