From: xuanqiang.luo@linux.dev
To: intel-wired-lan@lists.osuosl.org, horms@kernel.org
Cc: vadim.fedorenko@linux.dev, anthony.l.nguyen@intel.com,
przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, richardcochran@gmail.com,
piotr.kwapulinski@intel.com, arkadiusz.kubalewski@intel.com,
aleksandr.loktionov@intel.com, netdev@vger.kernel.org,
Xuanqiang Luo <xuanqiang.luo@linux.dev>
Subject: [Intel-wired-lan] [PATCH iwl-net v2 0/5] i40e: fix PTP work and teardown races
Date: Wed, 5 Aug 2026 14:51:27 +0800 [thread overview]
Message-ID: <20260805065132.148625-1-xuanqiang.luo@linux.dev> (raw)
From: Xuanqiang Luo <xuanqiang.luo@linux.dev>
The i40e PTP paths have independent ownership and lifetime races. A Tx
timestamp skb can be released concurrently, timestamp configuration can
race PTP teardown, reset recovery can rebuild the device during removal,
and external timestamp work can outlive the PHC or PF.
Split the fixes by invariant so each patch remains independently
reviewable. The series is ordered so the external timestamp work fix can
rely on the configuration and reset teardown synchronization introduced
earlier.
---
Changes:
v2:
Patch 1 (new):
- Split Tx timestamp skb ownership into an independent patch and protect
the slot across transmit, timeout, interrupt, error, and stop paths.
(Simon Horman, Sashiko)
- Use ptp_tx_skb as the single source of slot state and verify the skb
owner before releasing it from the Tx error path.
- Keep the existing enable checks outside ptp_tx_lock so the critical
section only covers pending slot ownership.
Patch 2 (new):
- Serialize the PTP_ENA transition with hardware timestamp configuration
so an ioctl cannot re-enable interrupts during teardown. (Sashiko)
Patch 3 (new):
- Split reset/recovery synchronization from the external timestamp work
fix and stop service work before PTP and device teardown.
Patch 4 (new):
- Move the reset polling replacement into its own patch and use the
wait-bit API for reset ownership. (Simon Horman, Sashiko)
Patch 5:
- Close the configuration gate, then disable external timestamp events
and drain the work outside ptp_config_lock before unregistering the
PHC.
v1: https://lore.kernel.org/all/20260724093448.63154-1-xuanqiang.luo@linux.dev/
Xuanqiang Luo (5):
i40e: serialize Tx timestamp skb ownership
i40e: serialize timestamp configuration with PTP teardown
i40e: synchronize reset recovery with device removal
i40e: replace reset polling with wait-bit synchronization
i40e: fix races in PTP external timestamp work handling
drivers/net/ethernet/intel/i40e/i40e.h | 6 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 37 ++++----
drivers/net/ethernet/intel/i40e/i40e_ptp.c | 95 ++++++++++++++-------
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 38 ++++++---
4 files changed, 120 insertions(+), 56 deletions(-)
base-commit: 075b74841bd0065a3bda3440873c747938e69b68
--
2.43.0
next reply other threads:[~2026-08-05 6:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 6:51 xuanqiang.luo [this message]
2026-08-05 6:51 ` [Intel-wired-lan] [PATCH iwl-net v2 1/5] i40e: serialize Tx timestamp skb ownership xuanqiang.luo
2026-08-05 6:51 ` [Intel-wired-lan] [PATCH iwl-net v2 2/5] i40e: serialize timestamp configuration with PTP teardown xuanqiang.luo
2026-08-05 6:51 ` [Intel-wired-lan] [PATCH iwl-net v2 3/5] i40e: synchronize reset recovery with device removal xuanqiang.luo
2026-08-05 6:51 ` [Intel-wired-lan] [PATCH iwl-net v2 4/5] i40e: replace reset polling with wait-bit synchronization xuanqiang.luo
2026-08-05 6:51 ` [Intel-wired-lan] [PATCH iwl-net v2 5/5] i40e: fix races in PTP external timestamp work handling xuanqiang.luo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260805065132.148625-1-xuanqiang.luo@linux.dev \
--to=xuanqiang.luo@linux.dev \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=piotr.kwapulinski@intel.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=richardcochran@gmail.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox