mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
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>
This commit is contained in:
parent
c35c178fcd
commit
806c4f32a8
|
|
@ -1029,6 +1029,7 @@ int ice_open(struct net_device *netdev);
|
|||
int ice_open_internal(struct net_device *netdev);
|
||||
int ice_stop(struct net_device *netdev);
|
||||
void ice_service_task_schedule(struct ice_pf *pf);
|
||||
void ice_start_service_task(struct ice_pf *pf);
|
||||
int ice_load(struct ice_pf *pf);
|
||||
void ice_unload(struct ice_pf *pf);
|
||||
void ice_adv_lnk_speed_maps_init(void);
|
||||
|
|
|
|||
|
|
@ -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 @@ int ice_init_dev(struct ice_pf *pf)
|
|||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user