summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/ice/ice_main.c
diff options
context:
space:
mode:
authorPrzemek Kitszel <przemyslaw.kitszel@intel.com>2025-09-12 15:06:20 +0200
committerTony Nguyen <anthony.l.nguyen@intel.com>2025-10-24 11:10:44 -0700
commit806c4f32a80627f8977fda53520afc41491d162f (patch)
tree93cd59a6f44e35b4d64ebe41789fdf7097ee156d /drivers/net/ethernet/intel/ice/ice_main.c
parentc35c178fcdffa5f3bedf261a628769b9a52c2436 (diff)
ice: move service task start out of ice_init_pf()
Move service task start out of ice_init_pf(). Do analogous with deinit. Service task is needed up to the very end of driver removal, later commit of the series will move it later on execution timeline. Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_main.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_main.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index ca95b8800bb3..f9e464b79bca 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -3951,7 +3951,6 @@ u16 ice_get_avail_rxq_count(struct ice_pf *pf)
*/
static void ice_deinit_pf(struct ice_pf *pf)
{
- ice_service_task_stop(pf);
mutex_destroy(&pf->lag_mutex);
mutex_destroy(&pf->adev_mutex);
mutex_destroy(&pf->sw_mutex);
@@ -4030,6 +4029,14 @@ static void ice_set_pf_caps(struct ice_pf *pf)
pf->max_pf_rxqs = func_caps->common_cap.num_rxq;
}
+void ice_start_service_task(struct ice_pf *pf)
+{
+ timer_setup(&pf->serv_tmr, ice_service_timer, 0);
+ pf->serv_tmr_period = HZ;
+ INIT_WORK(&pf->serv_task, ice_service_task);
+ clear_bit(ICE_SERVICE_SCHED, pf->state);
+}
+
/**
* ice_init_pf - Initialize general software structures (struct ice_pf)
* @pf: board private structure to initialize
@@ -4049,12 +4056,6 @@ static int ice_init_pf(struct ice_pf *pf)
init_waitqueue_head(&pf->reset_wait_queue);
- /* setup service timer and periodic service task */
- timer_setup(&pf->serv_tmr, ice_service_timer, 0);
- pf->serv_tmr_period = HZ;
- INIT_WORK(&pf->serv_task, ice_service_task);
- clear_bit(ICE_SERVICE_SCHED, pf->state);
-
mutex_init(&pf->avail_q_mutex);
pf->avail_txqs = bitmap_zalloc(pf->max_pf_txqs, GFP_KERNEL);
if (!pf->avail_txqs)
@@ -4745,6 +4746,7 @@ int ice_init_dev(struct ice_pf *pf)
ice_set_safe_mode_caps(hw);
}
+ ice_start_service_task(pf);
err = ice_init_pf(pf);
if (err) {
dev_err(dev, "ice_init_pf failed: %d\n", err);
@@ -4791,6 +4793,7 @@ unroll_irq_scheme_init:
ice_clear_interrupt_scheme(pf);
unroll_pf_init:
ice_deinit_pf(pf);
+ ice_service_task_stop(pf);
return err;
}
@@ -4799,6 +4802,7 @@ void ice_deinit_dev(struct ice_pf *pf)
ice_free_irq_msix_misc(pf);
ice_deinit_pf(pf);
ice_deinit_hw(&pf->hw);
+ ice_service_task_stop(pf);
/* Service task is already stopped, so call reset directly. */
ice_reset(&pf->hw, ICE_RESET_PFR);