ice: Fix deadlock on the rtnl_mutex
Subsystems (2)
PATCH 1/1 ice: Fix deadlock on the rtnl_mutex
There is a deadlock on rtnl_mutex when attempting to take the lock in unregister_netdev() after it has already been taken by ethnl_set_channels(). This happened when unregister_netdev() was called inside of ice_vsi_rebuild().
Fix that by removing the unregister_netdev() usage and replace it with ice_vsi_clear_rings() that deallocates the tx and rx rings for the VSI.
--- drivers/net/ethernet/intel/ice/ice_lib.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/ice/ice_lib.c +4 -6
@@ -3392,12 +3392,10 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi) err_vectors:ice_vsi_free_q_vectors (vsi); err_rings: -if (vsi->netdev) { - vsi->current_netdev_flags =0 ; -unregister_netdev (vsi->netdev); -free_netdev (vsi->netdev); - vsi->netdev =NULL ; - } +ice_vsi_clear_rings (vsi); +set_bit (ICE_RESET_FAILED , pf->state); +kfree (coalesce); +return ret; err_vsi:ice_vsi_clear (vsi);set_bit (ICE_RESET_FAILED , pf->state);
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 16 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Mateusz Palczewski
Sent: Monday, November 28, 2022 5:41 PM
To: [email protected]
Subject: [Intel-wired-lan] [PATCH net v1] ice: Fix deadlock on thertnl_mutexThere is a deadlock on
rtnl_mutexwhen attempting to take the lock inunregister_netdev()after it has already been taken byethnl_set_channels(). This happened whenunregister_netdev()was called inside ofice_vsi_rebuild().
Fix that by removing theunregister_netdev()usage and replace it withice_vsi_clear_rings()that deallocates the tx and rx rings for the VSI.
Quoted 7 lines
Fixes df0f847915b4 ("ice: Move common functions out of ice_main.c part6/7")
Signed-off-by Mateusz Palczewski <[email protected]>--- drivers/net/ethernet/intel/ice/ice_lib.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan