]> www.infradead.org Git - users/jedix/linux-maple.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)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Aug 2025 00:52:02 +0000 (17:52 -0700)
commitbc1a59cff9f797bfbf8f3104507584d89e9ecf2e
treed90b719393580754968ea41bec13196e94448f42
parentf179f5bc158f07693b74c264f8933c8b0f07503f
phy: mscc: Fix timestamping for vsc8584

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>
drivers/net/phy/mscc/mscc.h
drivers/net/phy/mscc/mscc_main.c
drivers/net/phy/mscc/mscc_ptp.c