Skip to contentSkip to conversation

ice: Schedule service task in IRQ thread_fn

PATCH Superseded Yochai Hagvi 2 participants 2 messages May 4, 2023 – May 8, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ice: Schedule service task in IRQ thread_fn

On some RT kernels, scheduling service task in interrupt context may result in a kernel panic. This is happenning due to queue_work call. Move ice_service_task_schedule to IRQ bottom half.

---
 drivers/net/ethernet/intel/ice/ice_main.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +4 -10
index 7c04057c524c..ecaf51b28b40 100644
@@ -3058,7 +3058,6 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
 {
 	struct ice_pf *pf = (struct ice_pf *)data;
 	struct ice_hw *hw = &pf->hw;
-	irqreturn_t ret = IRQ_NONE;
 	struct device *dev;
 	u32 oicr, ena_mask;
 
@@ -3137,11 +3136,8 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
 		}
 	}
 
-	if (oicr & PFINT_OICR_TSYN_TX_M) {
+	if (oicr & PFINT_OICR_TSYN_TX_M)
 		ena_mask &= ~PFINT_OICR_TSYN_TX_M;
-		if (!hw->reset_ongoing)
-			ret = IRQ_WAKE_THREAD;
-	}
 
 	if (oicr & PFINT_OICR_TSYN_EVNT_M) {
 		u8 tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned;
@@ -3172,16 +3168,12 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
 		if (oicr & (PFINT_OICR_PCI_EXCEPTION_M |
 			    PFINT_OICR_ECC_ERR_M)) {
 			set_bit(ICE_PFR_REQ, pf->state);
-			ice_service_task_schedule(pf);
 		}
 	}
-	if (!ret)
-		ret = IRQ_HANDLED;
 
-	ice_service_task_schedule(pf);
 	ice_irq_dynamic_ena(hw, NULL, NULL);
 
-	return ret;
+	return IRQ_WAKE_THREAD;
 }
 
 /**
@@ -3196,6 +3188,8 @@ static irqreturn_t ice_misc_intr_thread_fn(int __always_unused irq, void *data)
 	if (ice_is_reset_in_progress(pf->state))
 		return IRQ_HANDLED;
 
+	ice_service_task_schedule(pf);
+
 	while (!ice_ptp_process_ts(pf))
 		usleep_range(50, 100);
 

base-commit: d15a5df649ee6351197170c855148f07caf69d0b

Signature · 6 lines
2.21.1

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
maintainer
#1 lore raw
Quoted 2 lines · Yochai Hagvi

On some RT kernels, scheduling service task in interrupt context may result in a kernel panic.

Would be nice if you could provide an example

Quoted 1 line

This is happenning due to queue_work call.

s/happenning/happening

Quoted 2 lines

Move ice_service_task_schedule to IRQ bottom half.

Please provide Fixes: for net patches

Quoted 3 lines

---

...

drivers/net/ethernet/intel/ice/ice_main.c static irqreturn_t ice_misc_intr(int __always_unused irq, void *data) · line 3171

Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_main.c +0 -1
@@ -3172,16 +3168,12 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
  		if (oicr & (PFINT_OICR_PCI_EXCEPTION_M |
  			    PFINT_OICR_ECC_ERR_M)) {
  			set_bit(ICE_PFR_REQ, pf->state);
-			ice_service_task_schedule(pf);
  		}

Single line now, not braces needed.

Review static irqreturn_t ice_misc_intr(int __always_unused irq, void *data) · line 3172

Quoted 1 line
(quoted diff) +0 -0
  	}

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan