Re: [PATCH net] net: macb: initialize PTP lock before registering clock

From: Vadim Fedorenko

Date: Mon Aug 31 2026 - 15:01:47 EST


On 30/08/2026 16:35, Runyu Xiao wrote:
gem_ptp_init() registers the PTP clock before initializing
bp->tsu_clk_lock. ptp_clock_register() publishes the PTP character
device, so a userspace operation can enter a PTP callback as soon as
registration completes. Those callbacks use tsu_clk_lock and can therefore
observe the lock before it has been initialized.

Initialize the lock before registering the PTP clock so all published
callbacks see valid synchronization state.

Fixes: ab91f0a9b5f4 ("net: macb: Add hardware PTP support")
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: Codex:GPT-5
Signed-off-by: Runyu Xiao <runyu.xiao@xxxxxxxxxx>
---
drivers/net/ethernet/cadence/macb_ptp.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)


Reviewed-by: Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>