ice: fix null-ptr dereference on false-positive tx timeout
Subsystems (3)
PATCH 1/1 ice: fix null-ptr dereference on false-positive tx timeout
From: Michal Kubiak <[email protected]>
Due to some kernel bugs the Tx timeout event may be false-positive. For example, the kernel commit 95ecba62e2fd ("net: fix races in netdev_tx_sent_queue()/dev_watchdog()") fixes race conditions that can also occur during the ice driver initialization.
In case of such false-positive Tx timeouts there can be no real Tx transaction started, so the SKB pointer can be NULL. Therefore, the call devlink_fmsg_dump_skb() can crash because of NULL-ptr dereference.
Fix that by checking the SKB pointer before dereferencing it.
---
drivers/net/ethernet/intel/ice/devlink/health.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/devlink/health.c +2 -1
@@ -409,7 +409,8 @@ static int ice_tx_hang_reporter_dump(struct devlink_health_reporter *reporter,ice_fmsg_put_ptr (fmsg,"skb-ptr" , skb);devlink_fmsg_binary_pair_put (fmsg,"desc" , event->tx_ring->desc, event->tx_ring->count *sizeof (struct ice_tx_desc )); -devlink_fmsg_dump_skb (fmsg, skb); +if (skb) +devlink_fmsg_dump_skb (fmsg, skb);devlink_fmsg_obj_nest_end (fmsg);return 0 ;
Signature · 1 line
2.52.0
PATCH 1/1 ice: fix locking around wait_event_interruptible_locked_irq
From: Jacob Keller <[email protected]>
Commit 50327223a8bb ("ice: add lock to protect low latency interface") introduced a wait queue used to protect the low latency timer interface. The queue is used with the wait_event_interruptible_locked_irq macro, which unlocks the wait queue lock while sleeping. The irq variant uses spin_lock_irq and spin_unlock_irq to manage this. The wait queue lock was previously locked using spin_lock_irqsave. This difference in lock variants could lead to issues, since wait_event would unlock the wait queue and restore interrupts while sleeping.
The ice_read_phy_tstamp_ll_e810() function is ultimately called through ice_read_phy_tstamp, which is called from ice_ptp_process_tx_tstamp or ice_ptp_clear_unexpected_tx_ready. The former is called through the miscellaneous IRQ thread function, while the latter is called from the service task work queue thread. Neither of these functions has interrupts disabled, so use spin_lock_irq instead of spin_lock_irqsave.
---
drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_ptp_hw.c +4 -5
@@ -4323,18 +4323,17 @@ static int ice_read_phy_tstamp_ll_e810(struct ice_hw *hw, u8 idx, u8 *hi, u32 *lo) { struct ice_e810_params *params = &hw->ptp.phy.e810; -unsigned long flags;u32 val;int err; -spin_lock_irqsave (¶ms->atqbal_wq.lock, flags); +spin_lock_irq (¶ms->atqbal_wq.lock);/* Wait for any pending in-progress low latency interrupt */ err =wait_event_interruptible_locked_irq (params->atqbal_wq, !(params->atqbal_flags &ATQBAL_FLAGS_INTR_IN_PROGRESS ));if (err) { -spin_unlock_irqrestore (¶ms->atqbal_wq.lock, flags); +spin_unlock_irq (¶ms->atqbal_wq.lock);return err; }
@@ -4349,7 +4348,7 @@ ice_read_phy_tstamp_ll_e810(struct ice_hw *hw, u8 idx, u8 *hi, u32 *lo) REG_LL_PROXY_H);if (err) {ice_debug (hw,ICE_DBG_PTP ,"Failed to read PTP timestamp using low latency read\n" ); -spin_unlock_irqrestore (¶ms->atqbal_wq.lock, flags); +spin_unlock_irq (¶ms->atqbal_wq.lock);return err; }
@@ -4359,7 +4358,7 @@ ice_read_phy_tstamp_ll_e810(struct ice_hw *hw, u8 idx, u8 *hi, u32 *lo)/* Read the low 32 bit value and set the TS valid bit */ *lo =rd32 (hw,REG_LL_PROXY_L ) |TS_VALID ; -spin_unlock_irqrestore (¶ms->atqbal_wq.lock, flags); +spin_unlock_irq (¶ms->atqbal_wq.lock);return 0 ; }
Signature · 1 line
2.52.0
Re: [PATCH net] ice: fix locking around wait_event_interruptible_locked_irq
Quoted 18 lines · Aleksandr Loktionov
From: Jacob Keller <[email protected]>
Commit
50327223a8bb("ice: add lock to protect low latency interface") introduced a wait queue used to protect the low latency timer interface. The queue is used with thewait_event_interruptible_locked_irqmacro, which unlocks the wait queue lock while sleeping. The irq variant usesspin_lock_irqandspin_unlock_irqto manage this. The wait queue lock was previously locked usingspin_lock_irqsave. This difference in lock variants could lead to issues, sincewait_eventwould unlock the wait queue and restore interrupts while sleeping.The
ice_read_phy_tstamp_ll_e810()function is ultimately called throughice_read_phy_tstamp, which is called fromice_ptp_process_tx_tstamporice_ptp_clear_unexpected_tx_ready. The former is called through the miscellaneous IRQ thread function, while the latter is called from the service task work queue thread. Neither of these functions has interrupts disabled, so usespin_lock_irqinstead ofspin_lock_irqsave.
Quoted 6 lines
Fixes 50327223a8bb ("ice: add lock to protect low latency interface")Reported-by Jakub Kicinski <[email protected]>Signed-off-by Jacob Keller <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>
RE: [Intel-wired-lan] [PATCH net] ice: fix locking around wait_event_interruptible_locked_irq
In reply to Aleksandr LoktionovQuoted 20 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Aleksandr Loktionov
Sent: 27 March 2026 12:53
To: [email protected]; Nguyen, Anthony L <[email protected]>; Loktionov, Aleksandr <[email protected]>
Cc: [email protected]; Keller, Jacob E <[email protected]>; Jakub Kicinski <[email protected]>
Subject: [Intel-wired-lan] [PATCH net] ice: fix locking aroundwait_event_interruptible_locked_irqFrom: Jacob Keller <[email protected]>
Commit
50327223a8bb("ice: add lock to protect low latency interface") introduced a wait queue used to protect the low latency timer interface.
The queue is used with thewait_event_interruptible_locked_irqmacro, which unlocks the wait queue lock while sleeping. The irq variant usesspin_lock_irqandspin_unlock_irqto manage this. The wait queue lock was previously locked usingspin_lock_irqsave. This difference in lock variants could lead to issues, sincewait_eventwould unlock the wait queue and restore interrupts while sleeping.The
ice_read_phy_tstamp_ll_e810()function is ultimately called throughice_read_phy_tstamp, which is called fromice_ptp_process_tx_tstamporice_ptp_clear_unexpected_tx_ready. The former is called through the miscellaneous IRQ thread function, while the latter is called from the service task work queue thread. Neither of these functions has interrupts disabled, so usespin_lock_irqinstead ofspin_lock_irqsave.Fixes 50327223a8bb ("ice: add lock to protect low latency interface")Reported-by Jakub Kicinski <[email protected]>Signed-off-by Jacob Keller <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>
Quoted 5 lines
---
drivers/net/ethernet/intel/ice/ice_ptp_hw.c| 9 ++++-----1 file changed, 4 insertions(+), 5 deletions(-)
PATCH 1/1 ice: fix PTP Call Trace during PTP release
In reply to Aleksandr LoktionovFrom: Paul Greenwalt <[email protected]>
If a PF reset occurs when the PTP state is ICE_PTP_UNINIT, then ice_ptp_rebuild() will update the state to ICE_PTP_ERROR. This will result in the following PTP release call trace during driver unload:
kernel BUG at lib/list_debug.c:52!
ice_ptp_release+0x332/0x3c0 [ice]
ice_deinit_features.part.0+0x10e/0x120 [ice]
ice_remove+0x100/0x220 [ice]This was observed when passing PF1 through to a VM. ice_ptp_init() fails because ctrl_pf is NULL and sets the state to ICE_PTP_UNINIT.
Fix by detecting the ICE_PTP_UNINIT state in ice_ptp_rebuild() and returning without error, preventing the invalid state transition to ICE_PTP_ERROR. The only valid path to ICE_PTP_ERROR is from ICE_PTP_RESETTING after a failed rebuild.
---
drivers/net/ethernet/intel/ice/ice_ptp.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/ice/ice_ptp.c +5 -0
@@ -3041,6 +3041,11 @@ void ice_ptp_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)struct ice_ptp *ptp = &pf->ptp;int err; +if (ptp->state ==ICE_PTP_UNINIT ) { +dev_dbg (ice_pf_to_dev (pf),"PTP was not initialized, skipping rebuild\n" ); +return ; + } +if (ptp->state ==ICE_PTP_READY ) {ice_ptp_prepare_for_reset (pf, reset_type); }else if (ptp->state !=ICE_PTP_RESETTING ) {
Signature · 1 line
2.52.0
Re: [PATCH net] ice: fix PTP Call Trace during PTP release
Quoted 19 lines · Aleksandr Loktionov
From: Paul Greenwalt <[email protected]>
If a PF reset occurs when the PTP state is
ICE_PTP_UNINIT, thenice_ptp_rebuild()will update the state toICE_PTP_ERROR. This will result in the following PTP release call trace during driver unload:kernel BUG at lib/list_debug.c:52! ice_ptp_release+0x332/0x3c0 [ice] ice_deinit_features.part.0+0x10e/0x120 [ice] ice_remove+0x100/0x220 [ice]This was observed when passing PF1 through to a VM.
ice_ptp_init()fails becausectrl_pfis NULL and sets the state toICE_PTP_UNINIT.Fix by detecting the
ICE_PTP_UNINITstate inice_ptp_rebuild()and returning without error, preventing the invalid state transition toICE_PTP_ERROR. The only valid path toICE_PTP_ERRORis fromICE_PTP_RESETTINGafter a failed rebuild.
Quoted 4 lines
Fixes 8293e4cb2ff5 ("ice: introduce PTP state machine")Signed-off-by Paul Greenwalt <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>
RE: [Intel-wired-lan] [PATCH net] ice: fix PTP Call Trace during PTP release
In reply to Aleksandr LoktionovQuoted 21 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Aleksandr Loktionov
Sent: 27 March 2026 12:53
To: [email protected]; Nguyen, Anthony L <[email protected]>; Loktionov, Aleksandr <[email protected]>
Cc: [email protected]; Greenwalt, Paul <[email protected]>
Subject: [Intel-wired-lan] [PATCH net] ice: fix PTP Call Trace during PTP releaseFrom: Paul Greenwalt <[email protected]>
If a PF reset occurs when the PTP state is
ICE_PTP_UNINIT, thenice_ptp_rebuild()will update the state toICE_PTP_ERROR. This will result in the following PTP release call trace during driver unload:kernel BUG at lib/list_debug.c:52! ice_ptp_release+0x332/0x3c0 [ice] ice_deinit_features.part.0+0x10e/0x120 [ice] ice_remove+0x100/0x220 [ice]This was observed when passing PF1 through to a VM.
ice_ptp_init()fails becausectrl_pfis NULL and sets the state toICE_PTP_UNINIT.Fix by detecting the
ICE_PTP_UNINITstate inice_ptp_rebuild()and returning without error, preventing the invalid state transition toICE_PTP_ERROR. The only valid path toICE_PTP_ERRORis fromICE_PTP_RESETTINGafter a failed rebuild.
Quoted 9 lines
Fixes 8293e4cb2ff5 ("ice: introduce PTP state machine")Signed-off-by Paul Greenwalt <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice_ptp.c| 5 +++++1 file changed, 5 insertions(+)
PATCH 1/1 ice: fix PTP hang for E825C devices
In reply to Aleksandr LoktionovFrom: Grzegorz Nitka <[email protected]>
Change the order of PTP reconfiguration when port goes down or up (ice_down and ice_up calls) to be more graceful and consistent from timestamp interrupts processing perspective.
For both calls (ice_up and ice_down), accompanying ice_ptp_link_change is called which starts/stops PTP timer. This patch changes the order:
- while link goes down: disable net device Tx first (netif_carrier_off, netif_tx_disable), then call ice_ptp_link_change
- while link goes up: ice_ptp_link_change called first, then re-enable net device Tx (netif_tx_start_all_queues)
Otherwise, there is a narrow window in which PTP timestamp request has been triggered and timestamp processing occurs when PTP timer is not enabled yet (up case) or already disabled (down case). This may lead to undefined behavior and receiving invalid timestamps. This case was observed on E825C devices only.
---
drivers/net/ethernet/intel/ice/ice_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +2 -2
@@ -6797,10 +6797,10 @@ static int ice_up_complete(struct ice_vsi *vsi) (vsi->port_info->phy.link_info.link_info & ICE_AQ_LINK_UP) && ((vsi->netdev && (vsi->type == ICE_VSI_PF || vsi->type == ICE_VSI_SF)))) { +ice_ptp_link_change (pf, true);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
@@ -7328,9 +7328,9 @@ 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); +ice_ptp_link_change (vsi->back, false); }ice_vsi_dis_irq (vsi);
Signature · 1 line
2.52.0
Re: [PATCH net] ice: fix PTP hang for E825C devices
Quoted 19 lines · Aleksandr Loktionov
From: Grzegorz Nitka <[email protected]>
Change the order of PTP reconfiguration when port goes down or up (
ice_downandice_upcalls) to be more graceful and consistent from timestamp interrupts processing perspective.For both calls (
ice_upandice_down), accompanyingice_ptp_link_changeis called which starts/stops PTP timer. This patch changes the order:
- while link goes down: disable net device Tx first (netif_carrier_off,netif_tx_disable), then callice_ptp_link_change
- while link goes up:ice_ptp_link_changecalled first, then re-enable net device Tx (netif_tx_start_all_queues)Otherwise, there is a narrow window in which PTP timestamp request has been triggered and timestamp processing occurs when PTP timer is not enabled yet (up case) or already disabled (down case). This may lead to undefined behavior and receiving invalid timestamps. This case was observed on E825C devices only.
Quoted 4 lines
Fixes 6b1ff5d39228 ("ice: always call ice_ptp_link_change and make it void")Signed-off-by Grzegorz Nitka <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>
RE: [Intel-wired-lan] [PATCH net] ice: fix PTP hang for E825C devices
In reply to Aleksandr LoktionovQuoted 19 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Aleksandr Loktionov
Sent: 27 March 2026 12:53
To: [email protected]; Nguyen, Anthony L <[email protected]>; Loktionov, Aleksandr <[email protected]>
Cc: [email protected]
Subject: [Intel-wired-lan] [PATCH net] ice: fix PTP hang for E825C devicesFrom: Grzegorz Nitka <[email protected]>
Change the order of PTP reconfiguration when port goes down or up (
ice_downandice_upcalls) to be more graceful and consistent from timestamp interrupts processing perspective.For both calls (
ice_upandice_down), accompanyingice_ptp_link_changeis called which starts/stops PTP timer. This patch changes the order:
- while link goes down: disable net device Tx first (netif_carrier_off,netif_tx_disable), then callice_ptp_link_change
- while link goes up:ice_ptp_link_changecalled first, then re-enable
net device Tx (netif_tx_start_all_queues)Otherwise, there is a narrow window in which PTP timestamp request has been triggered and timestamp processing occurs when PTP timer is not enabled yet (up case) or already disabled (down case). This may lead > to undefined behavior and receiving invalid timestamps. This case was observed on E825C devices only.
Quoted 9 lines
Fixes 6b1ff5d39228 ("ice: always call ice_ptp_link_change and make it void")Signed-off-by Grzegorz Nitka <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice_main.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
Re: [Intel-wired-lan] [PATCH net] ice: fix PTP hang for E825C devices
In reply to Aleksandr LoktionovQuoted 45 lines · Aleksandr Loktionov
From: Grzegorz Nitka <[email protected]>
Change the order of PTP reconfiguration when port goes down or up (
ice_downandice_upcalls) to be more graceful and consistent from timestamp interrupts processing perspective.For both calls (
ice_upandice_down), accompanyingice_ptp_link_changeis called which starts/stops PTP timer. This patch changes the order:
- while link goes down: disable net device Tx first (netif_carrier_off,netif_tx_disable), then callice_ptp_link_change
- while link goes up:ice_ptp_link_changecalled first, then re-enable net device Tx (netif_tx_start_all_queues)Otherwise, there is a narrow window in which PTP timestamp request has been triggered and timestamp processing occurs when PTP timer is not enabled yet (up case) or already disabled (down case). This may lead to undefined behavior and receiving invalid timestamps. This case was observed on E825C devices only.
Fixes 6b1ff5d39228 ("ice: always call ice_ptp_link_change and make it void")Signed-off-by Grzegorz Nitka <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/ice/ice_main.c +1
-1@@ -6797,10 +6797,10 @@ static int ice_up_complete(struct ice_vsi *vsi) (vsi->port_info->phy.link_info.link_info & ICE_AQ_LINK_UP) && ((vsi->netdev && (vsi->type == ICE_VSI_PF || vsi->type == ICE_VSI_SF)))) { +ice_ptp_link_change (pf, true);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
drivers/net/ethernet/intel/ice/ice_main.c int ice_down(struct ice_vsi *vsi) · line 7336
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_main.c +1
-1@@ -7328,9 +7328,9 @@ 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); +ice_ptp_link_change (vsi->back, false); }ice_vsi_dis_irq (vsi);
I cannot find this patch applied anywhere... IWL patchwork indicates Changes Requested... I don't know why...
Thanks,
Ivan
Tony Nguyen
maintainerRe: [Intel-wired-lan] [PATCH net] ice: fix PTP hang for E825C devices
Quoted 47 lines · Ivan Vecera
Quoted 46 lines · Aleksandr Loktionov
From: Grzegorz Nitka <[email protected]>
Change the order of PTP reconfiguration when port goes down or up (
ice_downandice_upcalls) to be more graceful and consistent from timestamp interrupts processing perspective.For both calls (
ice_upandice_down), accompanyingice_ptp_link_changeis called which starts/stops PTP timer. This patch changes the order:
- while link goes down: disable net device Tx first (netif_carrier_off,netif_tx_disable), then callice_ptp_link_change
- while link goes up:ice_ptp_link_changecalled first, then re-enable net device Tx (netif_tx_start_all_queues)Otherwise, there is a narrow window in which PTP timestamp request has been triggered and timestamp processing occurs when PTP timer is not enabled yet (up case) or already disabled (down case). This may lead to undefined behavior and receiving invalid timestamps. This case was observed on E825C devices only.
Fixes 6b1ff5d39228 ("ice: always call ice_ptp_link_change and make it void")Signed-off-by Grzegorz Nitka <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice_main.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/ice/ice_main.c +0
-0@@ -6797,10 +6797,10 @@ static int ice_up_complete(struct ice_vsi *vsi)(
vsi->port_info->phy.link_info.link_info&ICE_AQ_LINK_UP) && ((vsi->netdev&& (vsi->type==ICE_VSI_PF||vsi->type==ICE_VSI_SF)))) {
+ice_ptp_link_change(pf, true);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 todrivers/net/ethernet/intel/ice/ice_main.c +0
-0@@ -7328,9 +7328,9 @@ int ice_down(struct ice_vsi *vsi) if (vsi->netdev) { vlan_err = ice_vsi_del_vlan_zero(vsi);
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_main.c int ice_down(struct ice_vsi *vsi) · line 7336
Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_main.c +1
-1- ice_ptp_link_change(vsi->back, false); netif_carrier_off(vsi->netdev); netif_tx_disable(vsi->netdev); + ice_ptp_link_change(vsi->back, false); } ice_vsi_dis_irq(vsi);I cannot find this patch applied anywhere... IWL patchwork indicates Changes Requested... I don't know why...
Hi Ivan,
The send to netdev had a couple things flagged by Sashiko:
https://lore.kernel.org/netdev/[email protected]/#t
We are looking to make the change that Jake mentioned "separating the PTP link state from the admin up/down state entirely."
Thanks,
Tony
RE: [Intel-wired-lan] [PATCH net] ice: fix PTP hang for E825C devices
Quoted 78 lines
-----Original Message-----
From: Nguyen, Anthony L <[email protected]>
Sent: Thursday, May 28, 2026 7:00 PM
To: Vecera, Ivan <[email protected]>; Loktionov, Aleksandr <[email protected]>; [email protected]; Nitka, Grzegorz <[email protected]>; Keller, Jacob E <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-wired-lan] [PATCH net] ice: fix PTP hang for E825C devicesQuoted 50 lines · Ivan Vecera
Quoted 49 lines · Aleksandr Loktionov
From: Grzegorz Nitka <[email protected]>
Change the order of PTP reconfiguration when port goes down or up (
ice_downandice_upcalls) to be more graceful and consistent from timestamp interrupts processing perspective.For both calls (
ice_upandice_down), accompanyingice_ptp_link_changeis called which starts/stops PTP timer. This patch changes the order:
- while link goes down: disable net device Tx first (netif_carrier_off,netif_tx_disable), then callice_ptp_link_change
- while link goes up:ice_ptp_link_changecalled first, then re-enable net device Tx (netif_tx_start_all_queues)Otherwise, there is a narrow window in which PTP timestamp request has been triggered and timestamp processing occurs when PTP timer is not enabled yet (up case) or already disabled (down case). This may lead to undefined behavior and receiving invalid timestamps. This case was observed on E825C devices only.
Fixes 6b1ff5d39228 ("ice: always call ice_ptp_link_change and make itvoid")
Signed-off-by Grzegorz Nitka <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice_main.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ renamed from drivers/net/ethernet/intel/ice/ice_main.c +0
-0
ethernet/intel/ice/ice_main.c
index e7308e3..8896805 100644drivers/net/ethernet/intel/ice/ice_main.c +0
-0@@ -6797,10 +6797,10 @@ static int ice_up_complete(struct ice_vsi *vsi)(
vsi->port_info->phy.link_info.link_info&ICE_AQ_LINK_UP) && ((vsi->netdev&& (vsi->type==ICE_VSI_PF||vsi->type==ICE_VSI_SF)))) {
+ice_ptp_link_change(pf, true);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 todrivers/net/ethernet/intel/ice/ice_main.c +0
-1@@ -7328,9 +7328,9 @@ 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);Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_main.c int ice_down(struct ice_vsi *vsi) · line 7336
Quoted 5 lines
drivers/net/ethernet/intel/ice/ice_main.c +1
-0netif_carrier_off(vsi->netdev); netif_tx_disable(vsi->netdev); + ice_ptp_link_change(vsi->back, false); } ice_vsi_dis_irq(vsi);I cannot find this patch applied anywhere... IWL patchwork indicates Changes Requested... I don't know why...
Hi Ivan,
The send to netdev had a couple things flagged by Sashiko:
Quoted 8 lines
https://lore.kernel.org/netdev/0558de37-fb75-428f-98d9-
[email protected]/#tWe are looking to make the change that Jake mentioned "separating the PTP link state from the admin up/down state entirely."
Thanks,
Tony
FYI ... Arek is testing alternative solution at the moment.
Regards
Grzegorz
PATCH 1/1 ice: fix setting promisc mode while adding VID filter
In reply to Aleksandr LoktionovFrom: Marcin Szycik <[email protected]>
There are at least two paths through which VSI promiscuous mode can be independently configured via ice_fltr_set_vsi_promisc():
- ice_vlan_rx_add_vid() (netdev op)
- ice_service_task() -> ... -> ice_set_promisc()
Both paths may try to program promiscuous mode concurrently. One such scenario is:
1. Add ice netdev to bond
2. Add the bond netdev to bridge
3. ice netdev enters allmulticast mode (IFF_ALLMULTI)
4. Service task programs promisc mode filter
5. Bridge -> bond calls ice_vlan_rx_add_vid()
Crucially, ice_vlan_rx_add_vid() fails if ice_fltr_set_vsi_promisc() returns any error, including -EEXIST. This causes VLAN filtering setup to fail on the bond interface. ice_set_promisc() already handles -EEXIST correctly.
Fix by adding the same -EEXIST check to ice_vlan_rx_add_vid(): if the promisc filter is already programmed, continue without returning error.
---
drivers/net/ethernet/intel/ice/ice_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_main.c +1 -1
@@ -3755,7 +3755,7 @@ int ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid) ret =ice_fltr_set_vsi_promisc (&vsi->back->hw, vsi->idx,ICE_MCAST_VLAN_PROMISC_BITS , vid); -if (ret) +if (ret && ret != -EEXIST ) goto finish; }
Signature · 1 line
2.52.0
Re: [PATCH net] ice: fix setting promisc mode while adding VID filter
Quoted 21 lines · Aleksandr Loktionov
From: Marcin Szycik <[email protected]>
There are at least two paths through which VSI promiscuous mode can be independently configured via
ice_fltr_set_vsi_promisc():
-ice_vlan_rx_add_vid()(netdev op)
-ice_service_task()-> ... ->ice_set_promisc()Both paths may try to program promiscuous mode concurrently. One such scenario is:
1. Add ice netdev to bond
2. Add the bond netdev to bridge
3. ice netdev enters allmulticast mode (IFF_ALLMULTI)
4. Service task programs promisc mode filter
5. Bridge -> bond callsice_vlan_rx_add_vid()Crucially,
ice_vlan_rx_add_vid()fails ifice_fltr_set_vsi_promisc()returns any error, including-EEXIST. This causes VLAN filtering setup to fail on the bond interface.ice_set_promisc()already handles-EEXISTcorrectly.
Quoted 7 lines
Fix by adding the same
-EEXISTcheck toice_vlan_rx_add_vid(): if the promisc filter is already programmed, continue without returning error.Fixes 1273f89578f2 ("ice: Fix broken IFF_ALLMULTI handling")Signed-off-by Marcin Szycik <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>
RE: [Intel-wired-lan] [PATCH net] ice: fix setting promisc mode while adding VID filter
In reply to Aleksandr LoktionovQuoted 23 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Aleksandr Loktionov
Sent: 27 March 2026 12:53
To: [email protected]; Nguyen, Anthony L <[email protected]>; Loktionov, Aleksandr <[email protected]>
Cc: [email protected]; Szycik, Marcin <[email protected]>
Subject: [Intel-wired-lan] [PATCH net] ice: fix setting promisc mode while adding VID filterFrom: Marcin Szycik <[email protected]>
There are at least two paths through which VSI promiscuous mode can be independently configured via
ice_fltr_set_vsi_promisc():
-ice_vlan_rx_add_vid()(netdev op)
-ice_service_task()-> ... ->ice_set_promisc()Both paths may try to program promiscuous mode concurrently. One such scenario is:
1. Add ice netdev to bond
2. Add the bond netdev to bridge
3. ice netdev enters allmulticast mode (IFF_ALLMULTI) 4. Service task programs promisc mode filter 5. Bridge -> bond callsice_vlan_rx_add_vid()Crucially,
ice_vlan_rx_add_vid()fails ifice_fltr_set_vsi_promisc()returns any error, including-EEXIST. This causes VLAN filtering setup to fail on the bond interface.ice_set_promisc()already handles-EEXISTcorrectly.Fix by adding the same
-EEXISTcheck toice_vlan_rx_add_vid(): if the promisc filter is already programmed, continue without returning error.
Quoted 9 lines
Fixes 1273f89578f2 ("ice: Fix broken IFF_ALLMULTI handling")Signed-off-by Marcin Szycik <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice_main.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 1/1 ice: fix ice_init_link() error return preventing probe
In reply to Aleksandr LoktionovFrom: Paul Greenwalt <[email protected]>
ice_init_link() can return an error status from ice_update_link_info() or ice_init_phy_user_cfg(), causing probe to fail.
An incorrect NVM update procedure can result in link/PHY errors, and the recommended resolution is to update the NVM using the correct procedure. If the driver fails probe due to link errors, the user cannot update the NVM to recover. The link/PHY errors logged are
non-fatal: they are already annotated as 'not a fatal error if this fails'.
Since none of the errors inside ice_init_link() should prevent probe from completing, convert it to void and remove the error check in the caller. All failures are already logged; callers have no meaningful recovery path for link init errors.
---
drivers/net/ethernet/intel/ice/ice_main.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +3 -9
@@ -4856,16 +4856,14 @@ static void ice_init_wakeup(struct ice_pf *pf)device_set_wakeup_enable (ice_pf_to_dev (pf), false); } -static int ice_init_link (struct ice_pf *pf) +static void ice_init_link (struct ice_pf *pf) {struct device *dev =ice_pf_to_dev (pf);int err; err =ice_init_link_events (pf->hw.port_info); -if (err) { +if (err)dev_err (dev,"ice_init_link_events failed: %d\n" , err); -return err; - }/* not a fatal error if this fails */ err =ice_init_nvm_phy_type (pf->hw.port_info);
@@ -4899,8 +4897,6 @@ static int ice_init_link(struct ice_pf *pf) }else {set_bit (ICE_FLAG_NO_MEDIA , pf->flags); } - -return err; }static int ice_init_pf_sw (struct ice_pf *pf)
@@ -5043,9 +5039,7 @@ static int ice_init(struct ice_pf *pf)ice_init_wakeup (pf); - err =ice_init_link (pf); -if (err) - goto err_init_link; +ice_init_link (pf); err =ice_send_version (pf);if (err)
Signature · 1 line
2.52.0
Re: [PATCH net] ice: fix ice_init_link() error return preventing probe
Quoted 17 lines · Aleksandr Loktionov
From: Paul Greenwalt <[email protected]>
ice_init_link()can return an error status fromice_update_link_info()orice_init_phy_user_cfg(), causing probe to fail.An incorrect NVM update procedure can result in link/PHY errors, and the recommended resolution is to update the NVM using the correct procedure. If the driver fails probe due to link errors, the user cannot update the NVM to recover. The link/PHY errors logged are
non-fatal: they are already annotated as 'not a fatal error if this fails'.Since none of the errors inside
ice_init_link()should prevent probe from completing, convert it to void and remove the error check in the caller. All failures are already logged; callers have no meaningful recovery path for link init errors.
Quoted 4 lines
Fixes 5b246e533d01 ("ice: split probe into smaller functions")Signed-off-by Paul Greenwalt <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>
The nit below notwithstanding, this looks good to me.
Quoted 6 lines
---
drivers/net/ethernet/intel/ice/ice_main.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)drivers/net/ethernet/intel/ice/ice_main.c +0
-0
...
drivers/net/ethernet/intel/ice/ice_main.c static int ice_init(struct ice_pf *pf) · line 5048
Quoted 7 lines
drivers/net/ethernet/intel/ice/ice_main.c +0
-3@@ -5043,9 +5039,7 @@ static int ice_init(struct ice_pf *pf)ice_init_wakeup (pf); - err =ice_init_link (pf); -if (err) - goto err_init_link;
I think now would be a good time to rename the err_init_link label, after what it does, rather than where it is (no longer) jumped from. And perhaps others in this function too
Quoted 7 lines
drivers/net/ethernet/intel/ice/ice_main.c +1
-0+ice_init_link (pf); err =ice_send_version (pf);if (err)Signature · 1 line
2.52.0
Simon Horman
reviewerRe: [PATCH net] ice: fix ice_init_link() error return preventing probe
Quoted 13 lines · Simon Horman
Quoted 12 lines · Aleksandr Loktionov
From: Paul Greenwalt <[email protected]>
ice_init_link()can return an error status fromice_update_link_info()orice_init_phy_user_cfg(), causing probe to fail.An incorrect NVM update procedure can result in link/PHY errors, and the recommended resolution is to update the NVM using the correct procedure. If the driver fails probe due to link errors, the user cannot update the NVM to recover. The link/PHY errors logged are
non-fatal: they are already annotated as 'not a fatal error if this fails'.
Quoted 6 lines
Quoted 6 lines
Since none of the errors inside
ice_init_link()should prevent probe from completing, convert it to void and remove the error check in the caller. All failures are already logged; callers have no meaningful recovery path for link init errors.Fixes 5b246e533d01 ("ice: split probe into smaller functions")
Sorry, one more thing.
I don't think this problem pre-dated the cited commit.
Quoted 36 lines
Quoted 3 lines
Signed-off-by Paul Greenwalt <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>The nit below notwithstanding, this looks good to me.
Reviewed-by Simon Horman <[email protected]>Quoted 6 lines
---
drivers/net/ethernet/intel/ice/ice_main.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)drivers/net/ethernet/intel/ice/ice_main.c +0
-0...
drivers/net/ethernet/intel/ice/ice_main.c static int ice_init(struct ice_pf *pf) · line 5048
Quoted 7 lines
drivers/net/ethernet/intel/ice/ice_main.c +0
-3@@ -5043,9 +5039,7 @@ static int ice_init(struct ice_pf *pf)ice_init_wakeup (pf); - err =ice_init_link (pf); -if (err) - goto err_init_link;I think now would be a good time to rename the
err_init_linklabel, after what it does, rather than where it is (no longer) jumped from. And perhaps others in this function tooQuoted 7 lines
drivers/net/ethernet/intel/ice/ice_main.c +1
-0+ice_init_link (pf); err =ice_send_version (pf);if (err)Signature · 1 line
2.52.0
PATCH 1/1 ice: fix netdev bring-up and bring-down in self-test
In reply to Aleksandr LoktionovFrom: Konstantin Ilichev <[email protected]>
When an offline self-test is initiated with ethtool -t, any ongoing traffic could get stuck because ice_stop() and ice_open() are called without letting the OS know about state transitions. In most cases a write() system call would block.
Fix this by calling dev_change_flags() to bring the netdev up and down, which ensures ndo_open()/ndo_stop() are called and all watchers are notified correctly.
---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_ethtool.c +5 -3
@@ -1416,7 +1416,7 @@ ice_self_test(struct net_device *netdev, struct ethtool_test *eth_test,/* If the device is online then take it offline */ if (if_running)/* indicate we're in test mode */ -ice_stop (netdev); +dev_change_flags (netdev, netdev->flags & ~IFF_UP ,NULL ); data[ICE_ETH_TEST_LINK ] =ice_link_test (netdev); data[ICE_ETH_TEST_EEPROM ] =ice_eeprom_test (netdev);
@@ -1434,10 +1434,12 @@ ice_self_test(struct net_device *netdev, struct ethtool_test *eth_test,clear_bit (ICE_TESTING , pf->state);if (if_running) { -int status =ice_open (netdev); +int status =dev_change_flags (netdev, + netdev->flags |IFF_UP , +NULL );if (status) { -dev_err (dev,"Could not open device %s, err %d\n" , +dev_err (dev,"Could not bring up device %s, err %d\n" , pf->int_name, status); } }
Signature · 1 line
2.52.0
Tony Nguyen
maintainerRe: [PATCH net] ice: fix netdev bring-up and bring-down in self-test
Quoted 10 lines · Aleksandr Loktionov
From: Konstantin Ilichev <[email protected]>
When an offline self-test is initiated with ethtool -t, any ongoing traffic could get stuck because
ice_stop()andice_open()are called without letting the OS know about state transitions. In most cases awrite()system call would block.Fix this by calling
dev_change_flags()to bring the netdev up and down, which ensures ndo_open()/ndo_stop() are called and all watchers are notified correctly.
+ Olek
AI review reports:
The ethtool core acquires the per-netdev mutex via netdev_lock_ops(dev) before invoking the driver's .self_test callback. dev_change_flags() is an exported API that explicitly re-acquires this exact same lock:
net/core/dev_api.c:dev_change_flags() {
...
netdev_lock_ops(dev);
ret = netif_change_flags(dev, flags, extack);
netdev_unlock_ops(dev);
...
}Because dev->lock is a standard, non-recursive mutex, this will result in a hard deadlock for any driver that opts into request_ops_lock. While ice might not currently set this flag, introducing nested lock acquisitions of the same mutex guarantees a deadlock as the subsystem migrates toward per-netdev locking.
With ice netdev lock changes in progress [1], this would soon become an issue.
Thanks,
Tony
[1] https://lore.kernel.org/netdev/[email protected]/
Quoted 39 lines
Fixes 0e674aeb0b77 ("ice: Add handler for ethtool selftest")Co-developed-by Grzegorz Nitka <[email protected]>Signed-off-by Grzegorz Nitka <[email protected]>Signed-off-by Konstantin Ilichev <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/net/ethernet/intel/ice/ice_ethtool.c +5
-3@@ -1416,7 +1416,7 @@ ice_self_test(struct net_device *netdev, struct ethtool_test *eth_test,/* If the device is online then take it offline */ if (if_running)/* indicate we're in test mode */ -ice_stop (netdev); +dev_change_flags (netdev, netdev->flags & ~IFF_UP ,NULL ); data[ICE_ETH_TEST_LINK ] =ice_link_test (netdev); data[ICE_ETH_TEST_EEPROM ] =ice_eeprom_test (netdev);@@ -1434,10 +1434,12 @@ ice_self_test(struct net_device *netdev, struct ethtool_test *eth_test,clear_bit (ICE_TESTING , pf->state);if (if_running) { -int status =ice_open (netdev); +int status =dev_change_flags (netdev, + netdev->flags |IFF_UP , +NULL );if (status) { -dev_err (dev,"Could not open device %s, err %d\n" , +dev_err (dev,"Could not bring up device %s, err %d\n" , pf->int_name, status); } }
Re: [PATCH net] ice: fix netdev bring-up and bring-down in self-test
From: Anthony Nguyen <[email protected]>
Date: Wed, 8 Apr 2026 14:12:28 -0700
Quoted 35 lines · Aleksandr Loktionov
Quoted 10 lines
From: Konstantin Ilichev <[email protected]>
When an offline self-test is initiated with ethtool -t, any ongoing traffic could get stuck because
ice_stop()andice_open()are called without letting the OS know about state transitions. In most cases awrite()system call would block.Fix this by calling
dev_change_flags()to bring the netdev up and down, which ensures ndo_open()/ndo_stop() are called and all watchers are notified correctly.+ Olek
AI review reports:
The ethtool core acquires the per-netdev mutex via
netdev_lock_ops(dev)before invoking the driver's .self_test callback.dev_change_flags()is an exported API that explicitly re-acquires this exact same lock:
net/core/dev_api.c:dev_change_flags() {
...
netdev_lock_ops(dev);
ret =netif_change_flags(dev, flags, extack);netdev_unlock_ops(dev);
...
}
Becausedev->lockis a standard, non-recursive mutex, this will result in a hard deadlock for any driver that opts intorequest_ops_lock. While ice might not currently set this flag, introducing nested lock acquisitions of the same mutex guarantees a deadlock as the subsystem migrates toward per-netdev locking.
Quoted 2 lines
With ice netdev lock changes in progress [1], this would soon become an issue.
Hmmm, seems like we'll need to either export netif_change_flags() or introduce something like dev_change_flags_locked()...
Quoted 32 lines
Thanks,
Tony[1] https://lore.kernel.org/netdev/20260325200644.2528726-4-
[email protected]/Quoted 25 lines
Fixes 0e674aeb0b77 ("ice: Add handler for ethtool selftest")Co-developed-by Grzegorz Nitka <[email protected]>Signed-off-by Grzegorz Nitka <[email protected]>Signed-off-by Konstantin Ilichev <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice_ethtool.c| 8 +++++---1 file changed, 5 insertions(+), 3 deletions(-)drivers/ renamed from drivers/net/ethernet/intel/ice/ice_ethtool.c +0
-0
net/ethernet/intel/ice/ice_ethtool.c
index 96d95af..2a4f06f 100644drivers/net/ethernet/intel/ice/ice_ethtool.c +1
-1@@ -1416,7 +1416,7 @@ ice_self_test(struct net_device *netdev, structethtool_test *eth_test, /* If the device is online then take it offline */ if (if_running) /* indicate we're in test mode */ - ice_stop(netdev); + dev_change_flags(netdev, netdev->flags & ~IFF_UP, NULL); data[ICE_ETH_TEST_LINK] = ice_link_test(netdev); data[ICE_ETH_TEST_EEPROM] = ice_eeprom_test(netdev);
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_ethtool.c ice_self_test(struct net_device *netdev, · line 1439
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_ethtool.c +3
-1@@ -1434,10 +1434,12 @@ ice_self_test(struct net_device *netdev,struct ethtool_test *eth_test, clear_bit(ICE_TESTING, pf->state); if (if_running) { - int status = ice_open(netdev); + int status = dev_change_flags(netdev, + netdev->flags | IFF_UP, + NULL);
BTW are you sure there's no other way to do an ifdown/ifup cycle other than sneaking into the flags? Have you checked whether there's an exported generic function which calls .ndo_open()?
Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_ethtool.c ice_self_test(struct net_device *netdev, struct ethtool_test *eth_test, · line 1445
Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_ethtool.c +1
-1if (status) { - dev_err(dev, "Could not open device %s, err %d\n", + dev_err(dev, "Could not bring up device %s, err %d\n", pf->int_name, status); } }
Thanks,
Olek
PATCH 1/1 ice: stop DCBNL requests during driver unload
In reply to Aleksandr LoktionovFrom: Dave Ertman <[email protected]>
With a chatty lldpad, DCB configuration requests can arrive through the DCBNL API while the driver is tearing down PF resources, leading to use-after-free and NULL dereference crashes.
Set ICE_SHUTTING_DOWN in pf->state at the start of ice_remove() and check this bit at the beginning of every DCBNL callback that accesses resources freed during the remove path.
---
drivers/net/ethernet/intel/ice/ice.h | 1 + drivers/net/ethernet/intel/ice/ice_dcb_nl.c | 46 +++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_main.c | 1 + 3 files changed, 48 insertions(+)
drivers/net/ethernet/intel/ice/ice.h +1 -0
@@ -283,6 +283,7 @@ enum ice_pf_state {ICE_EMPR_RECV ,/* set by OICR handler */ ICE_SUSPENDED ,/* set on module remove path */ ICE_RESET_FAILED ,/* set by reset/rebuild */ +ICE_SHUTTING_DOWN ,/* set on module remove path, before releasing resources */ /* When checking for the PF to be in a nominal operating state, the * bits that are grouped at the beginning of the list need to be * checked. Bits occurring before ICE_STATE_NOMINAL_CHECK_BITS will
drivers/net/ethernet/intel/ice/ice_dcb_nl.c +46 -0
184 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_main.c +1 -0
@@ -5424,6 +5424,7 @@ static void ice_remove(struct pci_dev *pdev)struct ice_pf *pf =pci_get_drvdata (pdev);int i; +set_bit (ICE_SHUTTING_DOWN , pf->state);for (i =0 ; i <ICE_MAX_RESET_WAIT ; i++) {if (!ice_is_reset_in_progress (pf->state))break ;
Signature · 1 line
2.52.0
Re: [PATCH net] ice: stop DCBNL requests during driver unload
Quoted 6 lines · Aleksandr Loktionov
From: Dave Ertman <[email protected]>
With a chatty lldpad, DCB configuration requests can arrive through the DCBNL API while the driver is tearing down PF resources, leading to use-after-free and NULL dereference crashes.
Quoted 8 lines
Set
ICE_SHUTTING_DOWNinpf->stateat the start ofice_remove()and check this bit at the beginning of every DCBNL callback that accesses resources freed during the remove path.Fixes b94b013eb626 ("ice: Implement DCBNL support")Signed-off-by Dave Ertman <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>
drivers/net/ethernet/intel/ice/ice_dcb_nl.c ice_dcbnl_get_pfc_cfg(struct net_device *netdev, int prio, u8 *setting) · line 333
Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_dcb_nl.c +2
-0@@ -308,6 +326,8 @@ ice_dcbnl_get_pfc_cfg(struct net_device *netdev, int prio, u8 *setting)struct ice_pf *pf =ice_netdev_to_pf (netdev);struct ice_port_info *pi = pf->hw.port_info; +if (test_bit (ICE_SHUTTING_DOWN , pf->state)) +return ;if ((pf->dcbx_cap &DCB_CAP_DCBX_LLD_MANAGED ) || !(pf->dcbx_cap &DCB_CAP_DCBX_VER_CEE ))return ;
I think this problem predates this patch. But AI review warns that callers pass an setting without initialising the data it points to, and expect it to be initialised on return. But that doesn't happen if the function exits early.
It suggests that callers should initialise *setting, and the AI generated review states this is the case for other callbacks. (I did not check this claim.)
It seems to me this is not strictly an ICE problem, although a quick scan showed up a mix of driver that ensure that the setting parameter is always initialised before return, and those that don't.
I think this problem is orthogonal to this patch, but seems to want fixing.
...
Tony Nguyen
maintainerRe: [PATCH net] ice: stop DCBNL requests during driver unload
In reply to Aleksandr LoktionovQuoted 30 lines · Aleksandr Loktionov
From: Dave Ertman <[email protected]>
With a chatty lldpad, DCB configuration requests can arrive through the DCBNL API while the driver is tearing down PF resources, leading to use-after-free and NULL dereference crashes.
Set
ICE_SHUTTING_DOWNinpf->stateat the start ofice_remove()and check this bit at the beginning of every DCBNL callback that accesses resources freed during the remove path.Fixes b94b013eb626 ("ice: Implement DCBNL support")Signed-off-by Dave Ertman <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice.h | 1 + drivers/net/ethernet/intel/ice/ice_dcb_nl.c | 46 +++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_main.c | 1 + 3 files changed, 48 insertions(+)drivers/net/ethernet/intel/ice/ice.h +1
-0@@ -283,6 +283,7 @@ enum ice_pf_state {ICE_EMPR_RECV ,/* set by OICR handler */ ICE_SUSPENDED ,/* set on module remove path */ ICE_RESET_FAILED ,/* set by reset/rebuild */ + ICE_SHUTTING_DOWN, /* set on module remove path, before releasing resources */
...
drivers/net/ethernet/intel/ice/ice_main.c static void ice_remove(struct pci_dev *pdev) · line 5427
Quoted 7 lines
drivers/net/ethernet/intel/ice/ice_main.c +1
-0@@ -5424,6 +5424,7 @@ static void ice_remove(struct pci_dev *pdev)struct ice_pf *pf =pci_get_drvdata (pdev);int i; +set_bit (ICE_SHUTTING_DOWN , pf->state);
Nit but can you name this ICE_REMOVING? Since this is in ice_remove() rather than ice_shutdown(), it seems more appropriate. Also it aligns with the naming used in ixgbe[vf].
This will need updating as well:
https://lore.kernel.org/intel-wired-lan/[email protected]/
Also, if you have dependencies on other patches, like the latter one, please wait until it's applied, otherwise, it will not go through the CI properly.
Thanks,
Tony
Quoted 3 lines
drivers/net/ethernet/intel/ice/ice_main.c +0
-0for (i =0 ; i <ICE_MAX_RESET_WAIT ; i++) {if (!ice_is_reset_in_progress (pf->state))break ;
PATCH 1/1 ice: use READ_ONCE() to access cached PHC time
In reply to Aleksandr LoktionovFrom: Sergey Temerkhanov <[email protected]>
ptp.cached_phc_time is a 64-bit value updated by a periodic work item on one CPU and read locklessly on another. On 32-bit or non-atomic architectures this can result in a torn read. Use READ_ONCE() to enforce a single atomic load.
---
drivers/net/ethernet/intel/ice/ice_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_ptp.c +1 -1
@@ -350,7 +350,7 @@ static u64 ice_ptp_extend_40b_ts(struct ice_pf *pf, u64 in_tstamp)return 0 ; } -return ice_ptp_extend_32b_ts (pf->ptp.cached_phc_time, +return ice_ptp_extend_32b_ts (READ_ONCE (pf->ptp.cached_phc_time), (in_tstamp >>8 ) & mask); }
Signature · 1 line
2.52.0
Re: [PATCH net] ice: use READ_ONCE() to access cached PHC time
Quoted 11 lines · Aleksandr Loktionov
From: Sergey Temerkhanov <[email protected]>
ptp.cached_phc_time is a 64-bit value updated by a periodic work item on one CPU and read locklessly on another. On 32-bit or non-atomic architectures this can result in a torn read. Use
READ_ONCE()to enforce a single atomic load.Fixes 77a781155a65 ("ice: enable receive hardware timestamping")Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>
RE: [Intel-wired-lan] [PATCH net] ice: use READ_ONCE() to access cached PHC time
In reply to Aleksandr LoktionovQuoted 11 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Aleksandr Loktionov
Sent: 27 March 2026 12:54
To: [email protected]; Nguyen, Anthony L <[email protected]>; Loktionov, Aleksandr <[email protected]>
Cc: [email protected]; Temerkhanov, Sergey <[email protected]>
Subject: [Intel-wired-lan] [PATCH net] ice: useREAD_ONCE()to access cached PHC timeFrom: Sergey Temerkhanov <[email protected]>
ptp.cached_phc_time is a 64-bit value updated by a periodic work item on one CPU and read locklessly on another. On 32-bit or non-atomic architectures this can result in a torn read. Use
READ_ONCE()to enforce a single atomic load.
Quoted 9 lines
Fixes 77a781155a65 ("ice: enable receive hardware timestamping")Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/ice_ptp.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Aleksandr Loktionov
Sent: 27 March 2026 12:53
To: [email protected]; Nguyen, Anthony L <[email protected]>; Loktionov, Aleksandr <[email protected]>
Cc: [email protected]
Subject: [Intel-wired-lan] [PATCH net] ice: fix null-ptr dereference on false-positive tx timeoutFrom: Michal Kubiak <[email protected]>
Due to some kernel bugs the Tx timeout event may be false-positive.
For example, the kernel commit95ecba62e2fd("net: fix races in netdev_tx_sent_queue()/dev_watchdog()") fixes race conditions that can also occur during the ice driver initialization.In case of such false-positive Tx timeouts there can be no real Tx transaction started, so the SKB pointer can be NULL. Therefore, the call
devlink_fmsg_dump_skb()can crash because of NULL-ptr dereference.Fix that by checking the SKB pointer before dereferencing it.
Quoted 9 lines
Fixes 2a82874a3b7b ("ice: add Tx hang devlink health reporter")Signed-off-by Michal Kubiak <[email protected]>Signed-off-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/ice/devlink/health.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)