]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: ptp: improve handling of aux_ts_lock lifetime
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 11 Sep 2025 11:09:37 +0000 (12:09 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sun, 14 Sep 2025 19:00:54 +0000 (12:00 -0700)
commit9a1d6fa0012dc998ceebab64bd6cb95e807185d3
tree7f686958b1f21edb12d7c2189fbf841a0b86400d
parent9c0d0fa8d4a8719adbe68108ebc9cd723cfa4493
net: stmmac: ptp: improve handling of aux_ts_lock lifetime

The aux_ts_lock mutex is only required while the PTP clock has been
successfully registered.

stmmac_ptp_register() does not return any errors (as we don't wish to
prevent the netdev being opened if PTP fails), stmmac_ptp_unregister()
was coded to allow it to be called irrespective of whether PTP was
successfully registered or not.

Arrange for the aux_ts_lock mutex to be destroyed if the PTP clock
is not functional during stmmac_ptp_register(), and only destroy it
in stmmac_ptp_unregister() if we had a PTP clock registered.

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_ptp.c