AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/08/22 01:09 flow patch-triage
0m Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "KMSANReasoning": "",
  "NeedsKMSAN": false,
  "Reasoning": "The patch exclusively modifies the Intel E800 series Ethernet driver (ice). This driver requires physical PCIe hardware that is not emulated in standard QEMU or GCE environments. Consequently, the modified code paths (such as PTP timestamping and PHY offset calibration) are unreachable during virtualized fuzzing.",
  "WorthFuzzing": false
}

1/1 2026/08/22 01:09 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 106b004dcd0346bae57bb7488c7e471113802f90\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Sat Aug 22 01:09:36 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/ethernet/intel/ice/ice_adapter.c b/drivers/net/ethernet/intel/ice/ice_adapter.c\nindex 2dc3629d6d0f6..d1643bf8a1b54 100644\n--- a/drivers/net/ethernet/intel/ice/ice_adapter.c\n+++ b/drivers/net/ethernet/intel/ice/ice_adapter.c\n@@ -66,18 +66,17 @@ static struct ice_adapter *ice_adapter_new(struct pci_dev *pdev)\n \t\tmutex_init(\u0026adapter-\u003ecpi_phy_lock[i]);\n \trefcount_set(\u0026adapter-\u003erefcount, 1);\n \n-\tmutex_init(\u0026adapter-\u003eports.lock);\n-\tINIT_LIST_HEAD(\u0026adapter-\u003eports.ports);\n+\tspin_lock_init(\u0026adapter-\u003eports.lock);\n+\tINIT_LIST_HEAD(\u0026adapter-\u003eports.list);\n \n \treturn adapter;\n }\n \n static void ice_adapter_free(struct ice_adapter *adapter)\n {\n-\tWARN_ON(!list_empty(\u0026adapter-\u003eports.ports));\n+\tWARN_ON(!list_empty(\u0026adapter-\u003eports.list));\n \tfor (int i = 0; i \u003c ARRAY_SIZE(adapter-\u003ecpi_phy_lock); i++)\n \t\tmutex_destroy(\u0026adapter-\u003ecpi_phy_lock[i]);\n-\tmutex_destroy(\u0026adapter-\u003eports.lock);\n \n \tkfree(adapter);\n }\ndiff --git a/drivers/net/ethernet/intel/ice/ice_adapter.h b/drivers/net/ethernet/intel/ice/ice_adapter.h\nindex 4f695f32da3d8..39923dedd534e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_adapter.h\n+++ b/drivers/net/ethernet/intel/ice/ice_adapter.h\n@@ -19,13 +19,13 @@ struct ice_pf;\n  *\n  * This structure contains data used to maintain a list of adapter ports\n  *\n- * @ports: list of ports\n+ * @list: list of ports\n  * @lock: protect access to the ports list\n  */\n struct ice_port_list {\n-\tstruct list_head ports;\n+\tstruct list_head list;\n \t/* To synchronize the ports list operations */\n-\tstruct mutex lock;\n+\tspinlock_t lock;\n };\n \n /**\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex d88835482d3aa..c84d63b8d261e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -3248,7 +3248,7 @@ static irqreturn_t ice_misc_intr_thread_fn(int __always_unused irq, void *data)\n \tice_irq_dynamic_ena(hw, NULL, NULL);\n \tice_flush(hw);\n \n-\tif (ice_ptp_tx_tstamps_pending(pf)) {\n+\tif (ice_ptp_tx_tstamps_pending(pf, true)) {\n \t\t/* If any new Tx timestamps happened while in interrupt,\n \t\t * re-arm the interrupt to trigger it again.\n \t\t */\n@@ -6745,7 +6745,6 @@ static int ice_up_complete(struct ice_vsi *vsi)\n \t\tice_print_link_msg(vsi, true);\n \t\tnetif_tx_start_all_queues(vsi-\u003enetdev);\n \t\tnetif_carrier_on(vsi-\u003enetdev);\n-\t\tice_ptp_link_change(pf, true);\n \t}\n \n \t/* Perform an initial read of the statistics registers now to\n@@ -7273,7 +7272,6 @@ int ice_down(struct ice_vsi *vsi)\n \n \tif (vsi-\u003enetdev) {\n \t\tvlan_err = ice_vsi_del_vlan_zero(vsi);\n-\t\tice_ptp_link_change(vsi-\u003eback, false);\n \t\tnetif_carrier_off(vsi-\u003enetdev);\n \t\tnetif_tx_disable(vsi-\u003enetdev);\n \t}\n@@ -7794,6 +7792,15 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)\n \n \tice_update_pf_netdev_link(pf);\n \n+\tif (test_bit(ICE_FLAG_PTP_SUPPORTED, pf-\u003eflags) \u0026\u0026 pf-\u003ehw.port_info) {\n+\t\tbool link_up;\n+\n+\t\tlink_up = !!(pf-\u003ehw.port_info-\u003ephy.link_info.link_info \u0026\n+\t\t\t     ICE_AQ_LINK_UP);\n+\t\tif (pf-\u003eptp.port.link_up != link_up)\n+\t\t\tice_ptp_link_change(pf, link_up);\n+\t}\n+\n \t/* tell the firmware we are up */\n \terr = ice_send_version(pf);\n \tif (err) {\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c\nindex eaec36ab6ae3f..0e44ed6b0ae8e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ptp.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c\n@@ -1,6 +1,8 @@\n // SPDX-License-Identifier: GPL-2.0\n /* Copyright (C) 2021, Intel Corporation. */\n \n+#include \u003clinux/rculist.h\u003e\n+#include \u003clinux/wait_bit.h\u003e\n #include \"ice.h\"\n #include \"ice_lib.h\"\n #include \"ice_trace.h\"\n@@ -362,9 +364,12 @@ static u64 ice_ptp_extend_40b_ts(struct ice_pf *pf, u64 in_tstamp)\n static bool\n ice_ptp_is_tx_tracker_up(struct ice_ptp_tx *tx)\n {\n+\tstruct ice_ptp_port *ptp_port =\n+\t\tcontainer_of(tx, struct ice_ptp_port, tx);\n+\n \tlockdep_assert_held(\u0026tx-\u003elock);\n \n-\treturn tx-\u003einit \u0026\u0026 !tx-\u003ecalibrating;\n+\treturn tx-\u003einit \u0026\u0026 !tx-\u003ecalibrating \u0026\u0026 ptp_port-\u003elink_up;\n }\n \n /**\n@@ -561,7 +566,6 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)\n \tstruct ice_pf *pf;\n \tstruct ice_hw *hw;\n \tu64 tstamp_ready;\n-\tbool link_up;\n \tint err;\n \tu8 idx;\n \n@@ -569,7 +573,7 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)\n \tpf = ptp_port_to_pf(ptp_port);\n \thw = \u0026pf-\u003ehw;\n \n-\tif (!tx-\u003einit)\n+\tif (!tx-\u003einit || bitmap_empty(tx-\u003ein_use, tx-\u003elen))\n \t\treturn;\n \n \t/* Read the Tx ready status first */\n@@ -579,14 +583,11 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)\n \t\t\treturn;\n \t}\n \n-\t/* Drop packets if the link went down */\n-\tlink_up = ptp_port-\u003elink_up;\n-\n \tfor_each_set_bit(idx, tx-\u003ein_use, tx-\u003elen) {\n \t\tstruct skb_shared_hwtstamps shhwtstamps = {};\n \t\tu8 phy_idx = idx + tx-\u003eoffset;\n \t\tu64 raw_tstamp = 0, tstamp;\n-\t\tbool drop_ts = !link_up;\n+\t\tbool drop_ts = false;\n \t\tstruct sk_buff *skb;\n \n \t\t/* Drop packets which have waited for more than 2 seconds */\n@@ -619,6 +620,22 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)\n \t\tif (err \u0026\u0026 !drop_ts)\n \t\t\tcontinue;\n \n+\t\t/* verify ready bit cleared */\n+\t\tif (tx-\u003ehas_ready_bitmap) {\n+\t\t\terr = ice_get_phy_tx_tstamp_ready(hw, tx-\u003eblock, \u0026tstamp_ready);\n+\t\t\tif (err)\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (tstamp_ready \u0026 BIT_ULL(phy_idx)) {\n+\t\t\t\tspin_lock_irqsave(\u0026tx-\u003elock, flags);\n+\t\t\t\tif (!test_and_set_bit(idx, tx-\u003estale))\n+\t\t\t\t\tdev_dbg(ice_pf_to_dev(pf), \"PHY port %u failed to clear ready bit for idx %u\\n\",\n+\t\t\t\t\t\tptp_port-\u003eport_num, phy_idx);\n+\t\t\t\tspin_unlock_irqrestore(\u0026tx-\u003elock, flags);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n+\n \t\tice_trace(tx_tstamp_fw_done, tx-\u003etstamps[idx].skb, idx);\n \n \t\t/* For PHYs which don't implement a proper timestamp ready\n@@ -673,20 +690,33 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)\n \tpf-\u003eptp.tx_hwtstamp_good += tstamp_good;\n }\n \n+static void ice_ptp_release_port_rcu(struct kref *ref)\n+{\n+\twake_up_var(ref);\n+}\n+\n static void ice_ptp_tx_tstamp_owner(struct ice_pf *pf)\n {\n \tstruct ice_ptp_port *port;\n \n-\tmutex_lock(\u0026pf-\u003eadapter-\u003eports.lock);\n-\tlist_for_each_entry(port, \u0026pf-\u003eadapter-\u003eports.ports, list_node) {\n+\trcu_read_lock();\n+\tlist_for_each_entry_rcu(port, \u0026pf-\u003eadapter-\u003eports.list, list_node) {\n \t\tstruct ice_ptp_tx *tx = \u0026port-\u003etx;\n \n-\t\tif (!tx || !tx-\u003einit)\n+\t\tif (!tx-\u003einit)\n \t\t\tcontinue;\n \n+\t\tif (!kref_get_unless_zero(\u0026port-\u003eref))\n+\t\t\tcontinue;\n+\n+\t\trcu_read_unlock();\n+\n \t\tice_ptp_process_tx_tstamp(tx);\n+\n+\t\tkref_put(\u0026port-\u003eref, ice_ptp_release_port_rcu);\n+\t\trcu_read_lock();\n \t}\n-\tmutex_unlock(\u0026pf-\u003eadapter-\u003eports.lock);\n+\trcu_read_unlock();\n }\n \n /**\n@@ -725,6 +755,37 @@ ice_ptp_alloc_tx_tracker(struct ice_ptp_tx *tx)\n \treturn 0;\n }\n \n+static void\n+ice_ptp_wait_for_tracker_drain(struct ice_pf *pf, struct ice_ptp_tx *tx)\n+{\n+\tunsigned long deadline = jiffies + msecs_to_jiffies(10);\n+\tstruct ice_hw *hw = \u0026pf-\u003ehw;\n+\tu64 tstamp_ready;\n+\tbool pending;\n+\tu8 idx;\n+\n+\tif (hw-\u003ereset_ongoing)\n+\t\treturn;\n+\n+\tdo {\n+\t\tif (ice_get_phy_tx_tstamp_ready(hw, tx-\u003eblock, \u0026tstamp_ready))\n+\t\t\treturn;\n+\n+\t\tpending = false;\n+\t\tfor_each_set_bit(idx, tx-\u003ein_use, tx-\u003elen) {\n+\t\t\tif (!(tstamp_ready \u0026 BIT_ULL(idx + tx-\u003eoffset)))\n+\t\t\t\tpending = true;\n+\t\t}\n+\t\tif (!pending)\n+\t\t\treturn;\n+\n+\t\tusleep_range(500, 1000);\n+\t} while (time_before(jiffies, deadline));\n+\n+\tdev_dbg(ice_pf_to_dev(pf), \"Timed out waiting for in-flight Tx timestamps on block %u\\n\",\n+\t\ttx-\u003eblock);\n+}\n+\n /**\n  * ice_ptp_flush_tx_tracker - Flush any remaining timestamps from the tracker\n  * @pf: Board private structure\n@@ -741,6 +802,8 @@ ice_ptp_flush_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx)\n \tint err;\n \tu8 idx;\n \n+\tice_ptp_wait_for_tracker_drain(pf, tx);\n+\n \terr = ice_get_phy_tx_tstamp_ready(hw, tx-\u003eblock, \u0026tstamp_ready);\n \tif (err) {\n \t\tdev_dbg(ice_pf_to_dev(pf), \"Failed to get the Tx tstamp ready bitmap for block %u, err %d\\n\",\n@@ -779,12 +842,10 @@ ice_ptp_flush_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx)\n  * ice_ptp_mark_tx_tracker_stale - Mark unfinished timestamps as stale\n  * @tx: the tracker to mark\n  *\n- * Mark currently outstanding Tx timestamps as stale. This prevents sending\n- * their timestamp value to the stack. This is required to prevent extending\n- * the 40bit hardware timestamp incorrectly.\n- *\n- * This should be called when the PTP clock is modified such as after a set\n- * time request.\n+ * Mark currently outstanding Tx timestamps as stale. This prevents the driver\n+ * from reporting the timestamp to the stack. This is called to inform the\n+ * driver that a timestamp is expected to fail if it was initiated as the link\n+ * went down.\n  */\n static void\n ice_ptp_mark_tx_tracker_stale(struct ice_ptp_tx *tx)\n@@ -808,8 +869,16 @@ ice_ptp_flush_all_tx_tracker(struct ice_pf *pf)\n {\n \tstruct ice_ptp_port *port;\n \n-\tlist_for_each_entry(port, \u0026pf-\u003eadapter-\u003eports.ports, list_node)\n+\trcu_read_lock();\n+\tlist_for_each_entry_rcu(port, \u0026pf-\u003eadapter-\u003eports.list, list_node) {\n+\t\tif (!kref_get_unless_zero(\u0026port-\u003eref))\n+\t\t\tcontinue;\n+\t\trcu_read_unlock();\n \t\tice_ptp_flush_tx_tracker(ptp_port_to_pf(port), \u0026port-\u003etx);\n+\t\tkref_put(\u0026port-\u003eref, ice_ptp_release_port_rcu);\n+\t\trcu_read_lock();\n+\t}\n+\trcu_read_unlock();\n }\n \n /**\n@@ -994,13 +1063,6 @@ static void ice_ptp_reset_cached_phctime(struct ice_pf *pf)\n \t\tkthread_queue_delayed_work(pf-\u003eptp.kworker, \u0026pf-\u003eptp.work,\n \t\t\t\t\t   msecs_to_jiffies(10));\n \t}\n-\n-\t/* Mark any outstanding timestamps as stale, since they might have\n-\t * been captured in hardware before the time update. This could lead\n-\t * to us extending them with the wrong cached value resulting in\n-\t * incorrect timestamp values.\n-\t */\n-\tice_ptp_mark_tx_tracker_stale(\u0026pf-\u003eptp.port.tx);\n }\n \n /**\n@@ -1133,6 +1195,7 @@ static int ice_ptp_check_tx_fifo(struct ice_ptp_port *port)\n static void ice_ptp_wait_for_offsets(struct kthread_work *work)\n {\n \tstruct ice_ptp_port *port;\n+\tunsigned long flags;\n \tstruct ice_pf *pf;\n \tstruct ice_hw *hw;\n \tint tx_err;\n@@ -1155,12 +1218,28 @@ static void ice_ptp_wait_for_offsets(struct kthread_work *work)\n \t\ttx_err = ice_phy_cfg_tx_offset_e82x(hw, port-\u003eport_num);\n \trx_err = ice_phy_cfg_rx_offset_e82x(hw, port-\u003eport_num);\n \tif (tx_err || rx_err) {\n-\t\t/* Tx and/or Rx offset not yet configured, try again later */\n+\t\t/* Tx and/or Rx offset not yet configured, try again later.\n+\t\t * This is expected during normal link-up: the vernier offset\n+\t\t * calibration cannot complete until at least one packet has\n+\t\t * been transmitted, so the first retries routinely land here.\n+\t\t */\n+\t\tdev_dbg(ice_pf_to_dev(pf),\n+\t\t\t\"PTP offset not yet valid for port %u (tx_err=%d rx_err=%d)\\n\",\n+\t\t\tport-\u003eport_num, tx_err, rx_err);\n \t\tkthread_queue_delayed_work(pf-\u003eptp.kworker,\n \t\t\t\t\t   \u0026port-\u003eov_work,\n \t\t\t\t\t   msecs_to_jiffies(100));\n \t\treturn;\n \t}\n+\n+\t/* Tx and Rx offsets are now configured, enable Tx timestamps */\n+\tspin_lock_irqsave(\u0026port-\u003etx.lock, flags);\n+\tport-\u003etx.calibrating = false;\n+\tspin_unlock_irqrestore(\u0026port-\u003etx.lock, flags);\n+\n+\tdev_dbg(ice_pf_to_dev(pf),\n+\t\t\"PTP offset valid for port %u, Tx timestamps enabled\\n\",\n+\t\tport-\u003eport_num);\n }\n \n /**\n@@ -1243,13 +1322,20 @@ ice_ptp_port_phy_restart(struct ice_ptp_port *ptp_port)\n \n \t\t/* Start the PHY timer in Vernier mode */\n \t\terr = ice_start_phy_timer_e82x(hw, port);\n-\t\tif (err)\n+\t\tif (err) {\n+\t\t\tspin_lock_irqsave(\u0026ptp_port-\u003etx.lock, flags);\n+\t\t\tptp_port-\u003etx.calibrating = false;\n+\t\t\tspin_unlock_irqrestore(\u0026ptp_port-\u003etx.lock, flags);\n \t\t\tbreak;\n+\t\t}\n \n-\t\t/* Enable Tx timestamps right away */\n-\t\tspin_lock_irqsave(\u0026ptp_port-\u003etx.lock, flags);\n-\t\tptp_port-\u003etx.calibrating = false;\n-\t\tspin_unlock_irqrestore(\u0026ptp_port-\u003etx.lock, flags);\n+\t\t/* Do not clear calibrating flag here. Tx timestamps remain\n+\t\t * disabled until ice_ptp_wait_for_offsets() has verified\n+\t\t * that the Tx and Rx offset calibration has completed.\n+\t\t * Clearing it here would allow Tx timestamps to be reported\n+\t\t * before the PHY offset registers are configured, leading\n+\t\t * to incorrect timestamp values.\n+\t\t */\n \n \t\tkthread_queue_delayed_work(pf-\u003eptp.kworker, \u0026ptp_port-\u003eov_work,\n \t\t\t\t\t   0);\n@@ -1280,18 +1366,21 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)\n \tstruct ice_ptp_port *ptp_port;\n \tstruct ice_hw *hw = \u0026pf-\u003ehw;\n \n-\tif (pf-\u003eptp.state != ICE_PTP_READY)\n-\t\treturn;\n-\n \tptp_port = \u0026pf-\u003eptp.port;\n \n \t/* Update cached link status for this port immediately */\n \tptp_port-\u003elink_up = linkup;\n \n+\tif (pf-\u003eptp.state != ICE_PTP_READY)\n+\t\treturn;\n+\n \t/* Skip HW writes if reset is in progress */\n \tif (pf-\u003ehw.reset_ongoing)\n \t\treturn;\n \n+\tif (!linkup)\n+\t\tice_ptp_mark_tx_tracker_stale(\u0026ptp_port-\u003etx);\n+\n \tif (hw-\u003emac_type == ICE_MAC_GENERIC_3K_E825 \u0026\u0026\n \t    test_bit(ICE_FLAG_DPLL, pf-\u003eflags)) {\n \t\tint pin, err;\n@@ -1424,16 +1513,21 @@ static void ice_ptp_reset_phy_timestamping(struct ice_pf *pf)\n  */\n static void ice_ptp_restart_all_phy(struct ice_pf *pf)\n {\n-\tstruct list_head *entry;\n+\tstruct ice_ptp_port *port;\n \n-\tlist_for_each(entry, \u0026pf-\u003eadapter-\u003eports.ports) {\n-\t\tstruct ice_ptp_port *port = list_entry(entry,\n-\t\t\t\t\t\t       struct ice_ptp_port,\n-\t\t\t\t\t\t       list_node);\n+\trcu_read_lock();\n+\tlist_for_each_entry_rcu(port, \u0026pf-\u003eadapter-\u003eports.list, list_node) {\n+\t\tif (!kref_get_unless_zero(\u0026port-\u003eref))\n+\t\t\tcontinue;\n+\t\trcu_read_unlock();\n \n \t\tif (port-\u003elink_up)\n \t\t\tice_ptp_port_phy_restart(port);\n+\n+\t\tkref_put(\u0026port-\u003eref, ice_ptp_release_port_rcu);\n+\t\trcu_read_lock();\n \t}\n+\trcu_read_unlock();\n }\n \n /**\n@@ -2678,74 +2772,56 @@ void ice_ptp_process_ts(struct ice_pf *pf)\n \t}\n }\n \n-static bool ice_port_has_timestamps(struct ice_ptp_tx *tx)\n+static bool ice_port_has_timestamps(struct ice_ptp_tx *tx, bool in_irq)\n {\n-\tbool more_timestamps;\n+\tDECLARE_BITMAP(tstamps, INDEX_PER_PORT_MAX) = {};\n \n \tscoped_guard(spinlock_irqsave, \u0026tx-\u003elock) {\n \t\tif (!tx-\u003einit)\n \t\t\treturn false;\n \n-\t\tmore_timestamps = !bitmap_empty(tx-\u003ein_use, tx-\u003elen);\n-\t}\n+\t\tif (in_irq) {\n+\t\t\tif (!ice_ptp_is_tx_tracker_up(tx))\n+\t\t\t\treturn false;\n \n-\treturn more_timestamps;\n+\t\t\treturn bitmap_andnot(tstamps, tx-\u003ein_use, tx-\u003estale, tx-\u003elen);\n+\t\t} else {\n+\t\t\treturn !bitmap_empty(tx-\u003ein_use, tx-\u003elen);\n+\t\t}\n+\t}\n }\n \n-static bool ice_any_port_has_timestamps(struct ice_pf *pf)\n+static bool ice_any_port_has_timestamps(struct ice_pf *pf, bool in_irq)\n {\n+\tbool have_tstamps = false;\n \tstruct ice_ptp_port *port;\n \n-\tscoped_guard(mutex, \u0026pf-\u003eadapter-\u003eports.lock) {\n-\t\tlist_for_each_entry(port, \u0026pf-\u003eadapter-\u003eports.ports,\n-\t\t\t\t    list_node) {\n-\t\t\tstruct ice_ptp_tx *tx = \u0026port-\u003etx;\n-\n-\t\t\tif (ice_port_has_timestamps(tx))\n-\t\t\t\treturn true;\n+\trcu_read_lock();\n+\tlist_for_each_entry_rcu(port, \u0026pf-\u003eadapter-\u003eports.list, list_node) {\n+\t\tif (ice_port_has_timestamps(\u0026port-\u003etx, in_irq)) {\n+\t\t\thave_tstamps = true;\n+\t\t\tbreak;\n \t\t}\n \t}\n+\trcu_read_unlock();\n \n-\treturn false;\n+\treturn have_tstamps;\n }\n \n-bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf)\n+bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf, bool in_irq)\n {\n-\tstruct ice_hw *hw = \u0026pf-\u003ehw;\n-\tint ret;\n-\n-\t/* Check software indicator */\n \tswitch (pf-\u003eptp.tx_interrupt_mode) {\n \tcase ICE_PTP_TX_INTERRUPT_NONE:\n \t\treturn false;\n \tcase ICE_PTP_TX_INTERRUPT_SELF:\n-\t\tif (ice_port_has_timestamps(\u0026pf-\u003eptp.port.tx))\n-\t\t\treturn true;\n-\t\tbreak;\n+\t\treturn ice_port_has_timestamps(\u0026pf-\u003eptp.port.tx, in_irq);\n \tcase ICE_PTP_TX_INTERRUPT_ALL:\n-\t\tif (ice_any_port_has_timestamps(pf))\n-\t\t\treturn true;\n-\t\tbreak;\n+\t\treturn ice_any_port_has_timestamps(pf, in_irq);\n \tdefault:\n \t\tWARN_ONCE(1, \"Unexpected Tx timestamp interrupt mode %u\\n\",\n \t\t\t  pf-\u003eptp.tx_interrupt_mode);\n-\t\tbreak;\n-\t}\n-\n-\t/* Check hardware indicator */\n-\tret = ice_check_phy_tx_tstamp_ready(hw);\n-\tif (ret \u003c 0) {\n-\t\tdev_dbg(ice_pf_to_dev(pf), \"Unable to read PHY Tx timestamp ready bitmap, err %d\\n\",\n-\t\t\tret);\n-\t\t/* Stop triggering IRQs if we're unable to read PHY */\n \t\treturn false;\n \t}\n-\n-\t/* ice_check_phy_tx_tstamp_ready() returns 1 if there are timestamps\n-\t * available, 0 if there are no waiting timestamps, and a negative\n-\t * value if there was an error (which we checked for above).\n-\t */\n-\treturn ret \u003e 0;\n }\n \n /**\n@@ -2799,7 +2875,7 @@ irqreturn_t ice_ptp_ts_irq(struct ice_pf *pf)\n \t\t/* E830 can read timestamps in the top half using rd32() */\n \t\tice_ptp_process_ts(pf);\n \n-\t\tif (ice_ptp_tx_tstamps_pending(pf)) {\n+\t\tif (ice_ptp_tx_tstamps_pending(pf, true)) {\n \t\t\t/* Process outstanding Tx timestamps. If there\n \t\t\t * is more work, re-arm the interrupt to trigger again.\n \t\t\t */\n@@ -2829,7 +2905,6 @@ static void ice_ptp_maybe_trigger_tx_interrupt(struct ice_pf *pf)\n {\n \tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = \u0026pf-\u003ehw;\n-\tint ret;\n \n \tif (!pf-\u003eptp.port.tx.has_ready_bitmap)\n \t\treturn;\n@@ -2837,11 +2912,8 @@ static void ice_ptp_maybe_trigger_tx_interrupt(struct ice_pf *pf)\n \tif (!ice_pf_src_tmr_owned(pf))\n \t\treturn;\n \n-\tret = ice_check_phy_tx_tstamp_ready(hw);\n-\tif (ret \u003c 0) {\n-\t\tdev_dbg(dev, \"PTP periodic task unable to read PHY timestamp ready bitmap, err %d\\n\",\n-\t\t\tret);\n-\t} else if (ret) {\n+\tif (ice_ptp_tx_tstamps_pending(pf, false) ||\n+\t    ice_check_phy_tx_tstamp_ready(hw)) {\n \t\tdev_dbg(dev, \"PTP periodic task detected waiting timestamps. Triggering Tx timestamp interrupt now.\\n\");\n \n \t\twr32(hw, PFINT_OICR, PFINT_OICR_TSYN_TX_M);\n@@ -2890,14 +2962,16 @@ void ice_ptp_queue_work(struct ice_pf *pf)\n static void ice_ptp_prepare_rebuild_sec(struct ice_pf *pf, bool rebuild,\n \t\t\t\t\tenum ice_reset_req reset_type)\n {\n-\tstruct list_head *entry;\n+\tstruct ice_ptp_port *port;\n \n-\tlist_for_each(entry, \u0026pf-\u003eadapter-\u003eports.ports) {\n-\t\tstruct ice_ptp_port *port = list_entry(entry,\n-\t\t\t\t\t\t       struct ice_ptp_port,\n-\t\t\t\t\t\t       list_node);\n+\trcu_read_lock();\n+\tlist_for_each_entry_rcu(port, \u0026pf-\u003eadapter-\u003eports.list, list_node) {\n \t\tstruct ice_pf *peer_pf = ptp_port_to_pf(port);\n \n+\t\tif (!kref_get_unless_zero(\u0026port-\u003eref))\n+\t\t\tcontinue;\n+\t\trcu_read_unlock();\n+\n \t\tif (!ice_is_primary(\u0026peer_pf-\u003ehw)) {\n \t\t\tif (rebuild) {\n \t\t\t\t/* TODO: When implementing rebuild=true:\n@@ -2909,7 +2983,11 @@ static void ice_ptp_prepare_rebuild_sec(struct ice_pf *pf, bool rebuild,\n \t\t\t\tice_ptp_prepare_for_reset(peer_pf, reset_type);\n \t\t\t}\n \t\t}\n+\n+\t\tkref_put(\u0026port-\u003eref, ice_ptp_release_port_rcu);\n+\t\trcu_read_lock();\n \t}\n+\trcu_read_unlock();\n }\n \n /**\n@@ -2936,6 +3014,14 @@ void ice_ptp_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type)\n \tif (reset_type == ICE_RESET_PFR)\n \t\treturn;\n \n+\t/* Cancel the offset verification work for E82x before releasing the\n+\t * Tx tracker. If ov_work is running during reset, it may issue\n+\t * sideband queue commands that will fail or timeout, and may\n+\t * reference state that is being torn down.\n+\t */\n+\tif (hw-\u003emac_type == ICE_MAC_GENERIC)\n+\t\tkthread_cancel_delayed_work_sync(\u0026ptp-\u003eport.ov_work);\n+\n \tif (ice_pf_src_tmr_owned(pf) \u0026\u0026 hw-\u003emac_type == ICE_MAC_GENERIC_3K_E825)\n \t\tice_ptp_prepare_rebuild_sec(pf, false, reset_type);\n \n@@ -3086,11 +3172,11 @@ static int ice_ptp_setup_pf(struct ice_pf *pf)\n \t\treturn -ENODEV;\n \n \tINIT_LIST_HEAD(\u0026ptp-\u003eport.list_node);\n-\tmutex_lock(\u0026pf-\u003eadapter-\u003eports.lock);\n+\tkref_init(\u0026ptp-\u003eport.ref);\n \n-\tlist_add(\u0026ptp-\u003eport.list_node,\n-\t\t \u0026pf-\u003eadapter-\u003eports.ports);\n-\tmutex_unlock(\u0026pf-\u003eadapter-\u003eports.lock);\n+\tspin_lock(\u0026pf-\u003eadapter-\u003eports.lock);\n+\tlist_add_rcu(\u0026ptp-\u003eport.list_node, \u0026pf-\u003eadapter-\u003eports.list);\n+\tspin_unlock(\u0026pf-\u003eadapter-\u003eports.lock);\n \n \t/* Seed the per-PHY Tx reference clock usage map for this port.\n \t * Only meaningful on E825 (other MAC types don't expose tx-clk\n@@ -3113,12 +3199,32 @@ static int ice_ptp_setup_pf(struct ice_pf *pf)\n static void ice_ptp_cleanup_pf(struct ice_pf *pf)\n {\n \tstruct ice_ptp *ptp = \u0026pf-\u003eptp;\n+\tstruct kref *ref;\n \n-\tif (pf-\u003ehw.mac_type != ICE_MAC_UNKNOWN) {\n-\t\tmutex_lock(\u0026pf-\u003eadapter-\u003eports.lock);\n-\t\tlist_del(\u0026ptp-\u003eport.list_node);\n-\t\tmutex_unlock(\u0026pf-\u003eadapter-\u003eports.lock);\n-\t}\n+\tif (pf-\u003ehw.mac_type == ICE_MAC_UNKNOWN)\n+\t\treturn;\n+\n+\t/* The PF cannot be removed until there are no more remaining\n+\t * outstanding references to the PTP port. To make sure this is true,\n+\t * first remove the port from the list, then drop the primary\n+\t * reference this PF holds on the port. Once done, wait until all\n+\t * existing references are dropped. Finally, synchronize_rcu() to\n+\t * ensure that all RCU critical sections that might attempt to\n+\t * dereference the port are finished.\n+\t */\n+\n+\tspin_lock(\u0026pf-\u003eadapter-\u003eports.lock);\n+\tlist_del_rcu(\u0026ptp-\u003eport.list_node);\n+\tspin_unlock(\u0026pf-\u003eadapter-\u003eports.lock);\n+\n+\tref = \u0026ptp-\u003eport.ref;\n+\tkref_put(ref, ice_ptp_release_port_rcu);\n+\n+\tdev_WARN_ONCE(ice_pf_to_dev(pf),\n+\t\t      !wait_var_event_timeout(ref, !kref_read(ref), 15 * HZ),\n+\t\t      \"Timed out waiting for port references to release. Continuing to unload anyways.\");\n+\n+\tsynchronize_rcu();\n }\n \n /**\n@@ -3210,9 +3316,13 @@ static int ice_ptp_init_owner(struct ice_pf *pf)\n }\n \n /**\n- * ice_ptp_init_work - Initialize PTP work threads\n+ * ice_ptp_init_work - Initialize the PTP kworker\n  * @pf: Board private structure\n  * @ptp: PF PTP structure\n+ *\n+ * Allocate the kworker and initialize the periodic work function. The\n+ * periodic work is not queued here; the caller starts it once the PTP\n+ * state is ICE_PTP_READY.\n  */\n static int ice_ptp_init_work(struct ice_pf *pf, struct ice_ptp *ptp)\n {\n@@ -3231,9 +3341,6 @@ static int ice_ptp_init_work(struct ice_pf *pf, struct ice_ptp *ptp)\n \n \tptp-\u003ekworker = kworker;\n \n-\t/* Start periodic work going */\n-\tkthread_queue_delayed_work(ptp-\u003ekworker, \u0026ptp-\u003ework, 0);\n-\n \treturn 0;\n }\n \n@@ -3355,6 +3462,22 @@ void ice_ptp_init(struct ice_pf *pf)\n \tif (err)\n \t\tgoto err_clean_pf;\n \n+\t/* Seed link_up from current PHY status, since link may already be up\n+\t * (e.g. after PXE boot) with no link-change edge to catch it later.\n+\t */\n+\tif (pf-\u003ehw.port_info)\n+\t\tptp-\u003eport.link_up =\n+\t\t\t!!(pf-\u003ehw.port_info-\u003ephy.link_info.link_info \u0026\n+\t\t\tICE_AQ_LINK_UP);\n+\n+\t/* Create the kworker before restarting the PHY, which queues work on\n+\t * it in the E82x restart path. This prevents concurrent link events\n+\t * from reaching ice_ptp_port_phy_restart() while kworker is still NULL\n+\t */\n+\terr = ice_ptp_init_work(pf, ptp);\n+\tif (err)\n+\t\tgoto err_exit;\n+\n \t/* Start the PHY timestamping block */\n \tice_ptp_reset_phy_timestamping(pf);\n \n@@ -3363,9 +3486,10 @@ void ice_ptp_init(struct ice_pf *pf)\n \n \tptp-\u003estate = ICE_PTP_READY;\n \n-\terr = ice_ptp_init_work(pf, ptp);\n-\tif (err)\n-\t\tgoto err_exit;\n+\t/* Start periodic work only after the state is READY; the worker\n+\t * returns without rescheduling while the state is not READY.\n+\t */\n+\tkthread_queue_delayed_work(ptp-\u003ekworker, \u0026ptp-\u003ework, 0);\n \n \tdev_info(ice_pf_to_dev(pf), \"PTP init successful\\n\");\n \treturn;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h\nindex c4b0da7ce20ed..13158a9319fb8 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ptp.h\n+++ b/drivers/net/ethernet/intel/ice/ice_ptp.h\n@@ -5,6 +5,8 @@\n #define _ICE_PTP_H_\n \n #include \u003clinux/ptp_clock_kernel.h\u003e\n+#include \u003clinux/rculist.h\u003e\n+#include \u003clinux/kref.h\u003e\n #include \u003clinux/kthread.h\u003e\n \n #include \"ice_ptp_hw.h\"\n@@ -130,6 +132,9 @@ struct ice_ptp_tx {\n #define INDEX_PER_PORT_E82X\t\t16\n #define INDEX_PER_PORT\t\t\t64\n \n+/* Maximum number of timestamp indexes across all devices */\n+#define INDEX_PER_PORT_MAX              INDEX_PER_PORT\n+\n /**\n  * struct ice_ptp_port - data used to initialize an external port for PTP\n  *\n@@ -138,6 +143,7 @@ struct ice_ptp_tx {\n  * and determine when the port's PHY offset is valid.\n  *\n  * @list_node: list member structure\n+ * @ref: reference counter for use with adapter ports list\n  * @tx: Tx timestamp tracking for this port\n  * @ov_work: delayed work task for tracking when PHY offset is valid\n  * @ps_lock: mutex used to protect the overall PTP PHY start procedure\n@@ -149,6 +155,7 @@ struct ice_ptp_tx {\n  */\n struct ice_ptp_port {\n \tstruct list_head list_node;\n+\tstruct kref ref;\n \tstruct ice_ptp_tx tx;\n \tstruct kthread_delayed_work ov_work;\n \tstruct mutex ps_lock; /* protects overall PTP PHY start procedure */\n@@ -312,7 +319,7 @@ void ice_ptp_req_tx_single_tstamp(struct ice_ptp_tx *tx, u8 idx);\n void ice_ptp_complete_tx_single_tstamp(struct ice_ptp_tx *tx);\n void ice_ptp_process_ts(struct ice_pf *pf);\n irqreturn_t ice_ptp_ts_irq(struct ice_pf *pf);\n-bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf);\n+bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf, bool in_irq);\n u64 ice_ptp_read_src_clk_reg(struct ice_pf *pf,\n \t\t\t     struct ptp_system_timestamp *sts);\n \n@@ -360,7 +367,8 @@ static inline irqreturn_t ice_ptp_ts_irq(struct ice_pf *pf)\n \treturn IRQ_HANDLED;\n }\n \n-static inline bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf)\n+static inline bool\n+ice_ptp_tx_tstamps_pending(struct ice_pf *pf, bool in_irq)\n {\n \treturn false;\n }\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c\nindex 3a41c711e751b..10e973876608e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c\n@@ -737,24 +737,6 @@ static int ice_read_port_mem_eth56g(struct ice_hw *hw, u8 port, u16 offset,\n \treturn ice_read_port_eth56g(hw, port, offset, val, ETH56G_PHY_MEM_PTP);\n }\n \n-/**\n- * ice_write_port_mem_eth56g - Write a PHY port memory location\n- * @hw: pointer to the HW struct\n- * @port: Port number to be read\n- * @offset: Offset from PHY port register base\n- * @val: Pointer to the value to read (out param)\n- *\n- * Return:\n- * * %0      - success\n- * * %EINVAL - invalid port number or resource type\n- * * %other  - failed to write to PHY\n- */\n-static int ice_write_port_mem_eth56g(struct ice_hw *hw, u8 port, u16 offset,\n-\t\t\t\t     u32 val)\n-{\n-\treturn ice_write_port_eth56g(hw, port, offset, val, ETH56G_PHY_MEM_PTP);\n-}\n-\n /**\n  * ice_write_quad_ptp_reg_eth56g - Write a PHY quad register\n  * @hw: pointer to the HW struct\n@@ -1139,8 +1121,8 @@ static int ice_read_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx,\n  * internal PHYs of the 56G devices.\n  *\n  * To directly clear the contents of the timestamp block entirely, discarding\n- * all timestamp data at once, software should instead use\n- * ice_ptp_reset_ts_memory_quad_eth56g().\n+ * all timestamp data at once, software should instead perform a PHY soft\n+ * reset via ice_ptp_phy_soft_reset_eth56g().\n  *\n  * This function should only be called on an idx whose bit is set according to\n  * ice_get_phy_tx_tstamp_ready().\n@@ -1152,11 +1134,11 @@ static int ice_read_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx,\n static int ice_clear_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx)\n {\n \tu64 unused_tstamp;\n-\tu16 lo_addr;\n \tint err;\n \n-\t/* Read the timestamp register to ensure the timestamp status bit is\n-\t * cleared.\n+\t/* Per the PHY spec, reading the timestamp memory location is what\n+\t * clears the entry's valid bit and its corresponding (read-only)\n+\t * ts_memory_status bit.\n \t */\n \terr = ice_read_ptp_tstamp_eth56g(hw, port, idx, \u0026unused_tstamp);\n \tif (err) {\n@@ -1164,32 +1146,40 @@ static int ice_clear_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx)\n \t\t\t  port, idx, err);\n \t}\n \n-\tlo_addr = (u16)PHY_TSTAMP_L(idx);\n-\n-\terr = ice_write_port_mem_eth56g(hw, port, lo_addr, 0);\n-\tif (err) {\n-\t\tice_debug(hw, ICE_DBG_PTP, \"Failed to clear low PTP timestamp register for port %u, idx %u, err %d\\n\",\n-\t\t\t  port, idx, err);\n-\t\treturn err;\n-\t}\n-\n \treturn 0;\n }\n \n /**\n- * ice_ptp_reset_ts_memory_eth56g - Clear all timestamps from the port block\n+ * ice_ptp_clear_tx_memory_status_eth56g - Reset one port's Tx timestamp memory\n  * @hw: pointer to the HW struct\n+ * @port: port number to clear\n+ *\n+ * Fully reset a single PHY port's Tx timestamp memory. Per the PHY spec, the\n+ * only way to clear a timestamp valid bit (and its read-only ts_memory_status\n+ * bit) is to read the timestamp memory location, so read every entry for the\n+ * port (two 32-bit reads each). This discards all timestamp data on the port,\n+ * so it must only be used for a full reset; callers that must preserve\n+ * in-flight timestamps clear individual indices via ice_clear_phy_tstamp().\n+ *\n+ * Due to interactions with an internal HW counter for the number of\n+ * outstanding Tx timestamps, this *must* only be called as part of the\n+ * ice_ptp_phy_soft_reset_eth56g() procedure. Otherwise, the internal counter\n+ * may become out of sync and prevent new timestamp interrupts.\n+ *\n+ * Return: 0 on success, negative error code on failure to read the PHY.\n  */\n-static void ice_ptp_reset_ts_memory_eth56g(struct ice_hw *hw)\n+static int ice_ptp_clear_tx_memory_status_eth56g(struct ice_hw *hw, u8 port)\n {\n-\tunsigned int port;\n+\tint err = 0;\n+\tu8 idx;\n \n-\tfor (port = 0; port \u003c hw-\u003eptp.num_lports; port++) {\n-\t\tice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_L,\n-\t\t\t\t\t 0);\n-\t\tice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_U,\n-\t\t\t\t\t 0);\n+\tfor (idx = 0; idx \u003c INDEX_PER_PORT; idx++) {\n+\t\terr = ice_clear_ptp_tstamp_eth56g(hw, port, idx);\n+\t\tif (err)\n+\t\t\treturn err;\n \t}\n+\n+\treturn 0;\n }\n \n /**\n@@ -2115,10 +2105,6 @@ int ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset)\n {\n \tint err;\n \n-\terr = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_OFFSET_READY, 0);\n-\tif (err)\n-\t\treturn err;\n-\n \terr = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_RX_OFFSET_READY, 0);\n \tif (err)\n \t\treturn err;\n@@ -2133,9 +2119,11 @@ int ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset)\n  * @hw: pointer to the HW struct\n  * @port: the PHY port to start\n  *\n- * Start the clock of a PHY port. This must be done as part of the flow to\n- * re-calibrate Tx and Rx timestamping offsets whenever the clock time is\n- * initialized or when link speed changes.\n+ * Perform a PHY soft reset and then start the clock for the PHY port.\n+ *\n+ * This must be done as part of the flow to re-calibrate Tx and Rx\n+ * timestamping offsets whenever the clock time is initialized or when link\n+ * speed changes.\n  *\n  * Return:\n  * * %0     - success\n@@ -2151,6 +2139,10 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)\n \n \ttmr_idx = ice_get_ptp_src_clock_index(hw);\n \n+\terr = ice_ptp_phy_soft_reset_eth56g(hw, port);\n+\tif (err)\n+\t\treturn err;\n+\n \terr = ice_stop_phy_timer_eth56g(hw, port, false);\n \tif (err)\n \t\treturn err;\n@@ -2294,6 +2286,7 @@ int ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status)\n  *\n  * Trigger a soft reset of the ETH56G PHY by toggling the soft reset\n  * bit in the PHY global register. The reset sequence consists of:\n+ *   0. Reading every timestamp memory register to clear its valid bit\n  *   1. Clearing the soft reset bit\n  *   2. Asserting the soft reset bit\n  *   3. Clearing the soft reset bit again\n@@ -2302,6 +2295,12 @@ int ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status)\n  * to settle. This provides a controlled way to reinitialize the PHY\n  * without requiring a full device reset.\n  *\n+ * To ensure that the internal counter matches the contents of the\n+ * PHY_REG_TX_MEMORY_STATUS, read every timestamp index prior to performing\n+ * the soft reset. The PHY_REG_TX_MEMORY_STATUS reads ensure that the region\n+ * is cleared, while the soft reset procedure ensures that the timsetamp\n+ * counter is reset to zero.\n+ *\n  * Return: 0 on success, or a negative error code on failure when\n  *         reading or writing the PHY register.\n  */\n@@ -2310,6 +2309,13 @@ int ice_ptp_phy_soft_reset_eth56g(struct ice_hw *hw, u8 port)\n \tu32 global_val;\n \tint err;\n \n+\terr = ice_ptp_clear_tx_memory_status_eth56g(hw, port);\n+\tif (err) {\n+\t\tice_debug(hw, ICE_DBG_PTP, \"Failed to clear PHY_REG_TX_MEMORY_STATUS for port %d, err %d\\n\",\n+\t\t\t  port, err);\n+\t\treturn err;\n+\t}\n+\n \terr = ice_read_ptp_reg_eth56g(hw, port, PHY_REG_GLOBAL, \u0026global_val);\n \tif (err) {\n \t\tice_debug(hw, ICE_DBG_PTP, \"Failed to read PHY_REG_GLOBAL for port %d, err %d\\n\",\n@@ -5801,8 +5807,9 @@ void ice_ptp_reset_ts_memory(struct ice_hw *hw)\n \t\tice_ptp_reset_ts_memory_e82x(hw);\n \t\tbreak;\n \tcase ICE_MAC_GENERIC_3K_E825:\n-\t\tice_ptp_reset_ts_memory_eth56g(hw);\n-\t\tbreak;\n+\t\t/* E825 hardware must only reset timestamp memory as part of\n+\t\t * the soft reset procedure.\n+\t\t */\n \tcase ICE_MAC_E810:\n \tdefault:\n \t\treturn;\n"
}

