* [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2026-11-25 (ice)
@ 2026-11-25 22:44 Tony Nguyen
2026-11-25 22:44 ` [PATCH net 1/5] ice: restore DDP state during PFR recovery Tony Nguyen
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Tony Nguyen @ 2026-11-25 22:44 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev
Cc: Tony Nguyen, przemyslaw.kitszel, aaron.ma, maciej.machnikowski,
grzegorz.nitka, jacob.e.keller
Aaron Ma fixes issues around reset; serializing PF rebuilds and clearing
Flow Director handles to prevent stale references.
Maciek Machnikowski stops E825 PHY/PHC clock drift by holding the PTP
semaphore throughout PHY timer startup; protecting shared register
access from concurrent clock adjustments.
Grzegorz Nitka removes redundant PTP command programming to prevent
potential races with other PTP operations.
Jake Keller fixes E830 ETF timestamp calculation by converting the full
ktime value to nanoseconds to scheduled transmit times match the packet
timestamps.
---
Note:
This will have merge conflicts with net-next.
Resolution is:
diff --cc drivers/net/ethernet/intel/ice/ice_adapter.c
index 8cb61f145d27,01b6d3f751ed..a4261568c8d5
--- a/drivers/net/ethernet/intel/ice/ice_adapter.c
+++ b/drivers/net/ethernet/intel/ice/ice_adapter.c
@@@ -49,6 -73,8 +49,7 @@@ static int ice_adapter_init(void *priv
for (int i = 0; i < ARRAY_SIZE(adapter->cpi_phy_lock); i++)
mutex_init(&adapter->cpi_phy_lock[i]);
mutex_init(&adapter->cgu_synce_lock);
+ mutex_init(&adapter->rebuild_lock);
- refcount_set(&adapter->refcount, 1);
spin_lock_init(&adapter->ports.lock);
INIT_LIST_HEAD(&adapter->ports.list);
---
The following are changes since commit 7ed616970b652ae76d99a01b468588e491021648:
mptcp: gate diag sequence counters on CAP_NET_ADMIN
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE
Aaron Ma (2):
ice: restore DDP state during PFR recovery
ice: clear Flow Director entries before reset cleanup
Grzegorz Nitka (1):
ice: remove redundant cross-timestamp PTP command
Jacob Keller (1):
ice: fix computation of ETF timestamps for E830
Maciek Machnikowski (1):
ice: ptp: serialize E825 PHY timer start with PTP lock and incval
drivers/net/ethernet/intel/ice/ice.h | 1 +
drivers/net/ethernet/intel/ice/ice_adapter.c | 2 +
drivers/net/ethernet/intel/ice/ice_adapter.h | 3 ++
.../ethernet/intel/ice/ice_ethtool_ntuple.c | 26 ++++++++++
drivers/net/ethernet/intel/ice/ice_main.c | 37 ++++++++++----
drivers/net/ethernet/intel/ice/ice_ptp.c | 6 ---
drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 48 ++++++++-----------
drivers/net/ethernet/intel/ice/ice_txrx.c | 9 ++--
.../net/ethernet/intel/ice/ice_vlan_mode.c | 2 +-
.../net/ethernet/intel/ice/ice_vlan_mode.h | 1 +
10 files changed, 88 insertions(+), 47 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH net 1/5] ice: restore DDP state during PFR recovery
2026-11-25 22:44 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2026-11-25 (ice) Tony Nguyen
@ 2026-11-25 22:44 ` Tony Nguyen
2026-11-25 22:48 ` netdev-bot+sinfo
2026-11-26 23:00 ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 2/5] ice: clear Flow Director entries before reset cleanup Tony Nguyen
` (3 subsequent siblings)
4 siblings, 2 replies; 12+ messages in thread
From: Tony Nguyen @ 2026-11-25 22:44 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev
Cc: Aaron Ma, anthony.l.nguyen, przemyslaw.kitszel,
maciej.machnikowski, grzegorz.nitka, jacob.e.keller,
Aleksandr Loktionov, Simon Horman, Ayush Singh
From: Aaron Ma <aaron.ma@canonical.com>
The firmware package and switch recipes are shared by all PFs of an
adapter. However, each PF rebuilds independently after system resume. The
resulting package downloads and recipe updates can interleave, causing
firmware timeouts and leaving interfaces unusable.
PFR also clears package-derived firmware state on affected devices. The
existing PFR path only rebuilds the driver's block tables, so VLAN recipe
programming can fail after the reset.
The failure is reported as:
ice 0000:04:00.0: Update pkg failed: err -5
ice 0000:04:00.0: package load failed, -12
ice 0000:04:00.0: Rebuild failed, unload and reload driver
This was observed on an Intel E810-XXV-2 adapter (PCI ID 8086:159b,
revision 02) with NVM package 1.0.0.18 and ICE OS Default DDP package
1.3.43.0.
Serialize rebuilds across PFs of the same adapter, while allowing each PFR
to complete independently. Reload the DDP package from its cached copy and
restore the default DVM recipes before rebuilding the remaining PF state.
Abort recovery if either operation fails.
In addition, stop the service task before tearing down resources in
ice_remove() so that an in-flight rebuild completes and cannot dereference
pf->adapter after ice_adapter_put().
Fixes: 462acf6aca85 ("ice: Enable DDP package download")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Ayush Singh <ayush1x.singh@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_adapter.c | 2 ++
drivers/net/ethernet/intel/ice/ice_adapter.h | 3 ++
drivers/net/ethernet/intel/ice/ice_main.c | 35 ++++++++++++++-----
.../net/ethernet/intel/ice/ice_vlan_mode.c | 2 +-
.../net/ethernet/intel/ice/ice_vlan_mode.h | 1 +
5 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.c b/drivers/net/ethernet/intel/ice/ice_adapter.c
index aa2d8addae5b..01b6d3f751ed 100644
--- a/drivers/net/ethernet/intel/ice/ice_adapter.c
+++ b/drivers/net/ethernet/intel/ice/ice_adapter.c
@@ -73,6 +73,7 @@ static struct ice_adapter *ice_adapter_new(struct pci_dev *pdev)
for (int i = 0; i < ARRAY_SIZE(adapter->cpi_phy_lock); i++)
mutex_init(&adapter->cpi_phy_lock[i]);
mutex_init(&adapter->cgu_synce_lock);
+ mutex_init(&adapter->rebuild_lock);
refcount_set(&adapter->refcount, 1);
spin_lock_init(&adapter->ports.lock);
@@ -86,6 +87,7 @@ static void ice_adapter_free(struct ice_adapter *adapter)
WARN_ON(!list_empty(&adapter->ports.list));
for (int i = 0; i < ARRAY_SIZE(adapter->cpi_phy_lock); i++)
mutex_destroy(&adapter->cpi_phy_lock[i]);
+ mutex_destroy(&adapter->rebuild_lock);
mutex_destroy(&adapter->cgu_synce_lock);
cleanup_srcu_struct(&adapter->ports.srcu);
diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.h b/drivers/net/ethernet/intel/ice/ice_adapter.h
index fd5585005d91..231abb8bbe1f 100644
--- a/drivers/net/ethernet/intel/ice/ice_adapter.h
+++ b/drivers/net/ethernet/intel/ice/ice_adapter.h
@@ -43,6 +43,7 @@ struct ice_port_list {
* Index 0 = PHY0, index 1 = PHY1. Used on E825C devices.
* @cgu_synce_lock: Mutex serializing changes of the CGU registers R10 and R11,
* which all PFs reach. Used on E825C devices.
+ * @rebuild_lock: serialize PFR recovery across PFs of the same adapter
* @ctrl_pf: Control PF of the adapter
* @ports: Ports list
* @index: 64-bit index cached for collision detection on 32bit systems
@@ -57,6 +58,8 @@ struct ice_adapter {
struct mutex cpi_phy_lock[ICE_E825_MAX_PHYS];
/* Serialize changes of the SyncE CGU registers (E825C only) */
struct mutex cgu_synce_lock;
+ /* Serialize PFR recovery touching shared FW global state */
+ struct mutex rebuild_lock;
struct ice_pf *ctrl_pf;
struct ice_port_list ports;
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 47c6798c97e8..f858473f6f53 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -659,7 +659,9 @@ static void ice_do_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
*/
if (reset_type == ICE_RESET_PFR) {
pf->pfr_count++;
+ mutex_lock(&pf->adapter->rebuild_lock);
ice_rebuild(pf, reset_type);
+ mutex_unlock(&pf->adapter->rebuild_lock);
clear_bit(ICE_PREPARED_FOR_RESET, pf->state);
clear_bit(ICE_PFR_REQ, pf->state);
wake_up(&pf->reset_wait_queue);
@@ -704,7 +706,9 @@ static void ice_reset_subtask(struct ice_pf *pf)
} else {
/* done with reset. start rebuild */
pf->hw.reset_ongoing = false;
+ mutex_lock(&pf->adapter->rebuild_lock);
ice_rebuild(pf, reset_type);
+ mutex_unlock(&pf->adapter->rebuild_lock);
/* clear bit to resume normal operations, but
* ICE_NEEDS_RESTART bit is set in case rebuild failed
*/
@@ -5382,6 +5386,8 @@ static void ice_remove(struct pci_dev *pdev)
return;
}
+ ice_service_task_stop(pf);
+
if (test_bit(ICE_FLAG_SRIOV_ENA, pf->flags)) {
set_bit(ICE_VF_RESETS_DISABLED, pf->state);
ice_free_vfs(pf);
@@ -7682,14 +7688,27 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
goto err_init_ctrlq;
}
- /* if DDP was previously loaded successfully */
- if (!ice_is_safe_mode(pf)) {
- /* reload the SW DB of filter tables */
- if (reset_type == ICE_RESET_PFR)
- ice_fill_blk_tbls(hw);
- else
- /* Reload DDP Package after CORER/GLOBR reset */
- ice_load_pkg(NULL, pf);
+ if (!ice_is_safe_mode(pf) && reset_type == ICE_RESET_PFR) {
+ enum ice_ddp_state state;
+
+ state = ice_init_pkg(hw, hw->pkg_copy, hw->pkg_size);
+ ice_log_pkg_init(hw, state);
+ if (!ice_is_init_pkg_successful(state))
+ goto err_init_ctrlq;
+ } else if (!ice_is_safe_mode(pf)) {
+ /* Reload DDP Package after CORER/GLOBR reset */
+ ice_load_pkg(NULL, pf);
+ }
+
+ /* PFR can lose DVM recipes after system suspend. */
+ if (!ice_is_safe_mode(pf) && reset_type == ICE_RESET_PFR &&
+ ice_is_dvm_ena(hw)) {
+ err = ice_dvm_update_dflt_recipes(hw);
+ if (err) {
+ dev_err(dev, "failed to restore default DVM recipes: %d\n",
+ err);
+ goto err_init_ctrlq;
+ }
}
err = ice_clear_pf_cfg(hw);
diff --git a/drivers/net/ethernet/intel/ice/ice_vlan_mode.c b/drivers/net/ethernet/intel/ice/ice_vlan_mode.c
index 92c6f83a7efe..69dce2997845 100644
--- a/drivers/net/ethernet/intel/ice/ice_vlan_mode.c
+++ b/drivers/net/ethernet/intel/ice/ice_vlan_mode.c
@@ -240,7 +240,7 @@ static struct ice_update_recipe_lkup_idx_params ice_dvm_dflt_recipes[] = {
* ice_dvm_update_dflt_recipes - update default switch recipes in DVM
* @hw: hardware structure used to update the recipes
*/
-static int ice_dvm_update_dflt_recipes(struct ice_hw *hw)
+int ice_dvm_update_dflt_recipes(struct ice_hw *hw)
{
unsigned long i;
diff --git a/drivers/net/ethernet/intel/ice/ice_vlan_mode.h b/drivers/net/ethernet/intel/ice/ice_vlan_mode.h
index a0fb743d08e2..5dc705435f56 100644
--- a/drivers/net/ethernet/intel/ice/ice_vlan_mode.h
+++ b/drivers/net/ethernet/intel/ice/ice_vlan_mode.h
@@ -8,6 +8,7 @@ struct ice_hw;
bool ice_is_dvm_ena(struct ice_hw *hw);
int ice_set_vlan_mode(struct ice_hw *hw);
+int ice_dvm_update_dflt_recipes(struct ice_hw *hw);
void ice_post_pkg_dwnld_vlan_mode_cfg(struct ice_hw *hw);
#endif /* _ICE_VLAN_MODE_H */
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net 2/5] ice: clear Flow Director entries before reset cleanup
2026-11-25 22:44 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2026-11-25 (ice) Tony Nguyen
2026-11-25 22:44 ` [PATCH net 1/5] ice: restore DDP state during PFR recovery Tony Nguyen
@ 2026-11-25 22:44 ` Tony Nguyen
2026-11-26 23:00 ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 3/5] ice: ptp: serialize E825 PHY timer start with PTP lock and incval Tony Nguyen
` (2 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Tony Nguyen @ 2026-11-25 22:44 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev
Cc: Aaron Ma, anthony.l.nguyen, przemyslaw.kitszel,
maciej.machnikowski, grzegorz.nitka, jacob.e.keller,
Aleksandr Loktionov, Simon Horman, Ayush Singh
From: Aaron Ma <aaron.ma@canonical.com>
Flow Director profiles retain handles to generic flow entries. Reset calls
ice_clear_hw_tbls() to free those entries, but leaves the Flow Director
handles unchanged until replay replaces them.
If rebuild fails before replay completes, later driver removal follows a
stale handle and dereferences a freed flow entry in ice_flow_rem_entry().
KASAN reports a wild access to list poison from
ice_fdir_erase_flow_from_hw().
The failure is reported as:
KASAN: maybe wild-memory-access in range [0xdead000000000108-...]
RIP: ice_flow_rem_entry+0xaf/0x170 [ice]
ice_fdir_erase_flow_from_hw+0x1ee/0x420 [ice]
Clear the Flow Director handles while holding hw->fdir_fltr_lock before
the hardware tables free their entries. A successful replay installs new
handles, while a failed rebuild leaves them invalid for later cleanup.
Fixes: 148beb612031 ("ice: Initialize Flow Director resources")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Ayush Singh <ayush1x.singh@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice.h | 1 +
.../ethernet/intel/ice/ice_ethtool_ntuple.c | 26 +++++++++++++++++++
drivers/net/ethernet/intel/ice/ice_main.c | 2 ++
3 files changed, 29 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index 432da05c48c0..865f299a6ac1 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -1032,6 +1032,7 @@ ice_get_fdir_fltr_ids(struct ice_hw *hw, struct ethtool_rxnfc *cmd,
u32 *rule_locs);
void ice_fdir_rem_adq_chnl(struct ice_hw *hw, u16 vsi_idx);
void ice_fdir_release_flows(struct ice_hw *hw);
+void ice_fdir_clear_flow_handles(struct ice_hw *hw);
void ice_fdir_replay_flows(struct ice_hw *hw);
void ice_fdir_replay_fltrs(struct ice_pf *pf);
int ice_fdir_create_dflt_rules(struct ice_pf *pf);
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c b/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c
index 8805f0efe977..3b77a3cf6c64 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c
@@ -415,6 +415,32 @@ void ice_fdir_release_flows(struct ice_hw *hw)
ice_fdir_erase_flow_from_hw(hw, ICE_BLK_FD, flow);
}
+/**
+ * ice_fdir_clear_flow_handles - clear handles freed during reset
+ * @hw: pointer to HW instance
+ */
+void ice_fdir_clear_flow_handles(struct ice_hw *hw)
+{
+ int flow;
+
+ if (!hw->fdir_prof)
+ return;
+
+ mutex_lock(&hw->fdir_fltr_lock);
+ for (flow = 0; flow < ICE_FLTR_PTYPE_MAX; flow++) {
+ struct ice_fd_hw_prof *prof = hw->fdir_prof[flow];
+ int tun, i;
+
+ if (!prof)
+ continue;
+
+ for (tun = 0; tun < ICE_FD_HW_SEG_MAX; tun++)
+ for (i = 0; i < prof->cnt; i++)
+ prof->entry_h[i][tun] = 0;
+ }
+ mutex_unlock(&hw->fdir_fltr_lock);
+}
+
/**
* ice_fdir_replay_flows - replay HW Flow Director filter info
* @hw: pointer to HW instance
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index f858473f6f53..706172e149b9 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -601,6 +601,8 @@ ice_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
netif_device_detach(vsi->netdev);
skip:
+ if (hw->fdir_prof)
+ ice_fdir_clear_flow_handles(hw);
/* clear SW filtering DB */
ice_clear_hw_tbls(hw);
/* disable the VSIs and their queues that are not already DOWN */
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net 3/5] ice: ptp: serialize E825 PHY timer start with PTP lock and incval
2026-11-25 22:44 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2026-11-25 (ice) Tony Nguyen
2026-11-25 22:44 ` [PATCH net 1/5] ice: restore DDP state during PFR recovery Tony Nguyen
2026-11-25 22:44 ` [PATCH net 2/5] ice: clear Flow Director entries before reset cleanup Tony Nguyen
@ 2026-11-25 22:44 ` Tony Nguyen
2026-11-26 0:03 ` Jacob Keller
2026-11-26 23:00 ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 4/5] ice: remove redundant cross-timestamp PTP command Tony Nguyen
2026-11-25 22:44 ` [PATCH net 5/5] ice: fix computation of ETF timestamps for E830 Tony Nguyen
4 siblings, 2 replies; 12+ messages in thread
From: Tony Nguyen @ 2026-11-25 22:44 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev
Cc: Maciek Machnikowski, anthony.l.nguyen, przemyslaw.kitszel,
aaron.ma, grzegorz.nitka, jacob.e.keller, richardcochran,
Marc Neustadter, Sergey Temerkhanov, Milena Olech, Simon Horman,
Aleksandr Loktionov, Ayush Singh
From: Maciek Machnikowski <maciej.machnikowski@intel.com>
ice_start_phy_timer_eth56g() programmed the PHY increment value and
performed the PHY-to-PHC phase synchronization in two separate PTP
semaphore critical sections, and touched the shared source command
register (GLTSYN_CMD via ice_ptp_src_cmd()) and read the source incval
before acquiring the semaphore at all.
Because GLTSYN_CMD is a single global register latched for the source
timer and all PHY ports by GLTSYN_CMD_SYNC, a concurrent adjtime (small
offset, <= S32_MAX) or adjfine could clobber the source command between
the incval-init and the phase-sync steps. In the worst case the source
timer command written by ice_ptp_adj_clock() (ICE_PTP_ADJ_TIME) was
overwritten by the unlocked ICE_PTP_NOP from ice_start_phy_timer_eth56g(),
so the adjustment was applied to the PHY ports but not to the PHC. This
left the E825 PHY clock permanently offset from the PHC, showing up as an
intermittent clock drift.
Hold the PTP semaphore across the entire start sequence: acquire it
before the first shared-register access (ice_ptp_src_cmd()), keep it held
through the incval read, PHY incval init, and the phase synchronization,
then release it once. Since the hardware semaphore is not recursive, split
the phase-sync helper into ice_sync_phy_timer_eth56g_unlocked(), which
assumes the caller already holds the lock, and call it directly from
ice_start_phy_timer_eth56g(). The locking wrapper is removed as it no
longer has any callers.
Fixes: 781ff8f2d575 ("ice: ptp: serialize E825 PHY timer start with PTP lock")
Signed-off-by: Maciek Machnikowski <maciej.machnikowski@intel.com>
Co-developed-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
Suggested-by: Marc Neustadter <marc.neustadter@intel.com>
Reviewed-by: Sergey Temerkhanov <sergey.temerkhanov@intel.com>
Reviewed-by: Milena Olech <milena.olech@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Ayush Singh <ayush1x.singh@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 48 +++++++++------------
1 file changed, 21 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
index 3a41c711e751..16333d4a34cc 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
@@ -2028,7 +2028,7 @@ static int ice_read_phy_and_phc_time_eth56g(struct ice_hw *hw, u8 port,
}
/**
- * ice_sync_phy_timer_eth56g - Synchronize the PHY timer with PHC timer
+ * ice_sync_phy_timer_eth56g_unlocked - Synchronize the PHY timer with PHC timer
* @hw: pointer to the HW struct
* @port: the PHY port to synchronize
*
@@ -2041,22 +2041,18 @@ static int ice_read_phy_and_phc_time_eth56g(struct ice_hw *hw, u8 port,
*
* Return:
* * %0 - success
- * * %-EBUSY- failed to acquire PTP semaphore
* * %other - PHY read/write failed
+ *
+ * The caller must acquire PTP semaphore lock
*/
-static int ice_sync_phy_timer_eth56g(struct ice_hw *hw, u8 port)
+static int ice_sync_phy_timer_eth56g_unlocked(struct ice_hw *hw, u8 port)
{
u64 phc_time, phy_time, difference;
int err;
- if (!ice_ptp_lock(hw)) {
- ice_debug(hw, ICE_DBG_PTP, "Failed to acquire PTP semaphore\n");
- return -EBUSY;
- }
-
err = ice_read_phy_and_phc_time_eth56g(hw, port, &phy_time, &phc_time);
if (err)
- goto err_unlock;
+ return err;
/* Calculate the amount required to add to the port time in order for
* it to match the PHC time.
@@ -2072,11 +2068,11 @@ static int ice_sync_phy_timer_eth56g(struct ice_hw *hw, u8 port)
err = ice_ptp_prep_port_adj_eth56g(hw, port, (s64)difference);
if (err)
- goto err_unlock;
+ return err;
err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_ADJ_TIME);
if (err)
- goto err_unlock;
+ return err;
/* Issue the sync to activate the time adjustment */
ice_ptp_exec_tmr_cmd(hw);
@@ -2086,15 +2082,13 @@ static int ice_sync_phy_timer_eth56g(struct ice_hw *hw, u8 port)
*/
err = ice_read_phy_and_phc_time_eth56g(hw, port, &phy_time, &phc_time);
if (err)
- goto err_unlock;
+ return err;
dev_info(ice_hw_to_dev(hw),
"Port %u PHY time synced to PHC: 0x%016llX, 0x%016llX\n",
port, phy_time, phc_time);
-err_unlock:
- ice_ptp_unlock(hw);
- return err;
+ return 0;
}
/**
@@ -2155,19 +2149,24 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
if (err)
return err;
+ if (!ice_ptp_lock(hw)) {
+ dev_err(ice_hw_to_dev(hw), "Failed to acquire PTP semaphore\n");
+ return -EBUSY;
+ }
+
ice_ptp_src_cmd(hw, ICE_PTP_NOP);
err = ice_phy_cfg_parpcs_eth56g(hw, port);
if (err)
- return err;
+ goto err_ptp_unlock;
err = ice_phy_cfg_ptp_1step_eth56g(hw, port);
if (err)
- return err;
+ goto err_ptp_unlock;
err = ice_phy_cfg_mac_eth56g(hw, port);
if (err)
- return err;
+ goto err_ptp_unlock;
if (ice_is_primary(hw)) {
lo = rd32(hw, GLTSYN_INCVAL_L(tmr_idx));
@@ -2178,11 +2177,6 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
}
incval = (u64)hi << 32 | lo;
- if (!ice_ptp_lock(hw)) {
- dev_err(ice_hw_to_dev(hw), "Failed to acquire PTP semaphore\n");
- return -EBUSY;
- }
-
err = ice_write_40b_ptp_reg_eth56g(hw, port, PHY_REG_TIMETUS_L, incval);
if (err)
goto err_ptp_unlock;
@@ -2193,11 +2187,11 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
ice_ptp_exec_tmr_cmd(hw);
- ice_ptp_unlock(hw);
-
- err = ice_sync_phy_timer_eth56g(hw, port);
+ err = ice_sync_phy_timer_eth56g_unlocked(hw, port);
if (err)
- return err;
+ goto err_ptp_unlock;
+
+ ice_ptp_unlock(hw);
err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_OFFSET_READY, 1);
if (err)
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net 4/5] ice: remove redundant cross-timestamp PTP command
2026-11-25 22:44 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2026-11-25 (ice) Tony Nguyen
` (2 preceding siblings ...)
2026-11-25 22:44 ` [PATCH net 3/5] ice: ptp: serialize E825 PHY timer start with PTP lock and incval Tony Nguyen
@ 2026-11-25 22:44 ` Tony Nguyen
2026-11-26 23:00 ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 5/5] ice: fix computation of ETF timestamps for E830 Tony Nguyen
4 siblings, 1 reply; 12+ messages in thread
From: Tony Nguyen @ 2026-11-25 22:44 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev
Cc: Grzegorz Nitka, anthony.l.nguyen, przemyslaw.kitszel, aaron.ma,
maciej.machnikowski, jacob.e.keller, richardcochran,
Sergey Temerkhanov, Milena Olech, Simon Horman,
Aleksandr Loktionov, Ayush Singh
From: Grzegorz Nitka <grzegorz.nitka@intel.com>
The cross-timestamp capture path programs GLTSYN_CMD with READ_TIME before
starting the ART/device capture and clears it with NOP afterwards.
It was assumed that this change was needed for E823 devices, which
turned out to be not true. The hardware supported by this driver
does not require it.
Since GLTSYN_CMD is shared with other PTP operations, touching it here
only adds a potential race source.
Remove the redundant source command programming instead of adding another
guard around it.
Testing hints:
Verify crosstimestamp path, for example with phc2sys tool, on
E822/E823/E825/E830 devices. Please note that the phc2sys tool performs
cross-timestamping by default when supported by the hardware. This can
be observed when the reported delay is 0, indicating that the system
time and PHC time were latched simultaneously.
Fixes: 88c360e49f51 ("ice: Support cross-timestamping for E823 devices")
Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
Reviewed-by: Sergey Temerkhanov <sergey.temerkhanov@intel.com>
Reviewed-by: Milena Olech <milena.olech@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Ayush Singh <ayush1x.singh@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_ptp.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 8908b4f3db35..db1d0e42ae52 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -2183,9 +2183,6 @@ static int ice_capture_crosststamp(ktime_t *device,
/* Snapshot system time for historic interpolation */
ktime_get_snapshot_id(ctx->snapshot_clock_id, &ctx->snapshot);
- /* Program cmd to master timer */
- ice_ptp_src_cmd(hw, ICE_PTP_READ_TIME);
-
/* Start the ART and device clock sync sequence */
ctl = rd32(hw, cfg->ctl_reg);
ctl |= cfg->ctl_active;
@@ -2212,9 +2209,6 @@ static int ice_capture_crosststamp(ktime_t *device,
*device = ns_to_ktime(ts);
err_timeout:
- /* Clear the master timer */
- ice_ptp_src_cmd(hw, ICE_PTP_NOP);
-
/* Release HW lock */
lock = rd32(hw, cfg->lock_reg);
lock &= ~cfg->lock_busy;
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net 5/5] ice: fix computation of ETF timestamps for E830
2026-11-25 22:44 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2026-11-25 (ice) Tony Nguyen
` (3 preceding siblings ...)
2026-11-25 22:44 ` [PATCH net 4/5] ice: remove redundant cross-timestamp PTP command Tony Nguyen
@ 2026-11-25 22:44 ` Tony Nguyen
4 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2026-11-25 22:44 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev
Cc: Jacob Keller, anthony.l.nguyen, przemyslaw.kitszel, aaron.ma,
maciej.machnikowski, grzegorz.nitka, paul.greenwalt,
maciej.fijalkowski, richardcochran, Aleksandr Loktionov
From: Jacob Keller <jacob.e.keller@intel.com>
When Earliest TxTime First offload is enabled, the ice_tx_map() function
computes the appropriate timestamps for the timestamp ring used to set the
transmit times for each packet.
It computes this by converting the skb->tstamp into a timespec and then
taking the sub-second portion from tv_nsec and dividing it by the timestamp
resolution. This value is then inserted into the timestamp descriptor using
ice_build_tstamp_desc().
At first glance this may seem reasonable. After all, the Tx timestamp
descriptor field has a mask defined by ICE_TXTIME_STAMP_M which is
GENMASK(31,13). This is a 19-bit wide field. With a unit size of 128
nanoseconds, the maximum representable time is only ~67 milliseconds, far
below the size of the tv_nsec field (just shy of one second).
The E830 device time is represented as a single 64-bit nanosecond value as
seen by ice_ptp_read_src_clk_reg() using a simple rd64 on the GLTSYN_TIME_L
register.
According to the data sheet, the hardware uses the following flow to
determine when to transmit the next packet in the paced queue:
half_window = window_size / 2
if (ts <= timer) {
if (timer - ts < half_window) {
// timestamp expired
pass
} else {
// wait before sending
stall
}
} else {
// Handle possible rollover case
if (ts - timer < half_window) {
// wait before sending
stall
} else {
// timestamp expired
pass
}
}
Here, window_size is the maximum value that fix in the 19 bit sized
timestamp field, ts is the next packet timestamp waiting in the queue, and
timer is the 19 bits of the GLTSYN_TIME MAC timer. The configured timestamp
"resolution" determines at which bit position to capture from the
GLTSYN_TIME registers. This logic does not perform any computation to
divide out seconds or to handle anything like a timespec. The timestamp and
timer values are compared directly with logic to account for handling
rollover.
Because of the faulty logic, all of the timestamps computed and placed in
the ring will result in the transmit time not matching the desired time per
the skb. Consider a timestamp exactly on a second boundary. The computed
timestamp will be 0, while the actual value should be (1,000,000,000 / 128)
mod 2^19 or 472,468 (0x73594).
Fix this by directly converting the ktime to nanoseconds rather than
converting to a timespec64.
Fixes: ccde82e90946 ("ice: add E830 Earliest TxTime First Offload support")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_txrx.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 35a480a1e172..ca98394caa04 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1522,10 +1522,9 @@ ice_tx_map(struct ice_tx_ring *tx_ring, struct ice_tx_buf *first,
if (ice_is_txtime_cfg(tx_ring)) {
struct ice_tstamp_ring *tstamp_ring;
- u32 tstamp_count, j;
struct ice_ts_desc *ts_desc;
- struct timespec64 ts;
- u32 tstamp;
+ u32 tstamp_count, j;
+ u64 tstamp;
smp_rmb(); /* order flag read before pointer read */
tstamp_ring = READ_ONCE(tx_ring->tstamp_ring);
@@ -1535,8 +1534,8 @@ ice_tx_map(struct ice_tx_ring *tx_ring, struct ice_tx_buf *first,
tstamp_count = tstamp_ring->count;
j = tstamp_ring->next_to_use;
- ts = ktime_to_timespec64(first->skb->tstamp);
- tstamp = ts.tv_nsec >> ICE_TXTIME_CTX_RESOLUTION_128NS;
+ tstamp = ktime_to_ns(first->skb->tstamp);
+ tstamp >>= ICE_TXTIME_CTX_RESOLUTION_128NS;
ts_desc = ICE_TS_DESC(tstamp_ring, j);
ts_desc->tx_desc_idx_tstamp = ice_build_tstamp_desc(i, tstamp);
--
2.47.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH net 1/5] ice: restore DDP state during PFR recovery
2026-11-25 22:44 ` [PATCH net 1/5] ice: restore DDP state during PFR recovery Tony Nguyen
@ 2026-11-25 22:48 ` netdev-bot+sinfo
2026-11-26 23:00 ` netdev-bot+sashiko
1 sibling, 0 replies; 12+ messages in thread
From: netdev-bot+sinfo @ 2026-11-25 22:48 UTC (permalink / raw)
To: Tony Nguyen
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev,
Aaron Ma, przemyslaw.kitszel, maciej.machnikowski, grzegorz.nitka,
jacob.e.keller, Aleksandr Loktionov, Simon Horman, Ayush Singh
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by LLM and not proven at runtime). If it was triggered
please include the symptoms, like the stack trace or kernel messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net 3/5] ice: ptp: serialize E825 PHY timer start with PTP lock and incval
2026-11-25 22:44 ` [PATCH net 3/5] ice: ptp: serialize E825 PHY timer start with PTP lock and incval Tony Nguyen
@ 2026-11-26 0:03 ` Jacob Keller
2026-11-26 23:00 ` netdev-bot+sashiko
1 sibling, 0 replies; 12+ messages in thread
From: Jacob Keller @ 2026-11-26 0:03 UTC (permalink / raw)
To: Tony Nguyen, davem, kuba, pabeni, edumazet, andrew+netdev,
willemb, netdev
Cc: Maciek Machnikowski, przemyslaw.kitszel, aaron.ma, grzegorz.nitka,
richardcochran, Marc Neustadter, Sergey Temerkhanov, Milena Olech,
Simon Horman, Aleksandr Loktionov, Ayush Singh
On 11/25/2026 2:44 PM, Tony Nguyen wrote:
> From: Maciek Machnikowski <maciej.machnikowski@intel.com>
> drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 48 +++++++++------------
> 1 file changed, 21 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> index 3a41c711e751..16333d4a34cc 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> @@ -2028,7 +2028,7 @@ static int ice_read_phy_and_phc_time_eth56g(struct ice_hw *hw, u8 port,
> }
>
> /**
> - * ice_sync_phy_timer_eth56g - Synchronize the PHY timer with PHC timer
> + * ice_sync_phy_timer_eth56g_unlocked - Synchronize the PHY timer with PHC timer
> * @hw: pointer to the HW struct
> * @port: the PHY port to synchronize
> *
:\ I don't like to do this, but we agreed on IWL that this rename is
unnecessary since there is no _locked equivalent and it is somewhat
confusing since the context is still locked, just not acquired within
this function.
Strictly, if this merges as is, it isn't the end of the world, but I'd
weakly prefer that we drop this postfix rename.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net 1/5] ice: restore DDP state during PFR recovery
2026-11-25 22:44 ` [PATCH net 1/5] ice: restore DDP state during PFR recovery Tony Nguyen
2026-11-25 22:48 ` netdev-bot+sinfo
@ 2026-11-26 23:00 ` netdev-bot+sashiko
1 sibling, 0 replies; 12+ messages in thread
From: netdev-bot+sashiko @ 2026-11-26 23:00 UTC (permalink / raw)
To: anthony.l.nguyen
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev,
grzegorz.nitka, przemyslaw.kitszel, aaron.ma, maciej.machnikowski,
jacob.e.keller, richardcochran, sergey.temerkhanov, milena.olech,
horms, aleksandr.loktionov, ayush1x.singh
Thank you for your contribution! Sashiko AI review found 8 potential
issue(s) to consider.
Critical: 0 · High: 2 · Medium: 2 · Low: 4
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] Every PF reset (PFR) now throws away the driver's record of
offloaded UDP tunnel ports.
- [High] The fix for 'in-flight rebuild dereferences pf->adapter after
ice_adapter_put()' covers only ice_remove(); the probe error-unwind…
- [Medium] The adapter-wide rebuild_lock covers the whole of
ice_rebuild() for every reset type.
- [Medium] The new PFR step replays only ice_dvm_update_dflt_recipes()
(ice_main.c:7703-7712).
- [Low] The new PFR branch of ice_rebuild() (ice_main.c:7691-7697) calls
ice_log_pkg_init() after a failed ice_init_pkg() and then jumps to…
- [Low] ice_init_pkg_hints() (ice_ddp.c:2098-2145) resets hw->tnl before
rescanning package labels but never resets hw->dvm_upd.
- [Low] rebuild_lock serializes only the two ice_rebuild() call sites.
- [Low] ice_remove() now calls ice_service_task_stop(pf)
(ice_main.c:5389) before devl_lock(), ice_free_vfs() and the rest of…
--
ice: restore DDP state during PFR recovery
This commit adds an adapter-wide rebuild_lock that serializes
ice_rebuild() across PFs of the same adapter. On PFR it reloads the DDP
package from the cached copy and restores the default DVM recipes. It
also stops the service task early in ice_remove().
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 47c6798c97e8f..f858473f6f532 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -659,7 +659,9 @@ static void ice_do_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
> */
> if (reset_type == ICE_RESET_PFR) {
> pf->pfr_count++;
> + mutex_lock(&pf->adapter->rebuild_lock);
> ice_rebuild(pf, reset_type);
> + mutex_unlock(&pf->adapter->rebuild_lock);
[Severity: Low]
Does this lock cover every path that touches the shared package and
recipe state? Probe still downloads the DDP package and updates the
default recipes without rebuild_lock:
ice_probe()
ice_init_dev()
ice_init_ddp_config()
ice_load_pkg()
ice_copy_and_init_pkg()
ice_init_pkg()
ice_download_pkg()
ice_post_dwnld_pkg_actions()
ice_set_vlan_mode()
ice_set_dvm()
ice_dvm_update_dflt_recipes()
A probe or rebind of one PF can still interleave its package and recipe
AQ sequences with another PF's PFR rebuild. That is the interleaving the
commit message describes. The new ice_dvm_update_dflt_recipes() call in
ice_rebuild() also runs outside the firmware global config lock.
The firmware global config lock already arbitrates the actual downloads.
A second PF normally gets ICE_DDP_PKG_ALREADY_LOADED and skips
ice_set_dvm(), so the remaining window is narrow.
> clear_bit(ICE_PREPARED_FOR_RESET, pf->state);
> clear_bit(ICE_PFR_REQ, pf->state);
> wake_up(&pf->reset_wait_queue);
> @@ -704,7 +706,9 @@ static void ice_reset_subtask(struct ice_pf *pf)
> } else {
> /* done with reset. start rebuild */
> pf->hw.reset_ongoing = false;
> + mutex_lock(&pf->adapter->rebuild_lock);
> ice_rebuild(pf, reset_type);
> + mutex_unlock(&pf->adapter->rebuild_lock);
[Severity: Medium]
Is it intended that this lock also covers CORER, GLOBR and EMPR
rebuilds? The kernel-doc in ice_adapter.h only mentions PFR:
* @rebuild_lock: serialize PFR recovery across PFs of the same adapter
For EMPR, ice_rebuild() sleeps first, and now does so with the lock held:
if (reset_type == ICE_RESET_EMPR) {
...
msleep(ICE_EMP_RESET_SLEEP_MS);
}
All PFs get the global reset OICR, finish ice_check_reset() and then
queue on this mutex. Their 5 second sleeps and full rebuilds now run one
after another. With N PFs, the last one finishes after roughly
N * (5s + rebuild time).
Can this push fixed waits past their timeout? For example,
ice_devlink_reload_empr_finish() calls ice_wait_for_reset(pf, 60 * HZ).
It could then report "Device still resetting after 1 minute" while
recovery is still in progress.
> /* clear bit to resume normal operations, but
> * ICE_NEEDS_RESTART bit is set in case rebuild failed
> */
> @@ -5382,6 +5386,8 @@ static void ice_remove(struct pci_dev *pdev)
> return;
> }
>
> + ice_service_task_stop(pf);
> +
[Severity: High]
This covers ice_remove(), but can the same use-after-free still happen
on the ice_probe() error path?
Once ice_init() succeeds, ICE_SERVICE_DIS is cleared and serv_tmr is
armed. If ice_load() or ice_init_devlink() fails after that, the unwind
does:
unroll_init:
devl_unlock(priv_to_devlink(pf));
ice_deinit(pf);
unroll_dev_init:
need_dev_deinit = true;
unroll_adapter:
ice_adapter_put(pdev);
unroll_hw_init:
ice_deinit_hw(hw);
if (need_dev_deinit)
ice_deinit_dev(pf);
ice_deinit() only sets ICE_SERVICE_DIS and ICE_DOWN. The service task is
not sync-cancelled until ice_deinit_dev(), which runs after
ice_adapter_put().
A service work item that is already running may be in
ice_reset_subtask() on the ICE_RESET_OICR_RECV path. There it polls
ice_check_reset() for several seconds. That path does not check
ICE_DOWN, and it then reaches the new:
mutex_lock(&pf->adapter->rebuild_lock);
ice_rebuild() only checks ICE_DOWN after the lock is taken. If this PF
held the last adapter reference, the adapter has already been kfree()d
at that point.
Should the probe unwind also stop the service task before
ice_adapter_put()?
[Severity: Low]
Is it safe to stop the service task this early? Through
ice_clean_adminq_subtask(), it is the only thing that drains the ARQ and
completes ice_aq_wait_for_event() waiters.
A devlink flash update runs under the devlink instance lock and blocks
in ice_aq_wait_for_event(), for example in ice_write_one_nvm_block():
err = ice_aq_wait_for_event(pf, &task, 15 * HZ);
If the device is unbound while a flash is in progress, ice_remove() now
sets ICE_SERVICE_DIS and then waits in devl_lock(). The flash no longer
gets its completions and fails with "Timed out waiting for firmware"
once the timeout expires, which also delays removal.
Before this patch the service task stayed alive until ice_deinit_dev().
Would stopping it just before ice_adapter_put() be enough for the
problem described in the commit message?
> if (test_bit(ICE_FLAG_SRIOV_ENA, pf->flags)) {
> set_bit(ICE_VF_RESETS_DISABLED, pf->state);
> ice_free_vfs(pf);
> @@ -7682,14 +7688,27 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
> goto err_init_ctrlq;
> }
>
> - /* if DDP was previously loaded successfully */
> - if (!ice_is_safe_mode(pf)) {
> - /* reload the SW DB of filter tables */
> - if (reset_type == ICE_RESET_PFR)
> - ice_fill_blk_tbls(hw);
> - else
> - /* Reload DDP Package after CORER/GLOBR reset */
> - ice_load_pkg(NULL, pf);
> + if (!ice_is_safe_mode(pf) && reset_type == ICE_RESET_PFR) {
> + enum ice_ddp_state state;
> +
> + state = ice_init_pkg(hw, hw->pkg_copy, hw->pkg_size);
[Severity: High]
Before this patch, a PFR only called ice_fill_blk_tbls(). Now
ice_init_pkg() also calls ice_init_pkg_hints(), which does:
memset(&hw->tnl, 0, sizeof(hw->tnl));
and then rebuilds the table through ice_add_tunnel_hint() with port = 0.
Does this throw away the driver's record of offloaded VXLAN/GENEVE ports
on every PFR?
Nothing in ice replays the tunnel ports afterwards, and there is no
udp_tunnel_nic_reset_ntf() call. The udp_tunnel_nic core therefore still
thinks the ports are offloaded. When firmware reports the package as
already loaded, the parser boost TCAM also keeps matching the old port.
First, ice_get_open_tunnel_port() returns false. ice_fill_adv_packet_tun()
then fails tunnel switch rules with -EIO, and the ntuple and FDIR tunnel
paths stop handling tunnels.
Second, when the vxlan/geneve device is removed later,
ice_udp_tunnel_unset_port()->ice_destroy_tunnel() hits:
if (WARN_ON(!hw->tnl.tbl[index].valid ||
hw->tnl.tbl[index].type != type ||
hw->tnl.tbl[index].port != port)) {
status = -EIO;
goto ice_destroy_tunnel_end;
}
It returns before the original boost entry is restored, so the parser
keeps classifying that UDP port as a tunnel.
Third, the memset runs without hw->tnl_lock and without rtnl, while
udp_tunnel_nic calls set_port/unset_port under rtnl. Can a concurrent
ice_create_tunnel() memcpy() from hw->tnl.tbl[index].boost_entry while
it is NULL?
CORER/GLOBR already reset this table. PFR is much more frequent,
though: tx timeout recovery, resume, PCI error resume.
[Severity: Low]
ice_init_pkg_hints() clears hw->tnl but not hw->dvm_upd.
ice_add_dvm_hint() appends at the current count:
if (hw->dvm_upd.count < ICE_DVM_MAX_ENTRIES) {
hw->dvm_upd.tbl[hw->dvm_upd.count].boost_addr = val;
hw->dvm_upd.tbl[hw->dvm_upd.count].enable = enable;
hw->dvm_upd.count++;
}
Nothing ever resets dvm_upd.count. Does each PFR now append another
duplicate set of DVM/SVM boost hints until the 48-entry table is full?
ice_set_dvm_boost_entries() would then issue a package update for every
accumulated entry on each later real download, while holding the global
config lock. The final hardware state should not change. The cost is
redundant firmware updates and longer lock hold times.
> + ice_log_pkg_init(hw, state);
> + if (!ice_is_init_pkg_successful(state))
> + goto err_init_ctrlq;
[Severity: Low]
For most failure states, ice_log_pkg_init() prints a message ending in
"Entering Safe Mode.", for example:
dev_err(dev, "The DDP package file is invalid. Entering Safe Mode.\n");
This path does not clear ICE_FLAG_ADV_FEATURES the way ice_load_pkg()
does. It jumps to err_init_ctrlq and then logs "Rebuild failed, unload
and reload driver". The log ends up with two contradictory messages.
Should this either fall back to safe mode like the CORER/GLOBR path, or
avoid the safe mode wording here?
> + } else if (!ice_is_safe_mode(pf)) {
> + /* Reload DDP Package after CORER/GLOBR reset */
> + ice_load_pkg(NULL, pf);
> + }
> +
> + /* PFR can lose DVM recipes after system suspend. */
> + if (!ice_is_safe_mode(pf) && reset_type == ICE_RESET_PFR &&
> + ice_is_dvm_ena(hw)) {
> + err = ice_dvm_update_dflt_recipes(hw);
[Severity: Medium]
Is replaying only the default recipes enough here? ice_set_dvm()
programs DVM in four steps:
status = ice_aq_set_vlan_mode(hw, ¶ms);
...
status = ice_dvm_update_dflt_recipes(hw);
...
status = ice_aq_set_port_params(hw->port_info, true, NULL);
...
status = ice_set_dvm_boost_entries(hw);
On the usual ICE_DDP_PKG_ALREADY_LOADED path,
ice_post_dwnld_pkg_actions() is skipped, so only the recipe update is
replayed. Port params are reprogrammed later in ice_rebuild(), but the
DVM/SVM parser boost TCAM entries are not.
The commit message says PFR clears package-derived firmware state. If
so, wouldn't the boost entries be lost as well, leaving the recipes
without matching parser state?
ice_update_recipe_lkup_idx() also does a get/modify/add read-modify-write
on default recipes that the whole adapter shares. Before this patch that
happened only at package download time. Now every PFR does it while
other PFs may have live rules on those recipes, and rebuild_lock only
serializes against other rebuilds.
Can firmware reject this update on an in-use recipe? If it does, the
whole PFR rebuild now fails.
> + if (err) {
> + dev_err(dev, "failed to restore default DVM recipes: %d\n",
> + err);
> + goto err_init_ctrlq;
> + }
> }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125224428.4126195-2-anthony.l.nguyen%40intel.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net 2/5] ice: clear Flow Director entries before reset cleanup
2026-11-25 22:44 ` [PATCH net 2/5] ice: clear Flow Director entries before reset cleanup Tony Nguyen
@ 2026-11-26 23:00 ` netdev-bot+sashiko
0 siblings, 0 replies; 12+ messages in thread
From: netdev-bot+sashiko @ 2026-11-26 23:00 UTC (permalink / raw)
To: anthony.l.nguyen
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev,
grzegorz.nitka, przemyslaw.kitszel, aaron.ma, maciej.machnikowski,
jacob.e.keller, richardcochran, sergey.temerkhanov, milena.olech,
horms, aleksandr.loktionov, ayush1x.singh
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 1 (1) · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The fix is incomplete: it clears the PF's Flow Director handles
but leaves the VF Flow Director handles stale.
- [Medium] Holding hw->fdir_fltr_lock in ice_fdir_clear_flow_handles()
does not stop concurrent writers of entry_h.
- [Low] ice_prepare_for_reset() now calls mutex_lock(&hw->fdir_fltr_lock)
on every reset whenever hw->fdir_prof is non-NULL.
Pre-existing issues:
- [High] ice_fdir_replay_flows() ignores the return value of
ice_flow_add_prof() and then always uses hw_prof->id.
--
ice: clear Flow Director entries before reset cleanup
This patch adds ice_fdir_clear_flow_handles(). The new helper zeroes the
PF Flow Director entry_h[][] handles under hw->fdir_fltr_lock.
ice_prepare_for_reset() calls it before ice_clear_hw_tbls() frees the
flow entries, so that a failed rebuild followed by driver removal does not
follow stale handles into ice_flow_rem_entry().
> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c b/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c
> index 8805f0efe9773..3b77a3cf6c645 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c
> @@ -415,6 +415,32 @@ void ice_fdir_release_flows(struct ice_hw *hw)
> ice_fdir_erase_flow_from_hw(hw, ICE_BLK_FD, flow);
> }
>
> +/**
> + * ice_fdir_clear_flow_handles - clear handles freed during reset
> + * @hw: pointer to HW instance
> + */
> +void ice_fdir_clear_flow_handles(struct ice_hw *hw)
> +{
> + int flow;
> +
> + if (!hw->fdir_prof)
> + return;
> +
> + mutex_lock(&hw->fdir_fltr_lock);
> + for (flow = 0; flow < ICE_FLTR_PTYPE_MAX; flow++) {
> + struct ice_fd_hw_prof *prof = hw->fdir_prof[flow];
> + int tun, i;
> +
> + if (!prof)
> + continue;
> +
> + for (tun = 0; tun < ICE_FD_HW_SEG_MAX; tun++)
> + for (i = 0; i < prof->cnt; i++)
> + prof->entry_h[i][tun] = 0;
> + }
[Severity: High]
Should this also clear the VF Flow Director handles?
This loop only walks hw->fdir_prof[]. The VF profiles in
vf->fdir.fdir_prof[flow] are also struct ice_fd_hw_prof. Their entry_h[][]
values are handles to ICE_BLK_FD entries that
ice_vc_fdir_write_flow_prof() creates on hw->fl_profs[ICE_BLK_FD].
ice_clear_hw_tbls()->ice_free_flow_profs(hw, ICE_BLK_FD) frees every entry
on that list, VF entries included. Nothing resets the VF entry_h[][] or
prof_entry_cnt[][], and VF FDIR profiles are not replayed.
After the rebuild, ice_reset_all_vfs() calls
ice_vf_fdir_exit()->ice_vc_fdir_rem_prof_all()->ice_vc_fdir_rem_prof().
That function still sees the stale handles:
drivers/net/ethernet/intel/ice/virt/fdir.c:ice_vc_fdir_rem_prof() {
...
for (i = 0; i < fdir->prof_entry_cnt[flow][tun]; i++)
if (vf_prof->entry_h[i][tun]) {
...
ice_flow_rem_entry(hw, ICE_BLK_FD,
vf_prof->entry_h[i][tun]);
...
}
ice_flow_rem_entry() then reads entry->prof from the freed entry and runs
mutex_lock() and list_del() on it. Isn't this the same use-after-free that
the KASAN trace in the commit message shows?
If ice_check_reset() fails and ice_reset_all_vfs() is skipped, the stale
VF handles are followed later from
ice_free_vfs()->ice_free_vf_res()->ice_vf_fdir_exit(). That is the
rebuild-fails-then-remove case this patch is meant to fix.
The VF code predates this patch. Could the fix also invalidate the
vf->fdir.fdir_prof[] handles (or prof_entry_cnt) for each VF?
> + mutex_unlock(&hw->fdir_fltr_lock);
> +}
[Severity: Medium]
Does holding hw->fdir_fltr_lock here serialize against the code that
writes entry_h[][]?
The main writer is ice_fdir_set_hw_fltr_rule(), reached through
ice_add_ntuple_ethtool()->ice_cfg_fdir_xtrct_seq(). That path runs after
a lockless reset check and before fdir_fltr_lock is taken:
drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c:ice_add_ntuple_ethtool() {
...
if (ice_is_reset_in_progress(pf->state)) {
...
ret = ice_cfg_fdir_xtrct_seq(pf, fsp, &userdata);
...
mutex_lock(&hw->fdir_fltr_lock);
...
}
The stores themselves are not under the lock:
ice_fdir_set_hw_fltr_rule() {
...
hw_prof->entry_h[0][tun] = entry1_h;
hw_prof->entry_h[1][tun] = entry2_h;
...
}
The lock is also dropped here, before ice_prepare_for_reset() calls
ice_clear_hw_tbls() to free the entries. ice_reset_subtask() holds neither
rtnl nor any lock that the ethtool path shares.
Suppose an ethtool -N add gets a handle from ice_flow_add_entry() before
ice_free_flow_profs() runs, but stores it into entry_h[][] after this
function unlocks. If the rebuild then fails before ice_fdir_replay_flows(),
ice_deinit_fdir()->ice_fdir_rem_flow()->ice_fdir_erase_flow_from_hw()->
ice_flow_rem_entry() would follow that stale handle.
The race between ethtool and reset predates this patch. The commit message
reads as if the lock makes the clear safe, though:
Clear the Flow Director handles while holding hw->fdir_fltr_lock before
the hardware tables free their entries.
> +
> /**
> * ice_fdir_replay_flows - replay HW Flow Director filter info
> * @hw: pointer to HW instance
[Severity: High]
This isn't a bug introduced by this patch, but the commit relies on
replay to install new handles. Is ice_fdir_replay_flows() safe when
ice_flow_add_prof() fails?
ice_fdir_replay_flows() {
...
struct ice_flow_prof *hw_prof;
...
ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX,
prof->fdir_seg[tun], TNL_SEG_CNT(tun),
false, &hw_prof);
for (j = 0; j < prof->cnt; j++) {
...
err = ice_flow_add_entry(hw, ICE_BLK_FD,
hw_prof->id,
...
prof->prof_id[tun] = hw_prof->id;
...
}
The return value is ignored, and hw_prof has no initializer.
ice_flow_add_prof() only sets *prof on success.
ice_cfg_fdir_xtrct_seq() treats a failed tunnel rule as a soft failure. It
frees tun_seg while the non-tunnel rule stays installed, which leaves
prof->cnt != 0 with prof->fdir_seg[ICE_FD_HW_SEG_TUN] == NULL. On the next
reset, replay calls ice_flow_add_prof() with segs == NULL, gets -EINVAL,
and then uses hw_prof->id anyway.
Can this oops in the rebuild path? With CONFIG_INIT_STACK_ALL_ZERO it would
be a NULL dereference. Otherwise it could reuse a stale pointer from the
previous tun iteration and record the wrong prof_id and entry_h values,
leading to later double frees.
-ENOSPC, -ENOMEM and AQ failures from ice_flow_add_prof() would reach the
same code.
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index f858473f6f532..706172e149b94 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -601,6 +601,8 @@ ice_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
> netif_device_detach(vsi->netdev);
> skip:
>
> + if (hw->fdir_prof)
> + ice_fdir_clear_flow_handles(hw);
[Severity: Low]
With this change, ice_prepare_for_reset() takes hw->fdir_fltr_lock on
every reset once hw->fdir_prof is allocated. Can it end up locking a mutex
that has already been destroyed?
hw->fdir_prof is devm allocated, and ice_deinit_fdir() never clears it.
ice_deinit_fdir() does destroy the lock, though:
mutex_destroy(&(&pf->hw)->fdir_fltr_lock);
During devlink reload, ice_devlink_reinit_down() calls ice_unload(), which
reaches ice_deinit_fdir() through ice_deinit_features(). Only after that
does ice_deinit_dev() stop the service task:
ice_devlink_reinit_down() {
ice_unload(pf);
...
ice_deinit_dev(pf);
}
If a CORER, GLOBR or EMPR is handled in that window, the path is
ice_reset_subtask()->ice_prepare_for_reset()->ice_fdir_clear_flow_handles(),
which calls mutex_lock() on the destroyed lock. With CONFIG_DEBUG_MUTEXES
that triggers DEBUG_LOCKS_WARN_ON().
The same can happen if, on a later load, ice_init_fdir() fails before its
mutex_init() while hw->fdir_prof is still set.
Before this patch, the reset path only took this lock through
ice_remove_q_channels(), for non-PFR resets with TC_MQPRIO.
> /* clear SW filtering DB */
> ice_clear_hw_tbls(hw);
> /* disable the VSIs and their queues that are not already DOWN */
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125224428.4126195-2-anthony.l.nguyen%40intel.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net 3/5] ice: ptp: serialize E825 PHY timer start with PTP lock and incval
2026-11-25 22:44 ` [PATCH net 3/5] ice: ptp: serialize E825 PHY timer start with PTP lock and incval Tony Nguyen
2026-11-26 0:03 ` Jacob Keller
@ 2026-11-26 23:00 ` netdev-bot+sashiko
1 sibling, 0 replies; 12+ messages in thread
From: netdev-bot+sashiko @ 2026-11-26 23:00 UTC (permalink / raw)
To: anthony.l.nguyen
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev,
grzegorz.nitka, przemyslaw.kitszel, aaron.ma, maciej.machnikowski,
jacob.e.keller, richardcochran, sergey.temerkhanov, milena.olech,
horms, aleksandr.loktionov, ayush1x.singh
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The concern says the sentence 'The caller must acquire PTP
semaphore lock', which the patch adds after the Return: bullet list in…
Pre-existing issues:
- [Medium] At this commit, ice_capture_crosststamp() in
drivers/net/ethernet/intel/ice/ice_ptp.c writes the shared GLTSYN_CMD…
- [Medium] ice_start_phy_timer_e82x() in
drivers/net/ethernet/intel/ice/ice_ptp_hw.c repeats the unlocked…
- [Low] The kernel-doc Return list of ice_start_phy_timer_eth56g() in
drivers/net/ethernet/intel/ice/ice_ptp_hw.c (lines 2134-2136) has only…
--
ice: ptp: serialize E825 PHY timer start with PTP lock and incval
This patch holds the PTP hardware semaphore across the whole of
ice_start_phy_timer_eth56g(). It now covers the first GLTSYN_CMD write,
the incval read, the PHY incval init and the phase sync. The phase-sync
helper becomes ice_sync_phy_timer_eth56g_unlocked(), which expects the
caller to already hold the semaphore.
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> index 3a41c711e751b..16333d4a34ccf 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
[ ... ]
> @@ -2041,22 +2041,18 @@ static int ice_read_phy_and_phc_time_eth56g(struct ice_hw *hw, u8 port,
> *
> * Return:
> * * %0 - success
> - * * %-EBUSY- failed to acquire PTP semaphore
> * * %other - PHY read/write failed
> + *
> + * The caller must acquire PTP semaphore lock
> */
[Severity: Low]
This is a pre-existing issue, but with the -EBUSY entry dropped here, is
-EBUSY still documented anywhere in this call chain?
The kernel-doc for ice_start_phy_timer_eth56g() only lists:
* Return:
* * %0 - success
* * %other - PHY read/write failed
The function returns -EBUSY directly when ice_ptp_lock() fails, and it did
so before this patch too. Could a %-EBUSY entry be added to the
ice_start_phy_timer_eth56g() kernel-doc?
[ ... ]
> @@ -2155,19 +2149,24 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
> if (err)
> return err;
>
> + if (!ice_ptp_lock(hw)) {
> + dev_err(ice_hw_to_dev(hw), "Failed to acquire PTP semaphore\n");
> + return -EBUSY;
> + }
> +
> ice_ptp_src_cmd(hw, ICE_PTP_NOP);
[Severity: Medium]
This isn't a bug introduced by this patch, but is the PTP semaphore enough
to keep every other writer off GLTSYN_CMD here?
ice_capture_crosststamp() in ice_ptp.c also writes GLTSYN_CMD. It holds
only the cross-timestamp semaphore (cfg->lock_reg, which is PFHH_SEM on
E82x/E825), not the PFTSYN_SEM semaphore taken by ice_ptp_lock():
drivers/net/ethernet/intel/ice/ice_ptp.c:ice_capture_crosststamp() {
...
/* Program cmd to master timer */
ice_ptp_src_cmd(hw, ICE_PTP_READ_TIME);
...
err_timeout:
/* Clear the master timer */
ice_ptp_src_cmd(hw, ICE_PTP_NOP);
...
}
On E825, a PTP_SYS_OFFSET_PRECISE request (phc2sys uses it by default)
could overwrite the source command partway through ice_ptp_tmr_cmd()
(adjtime/adjfine). It could do the same partway through
ice_sync_phy_timer_eth56g_unlocked(). Wouldn't that produce the same
PHY/PHC divergence the commit message describes?
This appears to come from commit 88c360e49f51. The next patch in this
series, "ice: remove redundant cross-timestamp PTP command", removes both
ice_ptp_src_cmd() calls from ice_capture_crosststamp(), so the race is gone
by the end of the series.
[ ... ]
> @@ -2193,11 +2187,11 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
>
> ice_ptp_exec_tmr_cmd(hw);
>
> - ice_ptp_unlock(hw);
> -
> - err = ice_sync_phy_timer_eth56g(hw, port);
> + err = ice_sync_phy_timer_eth56g_unlocked(hw, port);
> if (err)
> - return err;
> + goto err_ptp_unlock;
> +
> + ice_ptp_unlock(hw);
[Severity: Medium]
This is a pre-existing issue, but does ice_start_phy_timer_e82x() need the
same change?
It is called from the same ice_ptp_port_phy_restart() path, which holds
only the per-port ps_lock. Without the PTP semaphore it still reads the
incval, writes the shared GLTSYN_CMD, and fires GLTSYN_CMD_SYNC three
times:
drivers/net/ethernet/intel/ice/ice_ptp_hw.c:ice_start_phy_timer_e82x() {
...
lo = rd32(hw, GLTSYN_INCVAL_L(tmr_idx));
hi = rd32(hw, GLTSYN_INCVAL_H(tmr_idx));
incval = (u64)hi << 32 | lo;
...
err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_INIT_INCVAL);
if (err)
return err;
/* Do not perform any action on the main timer */
ice_ptp_src_cmd(hw, ICE_PTP_NOP);
ice_ptp_exec_tmr_cmd(hw);
...
ice_ptp_exec_tmr_cmd(hw);
...
ice_ptp_exec_tmr_cmd(hw);
err = ice_sync_phy_timer_e82x(hw, port);
...
}
The semaphore is only taken later, inside ice_sync_phy_timer_e82x().
ps_lock does not exclude ice_ptp_adjtime() or ice_ptp_adjfine() running
under ice_ptp_lock() on this PF or another one. It also does not exclude
ice_ptp_settime64()->ice_ptp_restart_all_phy().
Can this NOP replace an ADJ_TIME or INIT_INCVAL that ice_ptp_tmr_cmd() has
staged, or can one of these execs latch it early? Either would leave the
E822/E823 PHY timer offset from the PHC.
The commit message limits the fix to E825, so this may belong in a
separate patch.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125224428.4126195-2-anthony.l.nguyen%40intel.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net 4/5] ice: remove redundant cross-timestamp PTP command
2026-11-25 22:44 ` [PATCH net 4/5] ice: remove redundant cross-timestamp PTP command Tony Nguyen
@ 2026-11-26 23:00 ` netdev-bot+sashiko
0 siblings, 0 replies; 12+ messages in thread
From: netdev-bot+sashiko @ 2026-11-26 23:00 UTC (permalink / raw)
To: anthony.l.nguyen
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, willemb, netdev,
grzegorz.nitka, przemyslaw.kitszel, aaron.ma, maciej.machnikowski,
jacob.e.keller, richardcochran, sergey.temerkhanov, milena.olech,
horms, aleksandr.loktionov, ayush1x.singh
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In ice_capture_crosststamp()
(drivers/net/ethernet/intel/ice/ice_ptp.c), the patch drops the…
--
ice: remove redundant cross-timestamp PTP command
This patch changes ice_capture_crosststamp(). It no longer programs
GLTSYN_CMD with READ_TIME before the ART/device cross-timestamp capture,
and no longer clears it with NOP afterwards. The commit message says the
hardware never needed the READ_TIME step, and that writing the shared
GLTSYN_CMD register only adds a potential race.
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
> index 8908b4f3db353..db1d0e42ae52c 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
> @@ -2183,9 +2183,6 @@ static int ice_capture_crosststamp(ktime_t *device,
> /* Snapshot system time for historic interpolation */
> ktime_get_snapshot_id(ctx->snapshot_clock_id, &ctx->snapshot);
>
> - /* Program cmd to master timer */
> - ice_ptp_src_cmd(hw, ICE_PTP_READ_TIME);
> -
[Severity: Medium]
The commit being fixed describes this step as a requirement seen on
hardware, not as an assumption. 88c360e49f51 ("ice: Support
cross-timestamping for E823 devices") says:
The GLTSYN_CMD register must be programmed with the READ_TIME
command. Otherwise, the cross timestamp will always report a value of
zero for the PTP hardware clock time.
This commit message only says:
It was assumed that this change was needed for E823 devices, which
turned out to be not true.
Is there a datasheet, erratum or firmware/NVM detail that explains why the
earlier observation was wrong? Was testing done across all E823 silicon
steppings and NVM versions?
If the requirement still holds on some E823 configuration, the capture
would still look successful, because ctl_active clears. The zero PHC time
would then be returned without any check:
ts_lo = rd32(hw, cfg->dev_time_l[tmr_idx]);
ts_hi = rd32(hw, cfg->dev_time_h[tmr_idx]);
ts = ((u64)ts_hi << 32) | ts_lo;
*device = ns_to_ktime(ts);
ice_ptp_getcrosststamp() selects this routine for ICE_MAC_GENERIC,
ICE_MAC_GENERIC_3K_E825 and ICE_MAC_E830, so every device that supports
cross-timestamping goes through this path. phc2sys uses
PTP_SYS_OFFSET_PRECISE by default when it is available. A PHC time of 0
would show up there as a very large offset and could make it step the
clock.
Separately, this patch carries a Fixes: tag and will probably go to
stable. Could the commit message describe the user-visible symptom of the
old code? Right now it only calls it "a potential race source".
The race looks real. ice_capture_crosststamp() holds only the
cross-timestamp semaphore (PFHH_SEM / E830_PFPTM_SEM). It does not hold
the PTP semaphore that ice_ptp_lock() takes in the settime, adjtime and
incval paths, which also program GLTSYN_CMD.
So the old READ_TIME/NOP writes could overwrite a prepared INIT_TIME,
ADJ_TIME or INIT_INCVAL command, and a clock adjustment would be lost
without any error. Could that be stated in the commit message for
backporters?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125224428.4126195-2-anthony.l.nguyen%40intel.com
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-11-26 23:00 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 22:44 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2026-11-25 (ice) Tony Nguyen
2026-11-25 22:44 ` [PATCH net 1/5] ice: restore DDP state during PFR recovery Tony Nguyen
2026-11-25 22:48 ` netdev-bot+sinfo
2026-11-26 23:00 ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 2/5] ice: clear Flow Director entries before reset cleanup Tony Nguyen
2026-11-26 23:00 ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 3/5] ice: ptp: serialize E825 PHY timer start with PTP lock and incval Tony Nguyen
2026-11-26 0:03 ` Jacob Keller
2026-11-26 23:00 ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 4/5] ice: remove redundant cross-timestamp PTP command Tony Nguyen
2026-11-26 23:00 ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 5/5] ice: fix computation of ETF timestamps for E830 Tony Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox