Re: [PATCH net v2] igb: initialize PTP state before registering PHC
From: Simon Horman
Date: Fri Sep 25 2026 - 11:01:05 EST
On Thu, Sep 17, 2026 at 11:02:47PM +0800, Runyu Xiao wrote:
> igb_ptp_init() currently initializes the PTP lock, work items,
> timestamp configuration, and timecounter after ptp_clock_register().
> The PHC is published by that call, so PTP callbacks and timestamp
> interrupts can run before those objects are ready.
>
> Initialize the complete PTP state before registering the PHC. Skip the
> setup when CONFIG_PTP_1588_CLOCK is disabled, since the PTP registration
> helper is then a no-op. If PHC registration fails, cancel the work items
> queued by igb_ptp_reset() or a timestamp interrupt before returning.
>
> Fixes: b888c510f7b3 ("igb: Avoid starting unnecessary workqueues")
> Cc: stable@xxxxxxxxxxxxxxx
> Link: https://lore.kernel.org/netdev/20260830154912.2712900-1-runyu.xiao@xxxxxxxxxx/
> Assisted-by: LLM
> Signed-off-by: Runyu Xiao <runyu.xiao@xxxxxxxxxx>
>
> ---
> v2:
> - Restore all PTP state initialization before PHC registration.
> - Skip PTP setup when CONFIG_PTP_1588_CLOCK is disabled.
> - Cancel both PTP work items when PHC registration fails.
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
For future reference: please post new patch revisions as new
email threads, rather than as a response to an earlier revision.
Link: https://docs.kernel.org/process/maintainer-netdev.html#resending-after-review
Thanks!