]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
phy: mscc: Fix PTP for VSC8574 and VSC8572
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Thu, 23 Oct 2025 19:13:50 +0000 (21:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:40 +0000 (14:02 +0100)
[ Upstream commit ea5df88aeca112aac69e6c32e3dd1433a113b0c9 ]

The PTP initialization is two-step. First part are the function
vsc8584_ptp_probe_once() and vsc8584_ptp_probe() at probe time which
initialize the locks, queues, creates the PTP device. The second part is
the function vsc8584_ptp_init() at config_init() time which initialize
PTP in the HW.

For VSC8574 and VSC8572, the PTP initialization is incomplete. It is
missing the first part but it makes the second part. Meaning that the
ptp_clock_register() is never called.

There is no crash without the first part when enabling PTP but this is
unexpected because some PHys have PTP functionality exposed by the
driver and some don't even though they share the same PTP clock PTP.

Fixes: 774626fa440e ("net: phy: mscc: Add PTP support for 2 more VSC PHYs")
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://patch.msgid.link/20251023191350.190940-3-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_main.c

index ef0ef1570d39234d8aeea829dc0a97150236bf51..48d43f60b8ff8c6d7fda1fb6e176bd1b9aaffa51 100644 (file)
@@ -2625,7 +2625,7 @@ static struct phy_driver vsc85xx_driver[] = {
        .suspend        = &genphy_suspend,
        .resume         = &genphy_resume,
        .remove         = &vsc85xx_remove,
-       .probe          = &vsc8574_probe,
+       .probe          = &vsc8584_probe,
        .set_wol        = &vsc85xx_wol_set,
        .get_wol        = &vsc85xx_wol_get,
        .get_tunable    = &vsc85xx_get_tunable,
@@ -2648,12 +2648,12 @@ static struct phy_driver vsc85xx_driver[] = {
        .config_aneg    = &vsc85xx_config_aneg,
        .aneg_done      = &genphy_aneg_done,
        .read_status    = &vsc85xx_read_status,
-       .handle_interrupt = vsc85xx_handle_interrupt,
+       .handle_interrupt = vsc8584_handle_interrupt,
        .config_intr    = &vsc85xx_config_intr,
        .suspend        = &genphy_suspend,
        .resume         = &genphy_resume,
        .remove         = &vsc85xx_remove,
-       .probe          = &vsc8574_probe,
+       .probe          = &vsc8584_probe,
        .set_wol        = &vsc85xx_wol_set,
        .get_wol        = &vsc85xx_wol_get,
        .get_tunable    = &vsc85xx_get_tunable,