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: [email protected]
> Link:
> https://lore.kernel.org/netdev/[email protected]/
> Assisted-by: LLM
> Signed-off-by: Runyu Xiao <[email protected]>
>
> ---
> 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 <[email protected]>
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!