]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: stmmac: disable PTP clock after unregistering PTP
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 11 Sep 2025 11:09:42 +0000 (12:09 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sun, 14 Sep 2025 19:00:57 +0000 (12:00 -0700)
Follow the principle of unpublish from userspace and then teardown
resources.

Disable the PTP clock only after unregistering with the PTP subsystem,
which ensures that we only stop the clock that ticks the timesource
after we have removed the PTP device.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 419cb49ee5a25519a60a84bae6bcdb0be655384e..5d76cf7957abd868a75184e79cd4d49c1adcc7bb 100644 (file)
@@ -817,8 +817,8 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
 
 static void stmmac_release_ptp(struct stmmac_priv *priv)
 {
-       clk_disable_unprepare(priv->plat->clk_ptp_ref);
        stmmac_ptp_unregister(priv);
+       clk_disable_unprepare(priv->plat->clk_ptp_ref);
 }
 
 /**