Skip to contentSkip to conversation

ice: Reset procedure fixes

PATCH In review Sergey Temerkhanov 2 participants 5 messages Jul 15, 2024 – Jul 28, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover ice: Reset procedure fixes

Fixes preventing possible races between resets (CORER etc) and OICR ISR invocation / PTP hardware access

v1->v2: Patch rebase

Grzegorz Nitka (2):
ice: Fix reset handler
ice: Skip PTP HW writes during PTP reset procedure

 drivers/net/ethernet/intel/ice/ice_main.c | 2 ++
 drivers/net/ethernet/intel/ice/ice_ptp.c  | 4 ++++
 2 files changed, 6 insertions(+)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/2 ice: Fix reset handler

From: Grzegorz Nitka <[email protected]>

Synchronize OICR IRQ when preparing for reset to avoid potential race conditions between the reset procedure and OICR

Fixes 4aad5335969f ("ice: add individual interrupt allocation")
---
 drivers/net/ethernet/intel/ice/ice_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +2 -0
index e2990993b16f..3405fe749b25 100644
@@ -560,6 +560,8 @@ ice_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
 	if (test_bit(ICE_PREPARED_FOR_RESET, pf->state))
 		return;
 
+	synchronize_irq(pf->oicr_irq.virq);
+
 	ice_unplug_aux_dev(pf);
 
 	/* Notify VFs of impending reset */
Signature · 1 line
2.43.0
Tested-by on v2 1/2
#2 lore raw

RE: [Intel-wired-lan] [PATCH iwl-net v2 1/2] ice: Fix reset handler

Quoted 11 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Sergey Temerkhanov
Sent: Monday, July 15, 2024 9:09 PM
To: [email protected]
Cc: Temerkhanov, Sergey <[email protected]>; [email protected]; Kitszel, Przemyslaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v2 1/2] ice: Fix reset handler

From: Grzegorz Nitka <[email protected]>

Synchronize OICR IRQ when preparing for reset to avoid potential race conditions between the reset procedure and OICR

Quoted 8 lines
Fixes 4aad5335969f ("ice: add individual interrupt allocation")
---
 drivers/net/ethernet/intel/ice/ice_main.c | 2 ++
 1 file changed, 2 insertions(+)
#3 lore raw

PATCH v2 2/2 ice: Skip PTP HW writes during PTP reset procedure

In reply to Sergey Temerkhanov

From: Grzegorz Nitka <[email protected]>

Block HW write access for the driver while the device is in reset to avoid potential race condition and access to the PTP HW in non-nominal state which could lead to undesired effects

Fixes 4aad5335969f ("ice: add individual interrupt allocation")
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/intel/ice/ice_ptp.c +4 -0
index 11fbf2bbcae7..40a07d0bb341 100644
@@ -1408,6 +1408,10 @@ void ice_ptp_link_change(struct ice_pf *pf, u8 port, bool linkup)
 	/* Update cached link status for this port immediately */
 	ptp_port->link_up = linkup;
 
+	/* Skip HW writes if reset is in progress */
+	if (pf->hw.reset_ongoing)
+		return;
+
 	switch (hw->ptp.phy_model) {
 	case ICE_PHY_E810:
 		/* Do not reconfigure E810 PHY */
Signature · 1 line
2.43.0
Tested-by on v2 2/2
#4 lore raw

RE: [Intel-wired-lan] [PATCH iwl-net v2 2/2] ice: Skip PTP HW writes during PTP reset procedure

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Sergey Temerkhanov
Sent: Monday, July 15, 2024 9:09 PM
To: [email protected]
Cc: Temerkhanov, Sergey <[email protected]>; [email protected]; Kolacinski, Karol <[email protected]>; Kitszel, Przemyslaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v2 2/2] ice: Skip PTP HW writes during PTP reset procedure

From: Grzegorz Nitka <[email protected]>

Block HW write access for the driver while the device is in reset to avoid potential race condition and access to the PTP HW in non-nominal state which could lead to undesired effects

Fixes 4aad5335969f ("ice: add individual interrupt allocation")
Quoted 4 lines
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 4 ++++
 1 file changed, 4 insertions(+)