2/1 2026/08/22 01:09 agent patch-evaluator
0m Model:
best-expensive

Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch exclusively modifies the Intel E800 series Ethernet driver (ice). This driver requires physical PCIe hardware that is not emulated in standard QEMU or GCE environments. Consequently, the modified code paths (such as PTP timestamping and PHY offset calibration) are unreachable during virtualized fuzzing.",
  "WorthFuzzing": false
}

Instruction:
You are an expert Linux kernel maintainer.
Your job is to review a provided patch series and determine
if it makes functional changes to the kernel that should be fuzzed.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively
use your code access tools to examine the actual source code and confirm any assumptions.

Return WorthFuzzing=false if the patch only contains:
- Modifications to Documentation/, Kconfig files, or code comments.
- Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints.
- Changes to numeric constants or macros that do not functionally alter execution flow.
- Code paths that are impossible to reach in virtualized environments like GCE or QEMU,
  even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim).
- Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed,
  ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU.
- Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove)
  that are executed only during PCI hot-unplug or sysfs driver unbind operations.

If it modifies reachable core kernel logic, drivers, or architectures, use your code search
tools to verify the code can be executed, then return WorthFuzzing=true.

When returning WorthFuzzing=true, you MUST ALSO:
1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols.
   Avoid listing generic hot-path functions to prevent skewed test distributions.
   Prefer non-static, non-inlined API entrypoint functions over internal static helper functions
   (which are inlined by the compiler and do not have distinct symbol addresses).
2. Identify any specific CONFIG_ options required to properly test this new/modified feature.
   Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions.
   Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs
   needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs
   output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit 106b004dcd0346bae57bb7488c7e471113802f90
Author: syz-cluster <triage@syzkaller.com>
Date:   Sat Aug 22 01:09:36 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.c b/drivers/net/ethernet/intel/ice/ice_adapter.c
index 2dc3629d6d0f6..d1643bf8a1b54 100644
--- a/drivers/net/ethernet/intel/ice/ice_adapter.c
+++ b/drivers/net/ethernet/intel/ice/ice_adapter.c
@@ -66,18 +66,17 @@ static struct ice_adapter *ice_adapter_new(struct pci_dev *pdev)
 		mutex_init(&adapter->cpi_phy_lock[i]);
 	refcount_set(&adapter->refcount, 1);
 
-	mutex_init(&adapter->ports.lock);
-	INIT_LIST_HEAD(&adapter->ports.ports);
+	spin_lock_init(&adapter->ports.lock);
+	INIT_LIST_HEAD(&adapter->ports.list);
 
 	return adapter;
 }
 
 static void ice_adapter_free(struct ice_adapter *adapter)
 {
-	WARN_ON(!list_empty(&adapter->ports.ports));
+	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->ports.lock);
 
 	kfree(adapter);
 }
diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.h b/drivers/net/ethernet/intel/ice/ice_adapter.h
index 4f695f32da3d8..39923dedd534e 100644
--- a/drivers/net/ethernet/intel/ice/ice_adapter.h
+++ b/drivers/net/ethernet/intel/ice/ice_adapter.h
@@ -19,13 +19,13 @@ struct ice_pf;
  *
  * This structure contains data used to maintain a list of adapter ports
  *
- * @ports: list of ports
+ * @list: list of ports
  * @lock: protect access to the ports list
  */
 struct ice_port_list {
-	struct list_head ports;
+	struct list_head list;
 	/* To synchronize the ports list operations */
-	struct mutex lock;
+	spinlock_t lock;
 };
 
 /**
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index d88835482d3aa..c84d63b8d261e 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -3248,7 +3248,7 @@ static irqreturn_t ice_misc_intr_thread_fn(int __always_unused irq, void *data)
 	ice_irq_dynamic_ena(hw, NULL, NULL);
 	ice_flush(hw);
 
-	if (ice_ptp_tx_tstamps_pending(pf)) {
+	if (ice_ptp_tx_tstamps_pending(pf, true)) {
 		/* If any new Tx timestamps happened while in interrupt,
 		 * re-arm the interrupt to trigger it again.
 		 */
@@ -6745,7 +6745,6 @@ static int ice_up_complete(struct ice_vsi *vsi)
 		ice_print_link_msg(vsi, true);
 		netif_tx_start_all_queues(vsi->netdev);
 		netif_carrier_on(vsi->netdev);
-		ice_ptp_link_change(pf, true);
 	}
 
 	/* Perform an initial read of the statistics registers now to
@@ -7273,7 +7272,6 @@ int ice_down(struct ice_vsi *vsi)
 
 	if (vsi->netdev) {
 		vlan_err = ice_vsi_del_vlan_zero(vsi);
-		ice_ptp_link_change(vsi->back, false);
 		netif_carrier_off(vsi->netdev);
 		netif_tx_disable(vsi->netdev);
 	}
@@ -7794,6 +7792,15 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
 
 	ice_update_pf_netdev_link(pf);
 
+	if (test_bit(ICE_FLAG_PTP_SUPPORTED, pf->flags) && pf->hw.port_info) {
+		bool link_up;
+
+		link_up = !!(pf->hw.port_info->phy.link_info.link_info &
+			     ICE_AQ_LINK_UP);
+		if (pf->ptp.port.link_up != link_up)
+			ice_ptp_link_change(pf, link_up);
+	}
+
 	/* tell the firmware we are up */
 	err = ice_send_version(pf);
 	if (err) {
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index eaec36ab6ae3f..0e44ed6b0ae8e 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright (C) 2021, Intel Corporation. */
 
+#include <linux/rculist.h>
+#include <linux/wait_bit.h>
 #include "ice.h"
 #include "ice_lib.h"
 #include "ice_trace.h"
@@ -362,9 +364,12 @@ static u64 ice_ptp_extend_40b_ts(struct ice_pf *pf, u64 in_tstamp)
 static bool
 ice_ptp_is_tx_tracker_up(struct ice_ptp_tx *tx)
 {
+	struct ice_ptp_port *ptp_port =
+		container_of(tx, struct ice_ptp_port, tx);
+
 	lockdep_assert_held(&tx->lock);
 
-	return tx->init && !tx->calibrating;
+	return tx->init && !tx->calibrating && ptp_port->link_up;
 }
 
 /**
@@ -561,7 +566,6 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)
 	struct ice_pf *pf;
 	struct ice_hw *hw;
 	u64 tstamp_ready;
-	bool link_up;
 	int err;
 	u8 idx;
 
@@ -569,7 +573,7 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)
 	pf = ptp_port_to_pf(ptp_port);
 	hw = &pf->hw;
 
-	if (!tx->init)
+	if (!tx->init || bitmap_empty(tx->in_use, tx->len))
 		return;
 
 	/* Read the Tx ready status first */
@@ -579,14 +583,11 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)
 			return;
 	}
 
-	/* Drop packets if the link went down */
-	link_up = ptp_port->link_up;
-
 	for_each_set_bit(idx, tx->in_use, tx->len) {
 		struct skb_shared_hwtstamps shhwtstamps = {};
 		u8 phy_idx = idx + tx->offset;
 		u64 raw_tstamp = 0, tstamp;
-		bool drop_ts = !link_up;
+		bool drop_ts = false;
 		struct sk_buff *skb;
 
 		/* Drop packets which have waited for more than 2 seconds */
@@ -619,6 +620,22 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)
 		if (err && !drop_ts)
 			continue;
 
+		/* verify ready bit cleared */
+		if (tx->has_ready_bitmap) {
+			err = ice_get_phy_tx_tstamp_ready(hw, tx->block, &tstamp_ready);
+			if (err)
+				continue;
+
+			if (tstamp_ready & BIT_ULL(phy_idx)) {
+				spin_lock_irqsave(&tx->lock, flags);
+				if (!test_and_set_bit(idx, tx->stale))
+					dev_dbg(ice_pf_to_dev(pf), "PHY port %u failed to clear ready bit for idx %u\n",
+						ptp_port->port_num, phy_idx);
+				spin_unlock_irqrestore(&tx->lock, flags);
+				continue;
+			}
+		}
+
 		ice_trace(tx_tstamp_fw_done, tx->tstamps[idx].skb, idx);
 
 		/* For PHYs which don't implement a proper timestamp ready
@@ -673,20 +690,33 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)
 	pf->ptp.tx_hwtstamp_good += tstamp_good;
 }
 
+static void ice_ptp_release_port_rcu(struct kref *ref)
+{
+	wake_up_var(ref);
+}
+
 static void ice_ptp_tx_tstamp_owner(struct ice_pf *pf)
 {
 	struct ice_ptp_port *port;
 
-	mutex_lock(&pf->adapter->ports.lock);
-	list_for_each_entry(port, &pf->adapter->ports.ports, list_node) {
+	rcu_read_lock();
+	list_for_each_entry_rcu(port, &pf->adapter->ports.list, list_node) {
 		struct ice_ptp_tx *tx = &port->tx;
 
-		if (!tx || !tx->init)
+		if (!tx->init)
 			continue;
 
+		if (!kref_get_unless_zero(&port->ref))
+			continue;
+
+		rcu_read_unlock();
+
 		ice_ptp_process_tx_tstamp(tx);
+
+		kref_put(&port->ref, ice_ptp_release_port_rcu);
+		rcu_read_lock();
 	}
-	mutex_unlock(&pf->adapter->ports.lock);
+	rcu_read_unlock();
 }
 
 /**
@@ -725,6 +755,37 @@ ice_ptp_alloc_tx_tracker(struct ice_ptp_tx *tx)
 	return 0;
 }
 
+static void
+ice_ptp_wait_for_tracker_drain(struct ice_pf *pf, struct ice_ptp_tx *tx)
+{
+	unsigned long deadline = jiffies + msecs_to_jiffies(10);
+	struct ice_hw *hw = &pf->hw;
+	u64 tstamp_ready;
+	bool pending;
+	u8 idx;
+
+	if (hw->reset_ongoing)
+		return;
+
+	do {
+		if (ice_get_phy_tx_tstamp_ready(hw, tx->block, &tstamp_ready))
+			return;
+
+		pending = false;
+		for_each_set_bit(idx, tx->in_use, tx->len) {
+			if (!(tstamp_ready & BIT_ULL(idx + tx->offset)))
+				pending = true;
+		}
+		if (!pending)
+			return;
+
+		usleep_range(500, 1000);
+	} while (time_before(jiffies, deadline));
+
+	dev_dbg(ice_pf_to_dev(pf), "Timed out waiting for in-flight Tx timestamps on block %u\n",
+		tx->block);
+}
+
 /**
  * ice_ptp_flush_tx_tracker - Flush any remaining timestamps from the tracker
  * @pf: Board private structure
@@ -741,6 +802,8 @@ ice_ptp_flush_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx)
 	int err;
 	u8 idx;
 
+	ice_ptp_wait_for_tracker_drain(pf, tx);
+
 	err = ice_get_phy_tx_tstamp_ready(hw, tx->block, &tstamp_ready);
 	if (err) {
 		dev_dbg(ice_pf_to_dev(pf), "Failed to get the Tx tstamp ready bitmap for block %u, err %d\n",
@@ -779,12 +842,10 @@ ice_ptp_flush_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx)
  * ice_ptp_mark_tx_tracker_stale - Mark unfinished timestamps as stale
  * @tx: the tracker to mark
  *
- * Mark currently outstanding Tx timestamps as stale. This prevents sending
- * their timestamp value to the stack. This is required to prevent extending
- * the 40bit hardware timestamp incorrectly.
- *
- * This should be called when the PTP clock is modified such as after a set
- * time request.
+ * Mark currently outstanding Tx timestamps as stale. This prevents the driver
+ * from reporting the timestamp to the stack. This is called to inform the
+ * driver that a timestamp is expected to fail if it was initiated as the link
+ * went down.
  */
 static void
 ice_ptp_mark_tx_tracker_stale(struct ice_ptp_tx *tx)
