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

From: Théo Lebrun

Date: Fri Sep 04 2026 - 13:33:29 EST


Hello Runyu,

Your To/Cc list is incorrect. Have you checked out a recent kernel and
used b4 or get_maintainer.pl?

That is documented in Documentation/process/submitting-patches.rst

And your clanker even has its own version nowadays that mentions it as
well: Documentation/process/coding-assistants.rst

On Fri Sep 4, 2026 at 5:04 AM CEST, Runyu Xiao wrote:
> gem_ptp_init() registers the PTP clock before initializing
> bp->tsu_clk_lock and the TSU hardware. Since ptp_clock_register()
> publishes the PTP character device, userspace may invoke PTP callbacks
> before the lock and hardware are ready.
>
> In addition, gem_ptp_init() is called from both the interface open and
> resume paths. Reinitializing tsu_clk_lock there can reset the lock while
> timestamp processing is using it.
>
> Initialize tsu_clk_lock once during probe and initialize the TSU before
> registering the PTP clock.
>
> Fixes: ab91f0a9b5f4 ("net: macb: Add hardware PTP support")
> Cc: stable@xxxxxxxxxxxxxxx
> Link: https://lore.kernel.org/all/20260830153520.2710520-1-runyu.xiao@xxxxxxxxxx/
> Assisted-by: Codex:GPT-5
> Signed-off-by: Runyu Xiao <runyu.xiao@xxxxxxxxxx>

This is technically correct, though I'm pretty sure the window is tiny.
I always prefer when such commits indicate if the issue was faced in
real life *or not*. So here the commit would be better off mentioning
that this is a theoretical bug never encountered in the wild.

Seeing your patches sent my guess is not.
https://lore.kernel.org/netdev/?q=f%3Arunyu.xiao%40seu.edu.cn

Also you forgot the Reviewed-by trailer sent to you on V1.

Reviewed-by: Théo Lebrun <theo.lebrun@xxxxxxxxxxx>

Thanks,

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com