[Intel-wired-lan] [PATCH iwl-next v2 2/5] ice: always return IRQ_WAKE_THREAD in ice_misc_intr()
Jacob Keller
jacob.e.keller at intel.com
Tue May 30 17:46:02 UTC 2023
From: Karol Kolacinski <karol.kolacinski at intel.com>
Refactor the ice_misc_intr() function to always return IRQ_WAKE_THREAD, and
schedule the service task during the soft IRQ thread function instead of at
the end of the hard IRQ handler.
Remove the duplicate call to ice_service_task_schedule() that happened when
we got a PCI exception.
Signed-off-by: Karol Kolacinski <karol.kolacinski at intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
---
Chances since v1:
* Rewrote commit message, no longer justifying change with reference to
CONFIG_PREEMT_RT, as this is no longer true since v5.8. We still would
like this change since it simplifies the ice_misc_intr() function and
would more closely align with what we provided to our customer on an older
stable kernel.
drivers/net/ethernet/intel/ice/ice_main.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 9e4d7d884115..8b59632ec6b1 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -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;
@@ -3139,10 +3138,8 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
if (oicr & PFINT_OICR_TSYN_TX_M) {
ena_mask &= ~PFINT_OICR_TSYN_TX_M;
- if (!hw->reset_ongoing) {
+ if (!hw->reset_ongoing)
pf->oicr_misc |= PFINT_OICR_TSYN_TX_M;
- ret = IRQ_WAKE_THREAD;
- }
}
if (oicr & PFINT_OICR_TSYN_EVNT_M) {
@@ -3159,7 +3156,6 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
GLTSYN_STAT_EVENT2_M);
pf->oicr_misc |= PFINT_OICR_TSYN_EVNT_M;
- ret = IRQ_WAKE_THREAD;
}
}
@@ -3180,16 +3176,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;
}
/**
@@ -3204,6 +3196,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);
+
if (pf->oicr_misc & PFINT_OICR_TSYN_EVNT_M) {
ice_ptp_extts_event(pf);
pf->oicr_misc &= ~PFINT_OICR_TSYN_EVNT_M;
--
2.40.0.471.gbd7f14d9353b
More information about the Intel-wired-lan
mailing list