@@ -808,8 +869,16 @@ ice_ptp_flush_all_tx_tracker(struct ice_pf *pf)
 {
 	struct ice_ptp_port *port;
 
-	list_for_each_entry(port, &pf->adapter->ports.ports, list_node)
+	rcu_read_lock();
+	list_for_each_entry_rcu(port, &pf->adapter->ports.list, list_node) {
+		if (!kref_get_unless_zero(&port->ref))
+			continue;
+		rcu_read_unlock();
 		ice_ptp_flush_tx_tracker(ptp_port_to_pf(port), &port->tx);
+		kref_put(&port->ref, ice_ptp_release_port_rcu);
+		rcu_read_lock();
+	}
+	rcu_read_unlock();
 }
 
 /**
@@ -994,13 +1063,6 @@ static void ice_ptp_reset_cached_phctime(struct ice_pf *pf)
 		kthread_queue_delayed_work(pf->ptp.kworker, &pf->ptp.work,
 					   msecs_to_jiffies(10));
 	}
-
-	/* Mark any outstanding timestamps as stale, since they might have
-	 * been captured in hardware before the time update. This could lead
-	 * to us extending them with the wrong cached value resulting in
-	 * incorrect timestamp values.
-	 */
-	ice_ptp_mark_tx_tracker_stale(&pf->ptp.port.tx);
 }
 
 /**
@@ -1133,6 +1195,7 @@ static int ice_ptp_check_tx_fifo(struct ice_ptp_port *port)
 static void ice_ptp_wait_for_offsets(struct kthread_work *work)
 {
 	struct ice_ptp_port *port;
+	unsigned long flags;
 	struct ice_pf *pf;
 	struct ice_hw *hw;
 	int tx_err;
@@ -1155,12 +1218,28 @@ static void ice_ptp_wait_for_offsets(struct kthread_work *work)
 		tx_err = ice_phy_cfg_tx_offset_e82x(hw, port->port_num);
 	rx_err = ice_phy_cfg_rx_offset_e82x(hw, port->port_num);
 	if (tx_err || rx_err) {
-		/* Tx and/or Rx offset not yet configured, try again later */
+		/* Tx and/or Rx offset not yet configured, try again later.
+		 * This is expected during normal link-up: the vernier offset
+		 * calibration cannot complete until at least one packet has
+		 * been transmitted, so the first retries routinely land here.
+		 */
+		dev_dbg(ice_pf_to_dev(pf),
+			"PTP offset not yet valid for port %u (tx_err=%d rx_err=%d)\n",
+			port->port_num, tx_err, rx_err);
 		kthread_queue_delayed_work(pf->ptp.kworker,
 					   &port->ov_work,
 					   msecs_to_jiffies(100));
 		return;
 	}
+
+	/* Tx and Rx offsets are now configured, enable Tx timestamps */
+	spin_lock_irqsave(&port->tx.lock, flags);
+	port->tx.calibrating = false;
+	spin_unlock_irqrestore(&port->tx.lock, flags);
+
+	dev_dbg(ice_pf_to_dev(pf),
+		"PTP offset valid for port %u, Tx timestamps enabled\n",
+		port->port_num);
 }
 
 /**
@@ -1243,13 +1322,20 @@ ice_ptp_port_phy_restart(struct ice_ptp_port *ptp_port)
 
 		/* Start the PHY timer in Vernier mode */
 		err = ice_start_phy_timer_e82x(hw, port);
-		if (err)
+		if (err) {
+			spin_lock_irqsave(&ptp_port->tx.lock, flags);
+			ptp_port->tx.calibrating = false;
+			spin_unlock_irqrestore(&ptp_port->tx.lock, flags);
 			break;
+		}
 
-		/* Enable Tx timestamps right away */
-		spin_lock_irqsave(&ptp_port->tx.lock, flags);
-		ptp_port->tx.calibrating = false;
-		spin_unlock_irqrestore(&ptp_port->tx.lock, flags);
+		/* Do not clear calibrating flag here. Tx timestamps remain
+		 * disabled until ice_ptp_wait_for_offsets() has verified
+		 * that the Tx and Rx offset calibration has completed.
+		 * Clearing it here would allow Tx timestamps to be reported
+		 * before the PHY offset registers are configured, leading
+		 * to incorrect timestamp values.
+		 */
 
 		kthread_queue_delayed_work(pf->ptp.kworker, &ptp_port->ov_work,
 					   0);
@@ -1280,18 +1366,21 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
 	struct ice_ptp_port *ptp_port;
 	struct ice_hw *hw = &pf->hw;
 
-	if (pf->ptp.state != ICE_PTP_READY)
-		return;
-
 	ptp_port = &pf->ptp.port;
 
 	/* Update cached link status for this port immediately */
 	ptp_port->link_up = linkup;
 
+	if (pf->ptp.state != ICE_PTP_READY)
+		return;
+
 	/* Skip HW writes if reset is in progress */
 	if (pf->hw.reset_ongoing)
 		return;
 
