ice: add missing ice_deinit_hw() in devlink reinit path
Subsystems (2)
PATCH 1/1 ice: add missing ice_deinit_hw() in devlink reinit path
devlink-reload results in ice_init_hw failed error, and then removing the ice driver causes a NULL pointer dereference.
[ +0.102213] ice 0000:ca:00.0: ice_init_hw failed: -16
...
[ +0.000001] Call Trace: [ +0.000003] <TASK> [ +0.000006] ice_unload+0x8f/0x100 [ice] [ +0.000081] ice_remove+0xba/0x300 [ice]
Commit 1390b8b3d2be ("ice: remove duplicate call to ice_deinit_hw() on error paths") removed ice_deinit_hw() from ice_deinit_dev(). As a result ice_devlink_reinit_down() no longer calls ice_deinit_hw(), but ice_devlink_reinit_up() still calls ice_init_hw(). Since the control queues are not uninitialized, ice_init_hw() fails with -EBUSY.
Add ice_deinit_hw() to ice_devlink_reinit_down() to correspond with ice_init_hw() in ice_devlink_reinit_up().
--- drivers/net/ethernet/intel/ice/devlink/devlink.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ice/devlink/devlink.c +1 -0
@@ -460,6 +460,7 @@ static void ice_devlink_reinit_down(struct ice_pf *pf)ice_vsi_decfg (ice_get_main_vsi (pf));rtnl_unlock ();ice_deinit_pf (pf); +ice_deinit_hw (&pf->hw);ice_deinit_dev (pf); }
Signature · 1 line
2.52.0
Dear Paul,
Thank you for the patch.
Am 18.12.25 um 14:36 schrieb Paul Greenwalt:
Quoted 32 lines
devlink-reload results in
ice_init_hwfailed error, and then removing the ice driver causes a NULL pointer dereference.[ +0.102213] ice 0000:ca:00.0:
ice_init_hwfailed: -16
...[ +0.000001] Call Trace: [ +0.000003] <TASK> [ +0.000006] ice_unload+0x8f/0x100 [ice] [ +0.000081] ice_remove+0xba/0x300 [ice]Commit
1390b8b3d2be("ice: remove duplicate call toice_deinit_hw()on error paths") removedice_deinit_hw()fromice_deinit_dev(). As a resultice_devlink_reinit_down()no longer callsice_deinit_hw(), butice_devlink_reinit_up()still callsice_init_hw(). Since the control queues are not uninitialized,ice_init_hw()fails with-EBUSY.Add
ice_deinit_hw()toice_devlink_reinit_down()to correspond withice_init_hw()inice_devlink_reinit_up().Fixes 1390b8b3d2be ("ice: remove duplicate call to ice_deinit_hw() on error paths")Reviewed-by Aleksandr Loktionov <[email protected]>Reviewed-by Przemek Kitszel <[email protected]>Signed-off-by Paul Greenwalt <[email protected]>--- drivers/net/ethernet/intel/ice/devlink/devlink.c | 1 + 1 file changed, 1 insertion(+)drivers/net/ethernet/intel/ice/devlink/devlink.c +0
-0
drivers/net/ethernet/intel/ice/devlink/devlink.c static void ice_devlink_reinit_down(struct ice_pf *pf) · line 465
Quoted 6 lines
drivers/net/ethernet/intel/ice/devlink/devlink.c +1
-0@@ -460,6 +460,7 @@ static void ice_devlink_reinit_down(struct ice_pf *pf)ice_vsi_decfg (ice_get_main_vsi (pf));rtnl_unlock ();ice_deinit_pf (pf); +ice_deinit_hw (&pf->hw);ice_deinit_dev (pf); }
Kind regards,
Paul
Quoted 21 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Paul Greenwalt
Sent: 18 December 2025 19:07
To: [email protected]
Cc: Kitszel, Przemyslaw <[email protected]>; Greenwalt, Paul <[email protected]>; Loktionov, Aleksandr <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v1] ice: add missingice_deinit_hw()in devlink reinit pathdevlink-reload results in
ice_init_hwfailed error, and then removing the ice driver causes a NULL pointer dereference.[ +0.102213] ice 0000:ca:00.0: ice_init_hw failed: -16 ... [ +0.000001] Call Trace: [ +0.000003] <TASK> [ +0.000006] ice_unload+0x8f/0x100 [ice] [ +0.000081] ice_remove+0xba/0x300 [ice]Commit
1390b8b3d2be("ice: remove duplicate call toice_deinit_hw()on error paths") removedice_deinit_hw()fromice_deinit_dev(). As a resultice_devlink_reinit_down()no longer callsice_deinit_hw(), butice_devlink_reinit_up()still callsice_init_hw(). Since the control queues are not uninitialized,ice_init_hw()fails with-EBUSY.Add
ice_deinit_hw()toice_devlink_reinit_down()to correspond withice_init_hw()inice_devlink_reinit_up().
Quoted 8 lines
Fixes 1390b8b3d2be ("ice: remove duplicate call to ice_deinit_hw() on error paths")Reviewed-by Aleksandr Loktionov <[email protected]>Reviewed-by Przemek Kitszel <[email protected]>Signed-off-by Paul Greenwalt <[email protected]>---
drivers/net/ethernet/intel/ice/devlink/devlink.c| 1 +1 file changed, 1 insertion(+)