Skip to content

Commit 24a3298

Browse files
orospanguy11
authored andcommitted
ice: Unregister netdev and devlink_port only once
Since commit 6624e78 ("ice: split ice_vsi_setup into smaller functions") ice_vsi_release does things twice. There is unregister netdev which is unregistered in ice_deinit_eth also. It also unregisters the devlink_port twice which is also unregistered in ice_deinit_eth(). This double deregistration is hidden because devl_port_unregister ignores the return value of xa_erase. [ 68.642167] Call Trace: [ 68.650385] ice_devlink_destroy_pf_port+0xe/0x20 [ice] [ 68.655656] ice_vsi_release+0x445/0x690 [ice] [ 68.660147] ice_deinit+0x99/0x280 [ice] [ 68.664117] ice_remove+0x1b6/0x5c0 [ice] [ 171.103841] Call Trace: [ 171.109607] ice_devlink_destroy_pf_port+0xf/0x20 [ice] [ 171.114841] ice_remove+0x158/0x270 [ice] [ 171.118854] pci_device_remove+0x3b/0xc0 [ 171.122779] device_release_driver_internal+0xc7/0x170 [ 171.127912] driver_detach+0x54/0x8c [ 171.131491] bus_remove_driver+0x77/0xd1 [ 171.135406] pci_unregister_driver+0x2d/0xb0 [ 171.139670] ice_module_exit+0xc/0x55f [ice] Fixes: 6624e78 ("ice: split ice_vsi_setup into smaller functions") Signed-off-by: Petr Oros <poros@redhat.com> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 9840036 commit 24a3298

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,39 +2972,12 @@ int ice_vsi_release(struct ice_vsi *vsi)
29722972
return -ENODEV;
29732973
pf = vsi->back;
29742974

2975-
/* do not unregister while driver is in the reset recovery pending
2976-
* state. Since reset/rebuild happens through PF service task workqueue,
2977-
* it's not a good idea to unregister netdev that is associated to the
2978-
* PF that is running the work queue items currently. This is done to
2979-
* avoid check_flush_dependency() warning on this wq
2980-
*/
2981-
if (vsi->netdev && !ice_is_reset_in_progress(pf->state) &&
2982-
(test_bit(ICE_VSI_NETDEV_REGISTERED, vsi->state))) {
2983-
unregister_netdev(vsi->netdev);
2984-
clear_bit(ICE_VSI_NETDEV_REGISTERED, vsi->state);
2985-
}
2986-
2987-
if (vsi->type == ICE_VSI_PF)
2988-
ice_devlink_destroy_pf_port(pf);
2989-
29902975
if (test_bit(ICE_FLAG_RSS_ENA, pf->flags))
29912976
ice_rss_clean(vsi);
29922977

29932978
ice_vsi_close(vsi);
29942979
ice_vsi_decfg(vsi);
29952980

2996-
if (vsi->netdev) {
2997-
if (test_bit(ICE_VSI_NETDEV_REGISTERED, vsi->state)) {
2998-
unregister_netdev(vsi->netdev);
2999-
clear_bit(ICE_VSI_NETDEV_REGISTERED, vsi->state);
3000-
}
3001-
if (test_bit(ICE_VSI_NETDEV_ALLOCD, vsi->state)) {
3002-
free_netdev(vsi->netdev);
3003-
vsi->netdev = NULL;
3004-
clear_bit(ICE_VSI_NETDEV_ALLOCD, vsi->state);
3005-
}
3006-
}
3007-
30082981
/* retain SW VSI data structure since it is needed to unregister and
30092982
* free VSI netdev when PF is not in reset recovery pending state,\
30102983
* for ex: during rmmod.

0 commit comments

Comments
 (0)