ice: move ice_deinit_dev() to the end of deinit paths

ice_deinit_dev() takes care of turning off adminq processing, which is
much needed during driver teardown (remove, reset, error path). Move it
to the very end where applicable.
For example, ice_deinit_hw() called after adminq deinit slows rmmod on
my two-card setup by about 60 seconds.

ice_init_dev() and ice_deinit_dev() scopes were reduced by previous
commits of the series, with a final touch of extracting ice_init_dev_hw()
out now (there is no deinit counterpart).

Note that removed ice_service_task_stop() call from ice_remove() is placed
in the ice_deinit_dev() (and stopping twice makes no sense).

Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@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:
Przemek Kitszel
2025-09-12 15:06:26 +02:00
committed by Tony Nguyen
parent c2fb9398f7
commit 8a37f9e2ff
4 changed files with 23 additions and 9 deletions

View File

@@ -1233,6 +1233,7 @@ static int ice_devlink_reinit_up(struct ice_pf *pf)
{
struct ice_vsi *vsi = ice_get_main_vsi(pf);
struct device *dev = ice_pf_to_dev(pf);
bool need_dev_deinit = false;
int err;
err = ice_init_hw(&pf->hw);
@@ -1276,9 +1277,11 @@ err_load:
unroll_pf_init:
ice_deinit_pf(pf);
unroll_dev_init:
ice_deinit_dev(pf);
need_dev_deinit = true;
unroll_hw_init:
ice_deinit_hw(&pf->hw);
if (need_dev_deinit)
ice_deinit_dev(pf);
return err;
}