@@ -2921,7 +2921,6 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
29212921 iavf_free_queues (adapter );
29222922 memset (adapter -> vf_res , 0 , IAVF_VIRTCHNL_VF_RESOURCE_SIZE );
29232923 iavf_shutdown_adminq (& adapter -> hw );
2924- adapter -> netdev -> flags &= ~IFF_UP ;
29252924 adapter -> flags &= ~IAVF_FLAG_RESET_PENDING ;
29262925 iavf_change_state (adapter , __IAVF_DOWN );
29272926 wake_up (& adapter -> down_waitqueue );
@@ -3021,6 +3020,11 @@ static void iavf_reset_task(struct work_struct *work)
30213020 iavf_disable_vf (adapter );
30223021 mutex_unlock (& adapter -> client_lock );
30233022 mutex_unlock (& adapter -> crit_lock );
3023+ if (netif_running (netdev )) {
3024+ rtnl_lock ();
3025+ dev_close (netdev );
3026+ rtnl_unlock ();
3027+ }
30243028 return ; /* Do not attempt to reinit. It's dead, Jim. */
30253029 }
30263030
@@ -3173,6 +3177,16 @@ static void iavf_reset_task(struct work_struct *work)
31733177
31743178 mutex_unlock (& adapter -> client_lock );
31753179 mutex_unlock (& adapter -> crit_lock );
3180+
3181+ if (netif_running (netdev )) {
3182+ /* Close device to ensure that Tx queues will not be started
3183+ * during netif_device_attach() at the end of the reset task.
3184+ */
3185+ rtnl_lock ();
3186+ dev_close (netdev );
3187+ rtnl_unlock ();
3188+ }
3189+
31763190 dev_err (& adapter -> pdev -> dev , "failed to allocate resources during reinit\n" );
31773191reset_finish :
31783192 rtnl_lock ();
0 commit comments