[Intel-wired-lan] [PATCH iwl-net v2 2/5] i40e: serialize timestamp configuration with PTP teardown
Nowlin, Alexander
alexander.nowlin at intel.com
Wed Sep 30 01:16:26 UTC 2026
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of xuanqiang.luo at linux.dev
> Sent: Tuesday, August 4, 2026 11:51 PM
> To: intel-wired-lan at lists.osuosl.org; horms at kernel.org
> Cc: vadim.fedorenko at linux.dev; Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel at intel.com>; andrew+netdev at lunn.ch; davem at davemloft.net; edumazet at google.com; kuba at kernel.org; pabeni at redhat.com; richardcochran at gmail.com; Kwapulinski, Piotr <piotr.kwapulinski at intel.com>; Kubalewski, Arkadiusz <arkadiusz.kubalewski at intel.com>; Loktionov, Aleksandr <aleksandr.loktionov at intel.com>; netdev at vger.kernel.org; Xuanqiang Luo <luoxuanqiang at kylinos.cn>
> Subject: [Intel-wired-lan] [PATCH iwl-net v2 2/5] i40e: serialize timestamp configuration with PTP teardown
>
> From: Xuanqiang Luo <luoxuanqiang at kylinos.cn>
>
> i40e_remove() can call i40e_ptp_stop() without the networking locks held.
> A concurrent hardware timestamp request can observe I40E_FLAG_PTP_ENA before teardown clears it, then program PRTTSYN_CTL0 after teardown has disabled the event source. This can leave time sync interrupts enabled during device removal.
>
> Add ptp_config_lock to serialize the enable check and register programming in i40e_ptp_hwtstamp_set() with the PTP state transition in i40e_ptp_stop(). Requests which observe PTP enabled finish programming before the state transition; later requests return -EOPNOTSUPP and cannot re-enable the interrupt.
>
> Fixes: 1050713026a0 ("i40e: add support for PTP external synchronization clock")
> Signed-off-by: Xuanqiang Luo <luoxuanqiang at kylinos.cn>
> ---
> drivers/net/ethernet/intel/i40e/i40e.h | 2 ++
> drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + drivers/net/ethernet/intel/i40e/i40e_ptp.c | 17 +++++++++++++----
> 3 files changed, 16 insertions(+), 4 deletions(-)
Tested-by: Alexander Nowlin <alexander.nowlin at intel.com>
More information about the Intel-wired-lan
mailing list