]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
phy: mscc: Fix when PTP clock is register and unregister
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Mon, 25 Aug 2025 06:55:43 +0000 (08:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Sep 2025 13:30:23 +0000 (15:30 +0200)
commit7acefa4c66aab836eb8f6a0bcbc94619a695232d
treeef8fec0728c0967cd01d776d3a7cb54982f7671c
parentb3c70f6fc25804a50f05a860d72cc5a0583eb6db
phy: mscc: Fix when PTP clock is register and unregister

[ Upstream commit 882e57cbc7204662f6c5672d5b04336c1d790b03 ]

It looks like that every time when the interface was set down and up the
driver was creating a new ptp clock. On top of this the function
ptp_clock_unregister was never called.
Therefore fix this by calling ptp_clock_register and initialize the
mii_ts struct inside the probe function and call ptp_clock_unregister when
driver is removed.

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/20250825065543.2916334-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