iwlwifi: mvm: clean interfaces on drv_stop
authorArik Nemtsov <arik@wizery.com>
Wed, 4 Mar 2015 11:16:03 +0000 (13:16 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 28 May 2015 10:36:54 +0000 (13:36 +0300)
If a HW recovery was started but not completed since all interfaces went
down, make sure to cleanup all interfaces before clearing the HW_RESTART
flag.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/mac80211.c

index 71b66cb6ff1226a7445abf000b0f9a56238ae9dc..9e517e20a14ed033273523c0e32652bdb06d663f 100644 (file)
@@ -1489,8 +1489,12 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *mvm)
        /*
         * Clear IN_HW_RESTART flag when stopping the hw (as restart_complete()
         * won't be called in this case).
+        * But make sure to cleanup interfaces that have gone down before/during
+        * HW restart was requested.
         */
-       clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status);
+       if (test_and_clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
+               ieee80211_iterate_interfaces(mvm->hw, 0,
+                                            iwl_mvm_cleanup_iterator, mvm);
 
        /* We shouldn't have any UIDs still set.  Loop over all the UIDs to
         * make sure there's nothing left there and warn if any is found.