+	if (!linkup)
+		ice_ptp_mark_tx_tracker_stale(&ptp_port->tx);
+
 	if (hw->mac_type == ICE_MAC_GENERIC_3K_E825 &&
 	    test_bit(ICE_FLAG_DPLL, pf->flags)) {
 		int pin, err;
@@ -1424,16 +1513,21 @@ static void ice_ptp_reset_phy_timestamping(struct ice_pf *pf)
  */
 static void ice_ptp_restart_all_phy(struct ice_pf *pf)
 {
-	struct list_head *entry;
+	struct ice_ptp_port *port;
 
-	list_for_each(entry, &pf->adapter->ports.ports) {
-		struct ice_ptp_port *port = list_entry(entry,
-						       struct ice_ptp_port,
-						       list_node);
+	rcu_read_lock();
+	list_for_each_entry_rcu(port, &pf->adapter->ports.list, list_node) {
+		if (!kref_get_unless_zero(&port->ref))
+			continue;
+		rcu_read_unlock();
 
 		if (port->link_up)
 			ice_ptp_port_phy_restart(port);
+
+		kref_put(&port->ref, ice_ptp_release_port_rcu);
+		rcu_read_lock();
 	}
+	rcu_read_unlock();
 }
 
 /**
@@ -2678,74 +2772,56 @@ void ice_ptp_process_ts(struct ice_pf *pf)
 	}
 }
 
-static bool ice_port_has_timestamps(struct ice_ptp_tx *tx)
+static bool ice_port_has_timestamps(struct ice_ptp_tx *tx, bool in_irq)
 {
-	bool more_timestamps;
+	DECLARE_BITMAP(tstamps, INDEX_PER_PORT_MAX) = {};
 
 	scoped_guard(spinlock_irqsave, &tx->lock) {
 		if (!tx->init)
 			return false;
 
-		more_timestamps = !bitmap_empty(tx->in_use, tx->len);
-	}
+		if (in_irq) {
+			if (!ice_ptp_is_tx_tracker_up(tx))
+				return false;
 
-	return more_timestamps;
+			return bitmap_andnot(tstamps, tx->in_use, tx->stale, tx->len);
+		} else {
+			return !bitmap_empty(tx->in_use, tx->len);
+		}
+	}
 }
 
-static bool ice_any_port_has_timestamps(struct ice_pf *pf)
+static bool ice_any_port_has_timestamps(struct ice_pf *pf, bool in_irq)
 {
+	bool have_tstamps = false;
 	struct ice_ptp_port *port;
 
-	scoped_guard(mutex, &pf->adapter->ports.lock) {
-		list_for_each_entry(port, &pf->adapter->ports.ports,
-				    list_node) {
-			struct ice_ptp_tx *tx = &port->tx;
-
-			if (ice_port_has_timestamps(tx))
-				return true;
+	rcu_read_lock();
+	list_for_each_entry_rcu(port, &pf->adapter->ports.list, list_node) {
+		if (ice_port_has_timestamps(&port->tx, in_irq)) {
+			have_tstamps = true;
+			break;
 		}
 	}
+	rcu_read_unlock();
 
-	return false;
+	return have_tstamps;
 }
 
-bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf)
+bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf, bool in_irq)
 {
-	struct ice_hw *hw = &pf->hw;
-	int ret;
-
-	/* Check software indicator */
 	switch (pf->ptp.tx_interrupt_mode) {
 	case ICE_PTP_TX_INTERRUPT_NONE:
 		return false;
 	case ICE_PTP_TX_INTERRUPT_SELF:
-		if (ice_port_has_timestamps(&pf->ptp.port.tx))
-			return true;
-		break;
+		return ice_port_has_timestamps(&pf->ptp.port.tx, in_irq);
 	case ICE_PTP_TX_INTERRUPT_ALL:
-		if (ice_any_port_has_timestamps(pf))
-			return true;
-		break;
+		return ice_any_port_has_timestamps(pf, in_irq);
 	default:
 		WARN_ONCE(1, "Unexpected Tx timestamp interrupt mode %u\n",
 			  pf->ptp.tx_interrupt_mode);
-		break;
-	}
-
-	/* Check hardware indicator */
-	ret = ice_check_phy_tx_tstamp_ready(hw);
-	if (ret < 0) {
-		dev_dbg(ice_pf_to_dev(pf), "Unable to read PHY Tx timestamp ready bitmap, err %d\n",
-			ret);
-		/* Stop triggering IRQs if we're unable to read PHY */
 		return false;
 	}
-
-	/* ice_check_phy_tx_tstamp_ready() returns 1 if there are timestamps
-	 * available, 0 if there are no waiting timestamps, and a negative
-	 * value if there was an error (which we checked for above).
-	 */
-	return ret > 0;
 }
 
 /**
@@ -2799,7 +2875,7 @@ irqreturn_t ice_ptp_ts_irq(struct ice_pf *pf)
 		/* E830 can read timestamps in the top half using rd32() */
 		ice_ptp_process_ts(pf);
 
-		if (ice_ptp_tx_tstamps_pending(pf)) {
+		if (ice_ptp_tx_tstamps_pending(pf, true)) {
 			/* Process outstanding Tx timestamps. If there
 			 * is more work, re-arm the interrupt to trigger again.
 			 */
@@ -2829,7 +2905,6 @@ static void ice_ptp_maybe_trigger_tx_interrupt(struct ice_pf *pf)
 {
 	struct device *dev = ice_pf_to_dev(pf);
 	struct ice_hw *hw = &pf->hw;
-	int ret;
 
 	if (!pf->ptp.port.tx.has_ready_bitmap)
 		return;
@@ -2837,11 +2912,8 @@ static void ice_ptp_maybe_trigger_tx_interrupt(struct ice_pf *pf)
 	if (!ice_pf_src_tmr_owned(pf))
 		return;
 
-	ret = ice_check_phy_tx_tstamp_ready(hw);
-	if (ret < 0) {
-		dev_dbg(dev, "PTP periodic task unable to read PHY timestamp ready bitmap, err %d\n",
-			ret);
-	} else if (ret) {
+	if (ice_ptp_tx_tstamps_pending(pf, false) ||
+	    ice_check_phy_tx_tstamp_ready(hw)) {
 		dev_dbg(dev, "PTP periodic task detected waiting timestamps. Triggering Tx timestamp interrupt now.\n");
 
 		wr32(hw, PFINT_OICR, PFINT_OICR_TSYN_TX_M);
@@ -2890,14 +2962,16 @@ void ice_ptp_queue_work(struct ice_pf *pf)
 static void ice_ptp_prepare_rebuild_sec(struct ice_pf *pf, bool rebuild,
 					enum ice_reset_req reset_type)
 {
-	struct list_head *entry;
+	struct ice_ptp_port *port;
 
-	list_for_each(entry, &pf->adapter->ports.ports) {
-		struct ice_ptp_port *port = list_entry(entry,
-						       struct ice_ptp_port,
-						       list_node);
+	rcu_read_lock();
+	list_for_each_entry_rcu(port, &pf->adapter->ports.list, list_node) {
 		struct ice_pf *peer_pf = ptp_port_to_pf(port);
 
+		if (!kref_get_unless_zero(&port->ref))
+			continue;
+		rcu_read_unlock();
+
 		if (!ice_is_primary(&peer_pf->hw)) {
 			if (rebuild) {
 				/* TODO: When implementing rebuild=true:
@@ -2909,7 +2983,11 @@ static void ice_ptp_prepare_rebuild_sec(struct ice_pf *pf, bool rebuild,
 				ice_ptp_prepare_for_reset(peer_pf, reset_type);
 			}
 		}
+
+		kref_put(&port->ref, ice_ptp_release_port_rcu);
+		rcu_read_lock();
 	}
+	rcu_read_unlock();
 }
 
 /**
@@ -2936,6 +3014,14 @@ void ice_ptp_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
 	if (reset_type == ICE_RESET_PFR)
 		return;
 
+	/* Cancel the offset verification work for E82x before releasing the
+	 * Tx tracker. If ov_work is running during reset, it may issue
+	 * sideband queue commands that will fail or timeout, and may
+	 * reference state that is being torn down.
+	 */
+	if (hw->mac_type == ICE_MAC_GENERIC)
+		kthread_cancel_delayed_work_sync(&ptp->port.ov_work);
+
 	if (ice_pf_src_tmr_owned(pf) && hw->mac_type == ICE_MAC_GENERIC_3K_E825)
 		ice_ptp_prepare_rebuild_sec(pf, false, reset_type);
 
@@ -3086,11 +3172,11 @@ static int ice_ptp_setup_pf(struct ice_pf *pf)
 		return -ENODEV;
 
 	INIT_LIST_HEAD(&ptp->port.list_node);
-	mutex_lock(&pf->adapter->ports.lock);
+	kref_init(&ptp->port.ref);
 
-	list_add(&ptp->port.list_node,
-		 &pf->adapter->ports.ports);
-	mutex_unlock(&pf->adapter->ports.lock);
+	spin_lock(&pf->adapter->ports.lock);
+	list_add_rcu(&ptp->port.list_node, &pf->adapter->ports.list);
+	spin_unlock(&pf->adapter->ports.lock);
 
 	/* Seed the per-PHY Tx reference clock usage map for this port.
 	 * Only meaningful on E825 (other MAC types don't expose tx-clk
@@ -3113,12 +3199,32 @@ static int ice_ptp_setup_pf(struct ice_pf *pf)
 static void ice_ptp_cleanup_pf(struct ice_pf *pf)
 {
 	struct ice_ptp *ptp = &pf->ptp;
+	struct kref *ref;
 
-	if (pf->hw.mac_type != ICE_MAC_UNKNOWN) {
-		mutex_lock(&pf->adapter->ports.lock);
-		list_del(&ptp->port.list_node);
-		mutex_unlock(&pf->adapter->ports.lock);
-	}
+	if (pf->hw.mac_type == ICE_MAC_UNKNOWN)
+		return;
+
+	/* The PF cannot be removed until there are no more remaining
+	 * outstanding references to the PTP port. To make sure this is true,
+	 * first remove the port from the list, then drop the primary
+	 * reference this PF holds on the port. Once done, wait until all
+	 * existing references are dropped. Finally, synchronize_rcu() to
+	 * ensure that all RCU critical sections that might attempt to
+	 * dereference the port are finished.
+	 */
+
+	spin_lock(&pf->adapter->ports.lock);
+	list_del_rcu(&ptp->port.list_node);
+	spin_unlock(&pf->adapter->ports.lock);
+
+	ref = &ptp->port.ref;
+	kref_put(ref, ice_ptp_release_port_rcu);
+
+	dev_WARN_ONCE(ice_pf_to_dev(pf),
+		      !wait_var_event_timeout(ref, !kref_read(ref), 15 * HZ),
+		      "Timed out waiting for port references to release. Continuing to unload anyways.");
+
+	synchronize_rcu();
 }
 
 /**
@@ -3210,9 +3316,13 @@ static int ice_ptp_init_owner(struct ice_pf *pf)
 }
 
 /**
- * ice_ptp_init_work - Initialize PTP work threads
+ * ice_ptp_init_work - Initialize the PTP kworker
  * @pf: Board private structure
  * @ptp: PF PTP structure
+ *
+ * Allocate the kworker and initialize the periodic work function. The
+ * periodic work is not queued here; the caller starts it once the PTP
+ * state is ICE_PTP_READY.
  */
 static int ice_ptp_init_work(struct ice_pf *pf, struct ice_ptp *ptp)
 {
@@ -3231,9 +3341,6 @@ static int ice_ptp_init_work(struct ice_pf *pf, struct ice_ptp *ptp)
 
 	ptp->kworker = kworker;
 
-	/* Start periodic work going */
-	kthread_queue_delayed_work(ptp->kworker, &ptp->work, 0);
-
 	return 0;
 }
 
@@ -3355,6 +3462,22 @@ void ice_ptp_init(struct ice_pf *pf)
 	if (err)
 		goto err_clean_pf;
 
+	/* Seed link_up from current PHY status, since link may already be up
+	 * (e.g. after PXE boot) with no link-change edge to catch it later.
+	 */
+	if (pf->hw.port_info)
+		ptp->port.link_up =
+			!!(pf->hw.port_info->phy.link_info.link_info &
+			ICE_AQ_LINK_UP);
+
+	/* Create the kworker before restarting the PHY, which queues work on
+	 * it in the E82x restart path. This prevents concurrent link events
+	 * from reaching ice_ptp_port_phy_restart() while kworker is still NULL
+	 */
+	err = ice_ptp_init_work(pf, ptp);
+	if (err)
+		goto err_exit;
+
 	/* Start the PHY timestamping block */
 	ice_ptp_reset_phy_timestamping(pf);
 
@@ -3363,9 +3486,10 @@ void ice_ptp_init(struct ice_pf *pf)
 
 	ptp->state = ICE_PTP_READY;
 
-	err = ice_ptp_init_work(pf, ptp);
-	if (err)
-		goto err_exit;
+	/* Start periodic work only after the state is READY; the worker
+	 * returns without rescheduling while the state is not READY.
+	 */
+	kthread_queue_delayed_work(ptp->kworker, &ptp->work, 0);
 
 	dev_info(ice_pf_to_dev(pf), "PTP init successful\n");
 	return;
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h
index c4b0da7ce20ed..13158a9319fb8 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.h
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.h
@@ -5,6 +5,8 @@
 #define _ICE_PTP_H_
 
 #include <linux/ptp_clock_kernel.h>
+#include <linux/rculist.h>
+#include <linux/kref.h>
 #include <linux/kthread.h>
 
 #include "ice_ptp_hw.h"
@@ -130,6 +132,9 @@ struct ice_ptp_tx {
 #define INDEX_PER_PORT_E82X		16
 #define INDEX_PER_PORT			64
 
+/* Maximum number of timestamp indexes across all devices */
+#define INDEX_PER_PORT_MAX              INDEX_PER_PORT
+
 /**
  * struct ice_ptp_port - data used to initialize an external port for PTP
  *
@@ -138,6 +143,7 @@ struct ice_ptp_tx {
  * and determine when the port's PHY offset is valid.
  *
  * @list_node: list member structure
+ * @ref: reference counter for use with adapter ports list
  * @tx: Tx timestamp tracking for this port
  * @ov_work: delayed work task for tracking when PHY offset is valid
  * @ps_lock: mutex used to protect the overall PTP PHY start procedure
@@ -149,6 +155,7 @@ struct ice_ptp_tx {
  */
 struct ice_ptp_port {
 	struct list_head list_node;
+	struct kref ref;
 	struct ice_ptp_tx tx;
 	struct kthread_delayed_work ov_work;
 	struct mutex ps_lock; /* protects overall PTP PHY start procedure */
@@ -312,7 +319,7 @@ void ice_ptp_req_tx_single_tstamp(struct ice_ptp_tx *tx, u8 idx);
 void ice_ptp_complete_tx_single_tstamp(struct ice_ptp_tx *tx);
 void ice_ptp_process_ts(struct ice_pf *pf);
 irqreturn_t ice_ptp_ts_irq(struct ice_pf *pf);
-bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf);
+bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf, bool in_irq);
 u64 ice_ptp_read_src_clk_reg(struct ice_pf *pf,
 			     struct ptp_system_timestamp *sts);
 
@@ -360,7 +367,8 @@ static inline irqreturn_t ice_ptp_ts_irq(struct ice_pf *pf)
 	return IRQ_HANDLED;
 }
 
-static inline bool ice_ptp_tx_tstamps_pending(struct ice_pf *pf)
+static inline bool
+ice_ptp_tx_tstamps_pending(struct ice_pf *pf, bool in_irq)
 {
 	return false;
 }
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
index 3a41c711e751b..10e973876608e 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
@@ -737,24 +737,6 @@ static int ice_read_port_mem_eth56g(struct ice_hw *hw, u8 port, u16 offset,
 	return ice_read_port_eth56g(hw, port, offset, val, ETH56G_PHY_MEM_PTP);
 }
 
-/**
- * ice_write_port_mem_eth56g - Write a PHY port memory location
- * @hw: pointer to the HW struct
- * @port: Port number to be read
- * @offset: Offset from PHY port register base
- * @val: Pointer to the value to read (out param)
- *
- * Return:
- * * %0      - success
- * * %EINVAL - invalid port number or resource type
- * * %other  - failed to write to PHY
- */
-static int ice_write_port_mem_eth56g(struct ice_hw *hw, u8 port, u16 offset,
-				     u32 val)
-{
-	return ice_write_port_eth56g(hw, port, offset, val, ETH56G_PHY_MEM_PTP);
-}
-
 /**
  * ice_write_quad_ptp_reg_eth56g - Write a PHY quad register
  * @hw: pointer to the HW struct
@@ -1139,8 +1121,8 @@ static int ice_read_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx,
  * internal PHYs of the 56G devices.
  *
  * To directly clear the contents of the timestamp block entirely, discarding
- * all timestamp data at once, software should instead use
- * ice_ptp_reset_ts_memory_quad_eth56g().
+ * all timestamp data at once, software should instead perform a PHY soft
+ * reset via ice_ptp_phy_soft_reset_eth56g().
  *
  * This function should only be called on an idx whose bit is set according to
  * ice_get_phy_tx_tstamp_ready().
@@ -1152,11 +1134,11 @@ static int ice_read_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx,
 static int ice_clear_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx)
 {
 	u64 unused_tstamp;
-	u16 lo_addr;
 	int err;
 
-	/* Read the timestamp register to ensure the timestamp status bit is
-	 * cleared.
+	/* Per the PHY spec, reading the timestamp memory location is what
+	 * clears the entry's valid bit and its corresponding (read-only)
+	 * ts_memory_status bit.
 	 */
 	err = ice_read_ptp_tstamp_eth56g(hw, port, idx, &unused_tstamp);
 	if (err) {
@@ -1164,32 +1146,40 @@ static int ice_clear_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx)
 			  port, idx, err);
 	}
 
-	lo_addr = (u16)PHY_TSTAMP_L(idx);
-
-	err = ice_write_port_mem_eth56g(hw, port, lo_addr, 0);
-	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to clear low PTP timestamp register for port %u, idx %u, err %d\n",
-			  port, idx, err);
-		return err;
-	}
-
 	return 0;
 }
 
 /**
- * ice_ptp_reset_ts_memory_eth56g - Clear all timestamps from the port block
+ * ice_ptp_clear_tx_memory_status_eth56g - Reset one port's Tx timestamp memory
  * @hw: pointer to the HW struct
+ * @port: port number to clear
+ *
+ * Fully reset a single PHY port's Tx timestamp memory. Per the PHY spec, the
+ * only way to clear a timestamp valid bit (and its read-only ts_memory_status
+ * bit) is to read the timestamp memory location, so read every entry for the
+ * port (two 32-bit reads each). This discards all timestamp data on the port,
+ * so it must only be used for a full reset; callers that must preserve
+ * in-flight timestamps clear individual indices via ice_clear_phy_tstamp().
+ *
+ * Due to interactions with an internal HW counter for the number of
+ * outstanding Tx timestamps, this *must* only be called as part of the
+ * ice_ptp_phy_soft_reset_eth56g() procedure. Otherwise, the internal counter
+ * may become out of sync and prevent new timestamp interrupts.
+ *
+ * Return: 0 on success, negative error code on failure to read the PHY.
  */
-static void ice_ptp_reset_ts_memory_eth56g(struct ice_hw *hw)
+static int ice_ptp_clear_tx_memory_status_eth56g(struct ice_hw *hw, u8 port)
 {
-	unsigned int port;
+	int err = 0;
+	u8 idx;
 
-	for (port = 0; port < hw->ptp.num_lports; port++) {
-		ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_L,
-					 0);
-		ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_U,
-					 0);
+	for (idx = 0; idx < INDEX_PER_PORT; idx++) {
+		err = ice_clear_ptp_tstamp_eth56g(hw, port, idx);
+		if (err)
+			return err;
 	}
+
+	return 0;
 }
 
 /**
@@ -2115,10 +2105,6 @@ int ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset)
 {
 	int err;
 
-	err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_OFFSET_READY, 0);
-	if (err)
-		return err;
-
 	err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_RX_OFFSET_READY, 0);
 	if (err)
 		return err;
@@ -2133,9 +2119,11 @@ int ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset)
  * @hw: pointer to the HW struct
  * @port: the PHY port to start
  *
- * Start the clock of a PHY port. This must be done as part of the flow to
- * re-calibrate Tx and Rx timestamping offsets whenever the clock time is
- * initialized or when link speed changes.
+ * Perform a PHY soft reset and then start the clock for the PHY port.
+ *
+ * This must be done as part of the flow to re-calibrate Tx and Rx
+ * timestamping offsets whenever the clock time is initialized or when link
+ * speed changes.
  *
  * Return:
  * * %0     - success
@@ -2151,6 +2139,10 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
 
 	tmr_idx = ice_get_ptp_src_clock_index(hw);
 
+	err = ice_ptp_phy_soft_reset_eth56g(hw, port);
+	if (err)
+		return err;
+
 	err = ice_stop_phy_timer_eth56g(hw, port, false);
 	if (err)
 		return err;
@@ -2294,6 +2286,7 @@ int ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status)
  *
  * Trigger a soft reset of the ETH56G PHY by toggling the soft reset
  * bit in the PHY global register. The reset sequence consists of:
+ *   0. Reading every timestamp memory register to clear its valid bit
  *   1. Clearing the soft reset bit
  *   2. Asserting the soft reset bit
  *   3. Clearing the soft reset bit again
@@ -2302,6 +2295,12 @@ int ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status)
  * to settle. This provides a controlled way to reinitialize the PHY
  * without requiring a full device reset.
  *
+ * To ensure that the internal counter matches the contents of the
+ * PHY_REG_TX_MEMORY_STATUS, read every timestamp index prior to performing
+ * the soft reset. The PHY_REG_TX_MEMORY_STATUS reads ensure that the region
+ * is cleared, while the soft reset procedure ensures that the timsetamp
+ * counter is reset to zero.
+ *
  * Return: 0 on success, or a negative error code on failure when
  *         reading or writing the PHY register.
  */
@@ -2310,6 +2309,13 @@ int ice_ptp_phy_soft_reset_eth56g(struct ice_hw *hw, u8 port)
 	u32 global_val;
 	int err;
 
+	err = ice_ptp_clear_tx_memory_status_eth56g(hw, port);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to clear PHY_REG_TX_MEMORY_STATUS for port %d, err %d\n",
+			  port, err);
+		return err;
+	}
+
 	err = ice_read_ptp_reg_eth56g(hw, port, PHY_REG_GLOBAL, &global_val);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to read PHY_REG_GLOBAL for port %d, err %d\n",
@@ -5801,8 +5807,9 @@ void ice_ptp_reset_ts_memory(struct ice_hw *hw)
 		ice_ptp_reset_ts_memory_e82x(hw);
 		break;
 	case ICE_MAC_GENERIC_3K_E825:
-		ice_ptp_reset_ts_memory_eth56g(hw);
-		break;
+		/* E825 hardware must only reset timestamp memory as part of
+		 * the soft reset procedure.
+		 */
 	case ICE_MAC_E810:
 	default:
 		return;

3/2 2026/08/22 01:09 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 14854
							output: 36
							thoughts: 750
						

Thoughts:
**My Assessment of the `ice` PTP Driver Patch**

Okay, so I've got this patch here that's making some pretty significant changes to the Precision Time Protocol (PTP) implementation within the `ice` driver, specifically for Intel's E800 series Ethernet controllers. My initial read tells me this is pretty involved. It looks like they're reworking the locking strategy within the driver, shifting from mutexes to spinlocks in some areas, and making heavy use of RCU (Read-Copy-Update) for iterating through ports, particularly in functions dealing with TX timestamps. They've also added a wait function to drain in-flight timestamps. There's also some PHY restart logic being handled here. There's some changes to the hardware initialization.

The code modifies the timestamping logic, locking mechanisms (mutex to spinlock/RCU), and PHY reset logic.

My initial concern isn't about the *functionality* of the changes, but whether this constitutes a candidate for fuzzing. The prompt says I need to return `WorthFuzzing=false` if the patch only includes code in vendor-specific drivers that require physical PCIe hardware not emulated in standard QEMU.

Given my experience, I'm pretty certain that the `ice` driver, which is specific to the Intel E800 series, is *not* typically emulated in a standard QEMU setup like the `e1000`, `e1000e`, or `igb` drivers, which are commonly emulated. This looks like the `ice` driver might be a vendor-specific driver that requires physical hardware.

So, I need to figure out if this patch could potentially be reached by a fuzzer *even if* it is not emulated. Syzkaller, in my experience, has PCI fuzzing capabilities, including some pseudo-syscalls to directly interact with PCI devices. The question is, does this fuzzing depth reach into the intricacies of PTP logic within the `ice` driver? I'll need to check the syzkaller descriptions for the `ice` driver.



4/2 2026/08/22 01:09 tool grepper
0m Args:
{
  "Expression": "ice_ptp_",
  "PathPrefix": "drivers/net/ethernet/intel/ice/"
}

Results:
{
  "Output": "\nFull output is too long, showing 500 out of 2604 lines.\nUse more precise expression if possible.\n\ndrivers/net/ethernet/intel/ice/Makefile=47=ice-$(CONFIG_PCI_IOV) +=\t\\\n--\ndrivers/net/ethernet/intel/ice/Makefile-56-\tice_vf_lib.o\ndrivers/net/ethernet/intel/ice/Makefile:57:ice-$(CONFIG_PTP_1588_CLOCK) += ice_ptp.o ice_ptp_hw.o ice_dpll.o ice_tspll.o ice_cpi.o ice_txclk.o\ndrivers/net/ethernet/intel/ice/Makefile-58-ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o\n--\ndrivers/net/ethernet/intel/ice/ice.h=695=static inline bool ice_vector_ch_enabled(struct ice_q_vector *qv)\n--\ndrivers/net/ethernet/intel/ice/ice.h-700-/**\ndrivers/net/ethernet/intel/ice/ice.h:701: * ice_ptp_pf_handles_tx_interrupt - Check if PF handles Tx interrupt\ndrivers/net/ethernet/intel/ice/ice.h-702- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice.h-706- */\ndrivers/net/ethernet/intel/ice/ice.h:707:static inline bool ice_ptp_pf_handles_tx_interrupt(struct ice_pf *pf)\ndrivers/net/ethernet/intel/ice/ice.h-708-{\n--\ndrivers/net/ethernet/intel/ice/ice_common.c-7-#include \"ice_flow.h\"\ndrivers/net/ethernet/intel/ice/ice_common.c:8:#include \"ice_ptp_hw.h\"\ndrivers/net/ethernet/intel/ice/ice_common.c-9-#include \u003clinux/packing.h\u003e\n--\ndrivers/net/ethernet/intel/ice/ice_cpi.c-5-#include \"ice_common.h\"\ndrivers/net/ethernet/intel/ice/ice_cpi.c:6:#include \"ice_ptp_hw.h\"\ndrivers/net/ethernet/intel/ice/ice_cpi.c-7-#include \"ice.h\"\n--\ndrivers/net/ethernet/intel/ice/ice_cpi.h-7-#include \"ice_type.h\"\ndrivers/net/ethernet/intel/ice/ice_cpi.h:8:#include \"ice_ptp_hw.h\"\ndrivers/net/ethernet/intel/ice/ice_cpi.h-9-\n--\ndrivers/net/ethernet/intel/ice/ice_dpll.c=4879=static void ice_dpll_init_e825(struct ice_pf *pf)\n--\ndrivers/net/ethernet/intel/ice/ice_dpll.c-4886-\t * otherwise userspace can trigger div-by-zero in ice_txclk_set_clk().\ndrivers/net/ethernet/intel/ice/ice_dpll.c:4887:\t * When PTP is supported, ice_ptp_init() handles this.\ndrivers/net/ethernet/intel/ice/ice_dpll.c-4888-\t */\ndrivers/net/ethernet/intel/ice/ice_dpll.c-4889-\tif (!test_bit(ICE_FLAG_PTP_SUPPORTED, pf-\u003eflags)) {\ndrivers/net/ethernet/intel/ice/ice_dpll.c:4890:\t\tice_ptp_init_hw(\u0026pf-\u003ehw);\ndrivers/net/ethernet/intel/ice/ice_dpll.c-4891-\t\tif (pf-\u003ehw.lane_num \u003e= 0)\n--\ndrivers/net/ethernet/intel/ice/ice_ethtool.c=3759=ice_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info)\n--\ndrivers/net/ethernet/intel/ice/ice_ethtool.c-3771-\ndrivers/net/ethernet/intel/ice/ice_ethtool.c:3772:\tinfo-\u003ephc_index = ice_ptp_clock_index(pf);\ndrivers/net/ethernet/intel/ice/ice_ethtool.c-3773-\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=536=ice_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-610-\tif (test_bit(ICE_FLAG_PTP_SUPPORTED, pf-\u003eflags))\ndrivers/net/ethernet/intel/ice/ice_main.c:611:\t\tice_ptp_prepare_for_reset(pf, reset_type);\ndrivers/net/ethernet/intel/ice/ice_main.c-612-\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=1103=ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-1153-\ndrivers/net/ethernet/intel/ice/ice_main.c:1154:\tice_ptp_link_change(pf, link_up);\ndrivers/net/ethernet/intel/ice/ice_main.c-1155-\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=3060=static irqreturn_t ice_ll_ts_intr(int __always_unused irq, void *data)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-3063-\tu32 pf_intr_start_offset;\ndrivers/net/ethernet/intel/ice/ice_main.c:3064:\tstruct ice_ptp_tx *tx;\ndrivers/net/ethernet/intel/ice/ice_main.c-3065-\tunsigned long flags;\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-3073-\tif (tx-\u003einit) {\ndrivers/net/ethernet/intel/ice/ice_main.c:3074:\t\tice_ptp_complete_tx_single_tstamp(tx);\ndrivers/net/ethernet/intel/ice/ice_main.c-3075-\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-3078-\t\tif (idx != tx-\u003elen)\ndrivers/net/ethernet/intel/ice/ice_main.c:3079:\t\t\tice_ptp_req_tx_single_tstamp(tx, idx);\ndrivers/net/ethernet/intel/ice/ice_main.c-3080-\t}\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=3097=static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-3182-\ndrivers/net/ethernet/intel/ice/ice_main.c:3183:\t\tret = ice_ptp_ts_irq(pf);\ndrivers/net/ethernet/intel/ice/ice_main.c-3184-\t}\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-3198-\ndrivers/net/ethernet/intel/ice/ice_main.c:3199:\t\t\tice_ptp_extts_event(pf);\ndrivers/net/ethernet/intel/ice/ice_main.c-3200-\t\t}\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=3234=static irqreturn_t ice_misc_intr_thread_fn(int __always_unused irq, void *data)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-3244-\tif (test_and_clear_bit(ICE_MISC_THREAD_TX_TSTAMP, pf-\u003emisc_thread))\ndrivers/net/ethernet/intel/ice/ice_main.c:3245:\t\tice_ptp_process_ts(pf);\ndrivers/net/ethernet/intel/ice/ice_main.c-3246-\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-3250-\ndrivers/net/ethernet/intel/ice/ice_main.c:3251:\tif (ice_ptp_tx_tstamps_pending(pf, true)) {\ndrivers/net/ethernet/intel/ice/ice_main.c-3252-\t\t/* If any new Tx timestamps happened while in interrupt,\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=4064=int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-4111-\tif (test_bit(ICE_FLAG_PTP_SUPPORTED, pf-\u003eflags))\ndrivers/net/ethernet/intel/ice/ice_main.c:4112:\t\tice_ptp_restore_timestamp_mode(pf);\ndrivers/net/ethernet/intel/ice/ice_main.c-4113-\tgoto done;\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=4721=static void ice_init_features(struct ice_pf *pf)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-4729-\tif (test_bit(ICE_FLAG_PTP_SUPPORTED, pf-\u003eflags))\ndrivers/net/ethernet/intel/ice/ice_main.c:4730:\t\tice_ptp_init(pf);\ndrivers/net/ethernet/intel/ice/ice_main.c-4731-\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=4757=static void ice_deinit_features(struct ice_pf *pf)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-4768-\tif (test_bit(ICE_FLAG_PTP_SUPPORTED, pf-\u003eflags))\ndrivers/net/ethernet/intel/ice/ice_main.c:4769:\t\tice_ptp_release(pf);\ndrivers/net/ethernet/intel/ice/ice_main.c-4770-\tif (test_bit(ICE_FLAG_DPLL, pf-\u003eflags))\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=7645=static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-7750-\tif (test_bit(ICE_FLAG_PTP_SUPPORTED, pf-\u003eflags))\ndrivers/net/ethernet/intel/ice/ice_main.c:7751:\t\tice_ptp_rebuild(pf, reset_type);\ndrivers/net/ethernet/intel/ice/ice_main.c-7752-\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-7800-\t\tif (pf-\u003eptp.port.link_up != link_up)\ndrivers/net/ethernet/intel/ice/ice_main.c:7801:\t\t\tice_ptp_link_change(pf, link_up);\ndrivers/net/ethernet/intel/ice/ice_main.c-7802-\t}\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-7823-\t/* Restore timestamp mode settings after VSI rebuild */\ndrivers/net/ethernet/intel/ice/ice_main.c:7824:\tice_ptp_restore_timestamp_mode(pf);\ndrivers/net/ethernet/intel/ice/ice_main.c-7825-\ndrivers/net/ethernet/intel/ice/ice_main.c-7826-\t/* Start PTP periodic work after VSI is fully rebuilt */\ndrivers/net/ethernet/intel/ice/ice_main.c:7827:\tice_ptp_queue_work(pf);\ndrivers/net/ethernet/intel/ice/ice_main.c-7828-\treturn;\n--\ndrivers/net/ethernet/intel/ice/ice_main.c=9794=static const struct net_device_ops ice_netdev_ops = {\n--\ndrivers/net/ethernet/intel/ice/ice_main.c-9829-\t.ndo_xsk_wakeup = ice_xsk_wakeup,\ndrivers/net/ethernet/intel/ice/ice_main.c:9830:\t.ndo_hwtstamp_get = ice_ptp_hwtstamp_get,\ndrivers/net/ethernet/intel/ice/ice_main.c:9831:\t.ndo_hwtstamp_set = ice_ptp_hwtstamp_set,\ndrivers/net/ethernet/intel/ice/ice_main.c-9832-};\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=11=static const char ice_pin_names[][64] = {\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-19-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:20:static const struct ice_ptp_pin_desc ice_pin_desc_e82x[] = {\ndrivers/net/ethernet/intel/ice/ice_ptp.c-21-\t/* name,        gpio,       delay */\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-25-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:26:static const struct ice_ptp_pin_desc ice_pin_desc_e825c[] = {\ndrivers/net/ethernet/intel/ice/ice_ptp.c-27-\t/* name,        gpio,       delay */\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-35-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:36:static const struct ice_ptp_pin_desc ice_pin_desc_e810[] = {\ndrivers/net/ethernet/intel/ice/ice_ptp.c-37-\t/* name,        gpio,       delay */\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=45=static const char ice_pin_names_dpll[][64] = {\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-51-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:52:static const struct ice_ptp_pin_desc ice_pin_desc_dpll[] = {\ndrivers/net/ethernet/intel/ice/ice_ptp.c-53-\t/* name,   gpio,       delay */\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=60=static struct ice_ptp *ice_get_ctrl_ptp(struct ice_pf *pf)\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-67-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:68: * ice_ptp_find_pin_idx - Find pin index in ptp_pin_desc\ndrivers/net/ethernet/intel/ice/ice_ptp.c-69- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-74- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:75:static int ice_ptp_find_pin_idx(struct ice_pf *pf, enum ptp_pin_function func,\ndrivers/net/ethernet/intel/ice/ice_ptp.c-76-\t\t\t\tunsigned int chan)\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-90-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:91: * ice_ptp_cfg_tx_interrupt - Configure Tx timestamp interrupt for the device\ndrivers/net/ethernet/intel/ice/ice_ptp.c-92- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-96- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:97:static void ice_ptp_cfg_tx_interrupt(struct ice_pf *pf)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-98-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=134=static void ice_set_rx_tstamp(struct ice_pf *pf, bool on)\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-151-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:152: * ice_ptp_disable_timestamp_mode - Disable current timestamp mode\ndrivers/net/ethernet/intel/ice/ice_ptp.c-153- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-158- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:159:static void ice_ptp_disable_timestamp_mode(struct ice_pf *pf)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-160-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-171-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:172: * ice_ptp_restore_timestamp_mode - Restore timestamp configuration\ndrivers/net/ethernet/intel/ice/ice_ptp.c-173- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-177- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:178:void ice_ptp_restore_timestamp_mode(struct ice_pf *pf)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-179-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-182-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:183:\tice_ptp_cfg_tx_interrupt(pf);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-184-\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-195-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:196: * ice_ptp_read_src_clk_reg - Read the source clock register\ndrivers/net/ethernet/intel/ice/ice_ptp.c-197- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-200- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:201:u64 ice_ptp_read_src_clk_reg(struct ice_pf *pf,\ndrivers/net/ethernet/intel/ice/ice_ptp.c-202-\t\t\t     struct ptp_system_timestamp *sts)\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-246-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:247: * ice_ptp_extend_32b_ts - Convert a 32b nanoseconds timestamp to 64b\ndrivers/net/ethernet/intel/ice/ice_ptp.c-248- * @cached_phc_time: recently cached copy of PHC time\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-283- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:284:static u64 ice_ptp_extend_32b_ts(u64 cached_phc_time, u32 in_tstamp)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-285-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-313-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:314: * ice_ptp_extend_40b_ts - Convert a 40b timestamp to 64b nanoseconds\ndrivers/net/ethernet/intel/ice/ice_ptp.c-315- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-335- *\ndrivers/net/ethernet/intel/ice/ice_ptp.c:336: * See ice_ptp_extend_32b_ts for a detailed explanation of the extension\ndrivers/net/ethernet/intel/ice/ice_ptp.c-337- * algorithm.\ndrivers/net/ethernet/intel/ice/ice_ptp.c-338- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:339:static u64 ice_ptp_extend_40b_ts(struct ice_pf *pf, u64 in_tstamp)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-340-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-350-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:351:\treturn ice_ptp_extend_32b_ts(READ_ONCE(pf-\u003eptp.cached_phc_time),\ndrivers/net/ethernet/intel/ice/ice_ptp.c-352-\t\t\t\t     (in_tstamp \u003e\u003e 8) \u0026 mask);\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-355-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:356: * ice_ptp_is_tx_tracker_up - Check if Tx tracker is ready for new timestamps\ndrivers/net/ethernet/intel/ice/ice_ptp.c-357- * @tx: the PTP Tx timestamp tracker to check\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=364=static bool\ndrivers/net/ethernet/intel/ice/ice_ptp.c:365:ice_ptp_is_tx_tracker_up(struct ice_ptp_tx *tx)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-366-{\ndrivers/net/ethernet/intel/ice/ice_ptp.c:367:\tstruct ice_ptp_port *ptp_port =\ndrivers/net/ethernet/intel/ice/ice_ptp.c:368:\t\tcontainer_of(tx, struct ice_ptp_port, tx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-369-\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-375-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:376: * ice_ptp_req_tx_single_tstamp - Request Tx timestamp for a port from FW\ndrivers/net/ethernet/intel/ice/ice_ptp.c-377- * @tx: the PTP Tx timestamp tracker\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-379- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:380:void ice_ptp_req_tx_single_tstamp(struct ice_ptp_tx *tx, u8 idx)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-381-{\ndrivers/net/ethernet/intel/ice/ice_ptp.c-382-\tstruct ice_e810_params *params;\ndrivers/net/ethernet/intel/ice/ice_ptp.c:383:\tstruct ice_ptp_port *ptp_port;\ndrivers/net/ethernet/intel/ice/ice_ptp.c-384-\tunsigned long flags;\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-390-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:391:\tptp_port = container_of(tx, struct ice_ptp_port, tx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-392-\tpf = ptp_port_to_pf(ptp_port);\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-423-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:424: * ice_ptp_complete_tx_single_tstamp - Complete Tx timestamp for a port\ndrivers/net/ethernet/intel/ice/ice_ptp.c-425- * @tx: the PTP Tx timestamp tracker\ndrivers/net/ethernet/intel/ice/ice_ptp.c-426- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:427:void ice_ptp_complete_tx_single_tstamp(struct ice_ptp_tx *tx)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-428-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-431-\tstruct ice_e810_params *params;\ndrivers/net/ethernet/intel/ice/ice_ptp.c:432:\tstruct ice_ptp_port *ptp_port;\ndrivers/net/ethernet/intel/ice/ice_ptp.c-433-\tu64 raw_tstamp, tstamp;\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-443-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:444:\tptp_port = container_of(tx, struct ice_ptp_port, tx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-445-\tpf = ptp_port_to_pf(ptp_port);\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-499-\t/* Extend the timestamp using cached PHC time */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:500:\ttstamp = ice_ptp_extend_40b_ts(pf, raw_tstamp);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-501-\tif (tstamp) {\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-513-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:514: * ice_ptp_process_tx_tstamp - Process Tx timestamps for a port\ndrivers/net/ethernet/intel/ice/ice_ptp.c-515- * @tx: the PTP Tx timestamp tracker\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-560- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:561:static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-562-{\ndrivers/net/ethernet/intel/ice/ice_ptp.c:563:\tstruct ice_ptp_port *ptp_port;\ndrivers/net/ethernet/intel/ice/ice_ptp.c-564-\tunsigned long flags;\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-571-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:572:\tptp_port = container_of(tx, struct ice_ptp_port, tx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-573-\tpf = ptp_port_to_pf(ptp_port);\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-676-\t\t/* Extend the timestamp using cached PHC time */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:677:\t\ttstamp = ice_ptp_extend_40b_ts(pf, raw_tstamp);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-678-\t\tif (tstamp) {\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-692-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:693:static void ice_ptp_release_port_rcu(struct kref *ref)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-694-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-697-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:698:static void ice_ptp_tx_tstamp_owner(struct ice_pf *pf)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-699-{\ndrivers/net/ethernet/intel/ice/ice_ptp.c:700:\tstruct ice_ptp_port *port;\ndrivers/net/ethernet/intel/ice/ice_ptp.c-701-\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-703-\tlist_for_each_entry_rcu(port, \u0026pf-\u003eadapter-\u003eports.list, list_node) {\ndrivers/net/ethernet/intel/ice/ice_ptp.c:704:\t\tstruct ice_ptp_tx *tx = \u0026port-\u003etx;\ndrivers/net/ethernet/intel/ice/ice_ptp.c-705-\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-713-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:714:\t\tice_ptp_process_tx_tstamp(tx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-715-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:716:\t\tkref_put(\u0026port-\u003eref, ice_ptp_release_port_rcu);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-717-\t\trcu_read_lock();\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-722-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:723: * ice_ptp_alloc_tx_tracker - Initialize tracking for Tx timestamps\ndrivers/net/ethernet/intel/ice/ice_ptp.c-724- * @tx: Tx tracking structure to initialize\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-726- * Assumes that the length has already been initialized. Do not call directly,\ndrivers/net/ethernet/intel/ice/ice_ptp.c:727: * use the ice_ptp_init_tx_* instead.\ndrivers/net/ethernet/intel/ice/ice_ptp.c-728- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c=729=static int\ndrivers/net/ethernet/intel/ice/ice_ptp.c:730:ice_ptp_alloc_tx_tracker(struct ice_ptp_tx *tx)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-731-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=758=static void\ndrivers/net/ethernet/intel/ice/ice_ptp.c:759:ice_ptp_wait_for_tracker_drain(struct ice_pf *pf, struct ice_ptp_tx *tx)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-760-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-789-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:790: * ice_ptp_flush_tx_tracker - Flush any remaining timestamps from the tracker\ndrivers/net/ethernet/intel/ice/ice_ptp.c-791- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=796=static void\ndrivers/net/ethernet/intel/ice/ice_ptp.c:797:ice_ptp_flush_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-798-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-804-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:805:\tice_ptp_wait_for_tracker_drain(pf, tx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-806-\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-841-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:842: * ice_ptp_mark_tx_tracker_stale - Mark unfinished timestamps as stale\ndrivers/net/ethernet/intel/ice/ice_ptp.c-843- * @tx: the tracker to mark\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=850=static void\ndrivers/net/ethernet/intel/ice/ice_ptp.c:851:ice_ptp_mark_tx_tracker_stale(struct ice_ptp_tx *tx)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-852-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-860-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:861: * ice_ptp_flush_all_tx_tracker - Flush all timestamp trackers on this clock\ndrivers/net/ethernet/intel/ice/ice_ptp.c-862- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=867=static void\ndrivers/net/ethernet/intel/ice/ice_ptp.c:868:ice_ptp_flush_all_tx_tracker(struct ice_pf *pf)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-869-{\ndrivers/net/ethernet/intel/ice/ice_ptp.c:870:\tstruct ice_ptp_port *port;\ndrivers/net/ethernet/intel/ice/ice_ptp.c-871-\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-876-\t\trcu_read_unlock();\ndrivers/net/ethernet/intel/ice/ice_ptp.c:877:\t\tice_ptp_flush_tx_tracker(ptp_port_to_pf(port), \u0026port-\u003etx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c:878:\t\tkref_put(\u0026port-\u003eref, ice_ptp_release_port_rcu);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-879-\t\trcu_read_lock();\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-884-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:885: * ice_ptp_release_tx_tracker - Release allocated memory for Tx tracker\ndrivers/net/ethernet/intel/ice/ice_ptp.c-886- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=891=static void\ndrivers/net/ethernet/intel/ice/ice_ptp.c:892:ice_ptp_release_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-893-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-902-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:903:\tice_ptp_flush_tx_tracker(pf, tx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-904-\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-917-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:918: * ice_ptp_init_tx_e82x - Initialize tracking for Tx timestamps\ndrivers/net/ethernet/intel/ice/ice_ptp.c-919- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-929- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:930:static int ice_ptp_init_tx_e82x(struct ice_pf *pf, struct ice_ptp_tx *tx,\ndrivers/net/ethernet/intel/ice/ice_ptp.c-931-\t\t\t\tu8 port)\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-937-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:938:\treturn ice_ptp_alloc_tx_tracker(tx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-939-}\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-941-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:942: * ice_ptp_init_tx - Initialize tracking for Tx timestamps\ndrivers/net/ethernet/intel/ice/ice_ptp.c-943- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-951- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:952:static int ice_ptp_init_tx(struct ice_pf *pf, struct ice_ptp_tx *tx, u8 port)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-953-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-963-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:964:\treturn ice_ptp_alloc_tx_tracker(tx);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-965-}\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-967-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:968: * ice_ptp_update_cached_phctime - Update the cached PHC time values\ndrivers/net/ethernet/intel/ice/ice_ptp.c-969- * @pf: Board specific private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-983- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:984:static int ice_ptp_update_cached_phctime(struct ice_pf *pf)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-985-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1001-\t/* Read the current PHC time */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1002:\tsystime = ice_ptp_read_src_clk_reg(pf, NULL);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1003-\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1032-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1033: * ice_ptp_reset_cached_phctime - Reset cached PHC time after an update\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1034- * @pf: Board specific private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1044- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1045:static void ice_ptp_reset_cached_phctime(struct ice_pf *pf)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1046-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1052-\t */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1053:\terr = ice_ptp_update_cached_phctime(pf);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1054-\tif (err) {\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1068-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1069: * ice_ptp_write_init - Set PHC time to provided value\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1070- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1074- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1075:static int ice_ptp_write_init(struct ice_pf *pf, struct timespec64 *ts)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1076-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1079-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1080:\treturn ice_ptp_init_time(hw, ns);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1081-}\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1083-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1084: * ice_ptp_write_adj - Adjust PHC clock time atomically\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1085- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1090- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1091:static int ice_ptp_write_adj(struct ice_pf *pf, s32 adj)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1092-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1094-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1095:\treturn ice_ptp_adj_clock(hw, adj);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1096-}\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=1107=static u64 ice_base_incval(struct ice_pf *pf)\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1120-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1121: * ice_ptp_check_tx_fifo - Check whether Tx FIFO is in an OK state\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1122- * @port: PTP port for which Tx FIFO is checked\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1123- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1124:static int ice_ptp_check_tx_fifo(struct ice_ptp_port *port)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1125-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1171-\t\t\tport-\u003eport_num, quad);\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1172:\t\tice_ptp_reset_ts_memory_quad_e82x(hw, quad);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1173-\t\tport-\u003etx_fifo_busy_cnt = FIFO_OK;\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1180-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1181: * ice_ptp_wait_for_offsets - Check for valid Tx and Rx offsets\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1182- * @work: Pointer to the kthread_work structure for this task\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1194- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1195:static void ice_ptp_wait_for_offsets(struct kthread_work *work)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1196-{\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1197:\tstruct ice_ptp_port *port;\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1198-\tunsigned long flags;\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1203-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1204:\tport = container_of(work, struct ice_ptp_port, ov_work.work);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1205-\tpf = ptp_port_to_pf(port);\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1215-\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1216:\ttx_err = ice_ptp_check_tx_fifo(port);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1217-\tif (!tx_err)\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1245-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1246: * ice_ptp_port_phy_stop - Stop timestamping for a PHY port\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1247- * @ptp_port: PTP port to stop\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=1249=static int\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1250:ice_ptp_port_phy_stop(struct ice_ptp_port *ptp_port)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1251-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1284-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1285: * ice_ptp_port_phy_restart - (Re)start and calibrate PHY timestamping\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1286- * @ptp_port: PTP port for which the PHY start is set\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c=1292=static int\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1293:ice_ptp_port_phy_restart(struct ice_ptp_port *ptp_port)\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1294-{\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1301-\tif (!ptp_port-\u003elink_up)\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1302:\t\treturn ice_ptp_port_phy_stop(ptp_port);\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1303-\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1332-\t\t/* Do not clear calibrating flag here. Tx timestamps remain\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1333:\t\t * disabled until ice_ptp_wait_for_offsets() has verified\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1334-\t\t * that the Tx and Rx offset calibration has completed.\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1359-/**\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1360: * ice_ptp_link_change - Reconfigure PTP after link status change\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1361- * @pf: Board private structure\n--\ndrivers/net/ethernet/intel/ice/ice_ptp.c-1363- */\ndrivers/net/ethernet/intel/ice/ice_ptp.c:1364:void ice_ptp_link_change(struct ice_pf *pf, bool linkup)\n\n"
}

5/2 2026/08/22 01:09 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 28997
							output: 94
							thoughts: 1388
						

Thoughts:
**WorthFuzzing Assessment: ice Driver**

Okay, so I'm looking at this patch and my initial thought is that it's targeting the `ice` driver, which I know is for Intel's E800 series NICs. The problem is, QEMU, which is our standard fuzzing environment, doesn't emulate the E800 series.

I was thinking about the syzkaller PCI fuzzer, wondering if it could somehow reach into the `ice` driver's PTP logic.  I was going to see if syzkaller even has any descriptions for `ice`, but then I saw that the tools I need (`read-syz-spec` and `syz-grepper`) aren't actually available to me here. It's a bit of a red herring, the prompt specifically says to use other tools.

Then I re-read the prompt's rules for `WorthFuzzing=false`. It says to return `false` if the patch affects "vendor-specific PCIe switch, SmartNIC, or GPU drivers... that require physical PCIe hardware cards not emulated in standard QEMU."  I immediately thought that `ice` could be a SmartNIC, but after some reflection it's a standard NIC that just requires physical PCIe hardware not emulated in QEMU.

Given that `ice` is an Ethernet driver for the Intel E800 series and isn't emulated in QEMU, it necessitates physical PCIe hardware. The prompt gives some examples of similar drivers, like `mlxsw`, `pds_core`, `qed`, `ionic`, and `amdgpu`. `ice` isn't listed, but the logic still applies; `ice` isn't emulated and requires hardware.

I know syzkaller doesn't have emulation for this particular hardware. It uses `e1000`, `e1000e`, `virtio-net`, etc.  So, if `ice` is not emulated, the code paths are simply inaccessible in our virtualized environments.  I considered the PCI fuzzer again but realized it's unlikely to reach deep into complex driver logic like this, especially the PTP timestamping, PHY offset calibration, and link state change aspects that this patch is touching.

The prompt explicitly states to return `false` if the patch modifies "Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware". Since `ice` requires a physical PCIe card, I'm confident in saying the modified code is unreachable.

I also checked QEMU's supported network devices and confirmed there's no `ice`, `i40e`, or `ixgbe` emulation. All of the changes are contained within the `drivers/net/ethernet/intel/ice/` directory.

Thus, the patch deals exclusively with the `ice` driver, a driver that requires physical hardware not supported by standard QEMU.  Therefore, I'm going with `WorthFuzzing=false`. I'll use the `set-results` tool accordingly.



6/2 2026/08/22 01:10 tool set-results
0m Args:
{
  "EnableConfigs": [],
  "FocusSymbols": [],
  "Reasoning": "The patch exclusively modifies the Intel E800 series Ethernet driver (ice). This driver requires physical PCIe hardware that is not emulated in standard QEMU or GCE environments. Consequently, the modified code paths (such as PTP timestamping and PHY offset calibration) are unreachable during virtualized fuzzing.",
  "WorthFuzzing": false
}

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch exclusively modifies the Intel E800 series Ethernet driver (ice). This driver requires physical PCIe hardware that is not emulated in standard QEMU or GCE environments. Consequently, the modified code paths (such as PTP timestamping and PHY offset calibration) are unreachable during virtualized fuzzing.",
  "WorthFuzzing": false
}

7/1 2026/08/22 01:10 action If
0m Args:
{
  "WorthFuzzing": false
}

Results:
null

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)