]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
phy: mscc: Fix timestamping for vsc8584
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Mon, 18 Aug 2025 08:10:29 +0000 (10:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:49 +0000 (16:28 +0200)
commit3a4eeea79a468b6cd623ad555bb9992071607538
tree3a0f505f1fd67453751bfedbc3d5dd28b03a0f3a
parentca18d751bcc9faf5b7e82e9fae1223d103928181
phy: mscc: Fix timestamping for vsc8584

[ Upstream commit bc1a59cff9f797bfbf8f3104507584d89e9ecf2e ]

There was a problem when we received frames and the frames were
timestamped. The driver is configured to store the nanosecond part of
the timestmap in the ptp reserved bits and it would take the second part
by reading the LTC. The problem is that when reading the LTC we are in
atomic context and to read the second part will go over mdio bus which
might sleep, so we get an error.
The fix consists in actually put all the frames in a queue and start the
aux work and in that work to read the LTC and then calculate the full
received time.

Fixes: 7d272e63e0979d ("net: phy: mscc: timestamping and PHC support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20250818081029.1300780-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/mscc/mscc.h
drivers/net/phy/mscc/mscc_main.c
drivers/net/phy/mscc/mscc_ptp.c