iwlwifi: mvm: use dump worker during restart instead of sync dump
authorShahar S Matityahu <shahar.s.matityahu@intel.com>
Wed, 6 Feb 2019 12:51:20 +0000 (14:51 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 22 Mar 2019 10:59:41 +0000 (12:59 +0200)
In restart flow, the driver requests HW restart from mac80211
and then mac80211 uses a worker to do the restart flow. In that flow a
sync dump is performed. Instead, schedule the dump worker before
requesting HW restart from mac80211. This approach simplifies the
restart flow.
Also, it is neeeded in order to differentiate between the handling of SW
and HW errors in a future commit.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index f4288232d06c853092e3e5e48df370876feb2204..83fd7f93d9f5b4c22eff5f4472bbc3bca3127b27 100644 (file)
@@ -2089,7 +2089,6 @@ out:
         * 2. We are using a unified image but had an error while exiting D3
         */
        set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status);
-       set_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status);
        /*
         * When switching images we return 1, which causes mac80211
         * to do a reconfig with IEEE80211_RECONFIG_TYPE_RESTART.
index dc4bff74c89c64fd2d0a110ab077d54d211e0865..1cad9238e45a63dda6e44f534925b0630ae4faeb 100644 (file)
@@ -1198,15 +1198,6 @@ static void iwl_mvm_cleanup_iterator(void *data, u8 *mac,
 
 static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
 {
-       /* clear the D3 reconfig, we only need it to avoid dumping a
-        * firmware coredump on reconfiguration, we shouldn't do that
-        * on D3->D0 transition
-        */
-       if (!test_and_clear_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status)) {
-               mvm->fwrt.dump.desc = &iwl_dump_desc_assert;
-               iwl_fw_error_dump(&mvm->fwrt);
-       }
-
        /* cleanup all stale references (scan, roc), but keep the
         * ucode_down ref until reconfig is complete
         */
index 4e179e69fd32c713d2e6b30463f5db78b00e23bd..61b6dbc83600123f7bf20c0f8a50a1a1a35cf331 100644 (file)
@@ -1203,7 +1203,6 @@ struct iwl_mvm {
  * @IWL_MVM_STATUS_IN_HW_RESTART: HW restart is active
  * @IWL_MVM_STATUS_IN_D0I3: NIC is in D0i3
  * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running
- * @IWL_MVM_STATUS_D3_RECONFIG: D3 reconfiguration is being done
  * @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running
  * @IWL_MVM_STATUS_NEED_FLUSH_P2P: need to flush P2P bcast STA
  */
@@ -1215,7 +1214,6 @@ enum iwl_mvm_status {
        IWL_MVM_STATUS_IN_HW_RESTART,
        IWL_MVM_STATUS_IN_D0I3,
        IWL_MVM_STATUS_ROC_AUX_RUNNING,
-       IWL_MVM_STATUS_D3_RECONFIG,
        IWL_MVM_STATUS_FIRMWARE_RUNNING,
        IWL_MVM_STATUS_NEED_FLUSH_P2P,
 };
@@ -2027,17 +2025,6 @@ static inline u32 iwl_mvm_flushable_queues(struct iwl_mvm *mvm)
 static inline void iwl_mvm_stop_device(struct iwl_mvm *mvm)
 {
        lockdep_assert_held(&mvm->mutex);
-       /* If IWL_MVM_STATUS_HW_RESTART_REQUESTED bit is set then we received
-        * an assert. Since we failed to bring the interface up, mac80211
-        * will not attempt to reconfig the device,
-        * which handles the dump collection in assert flow,
-        * so trigger dump collection here.
-        */
-       if (test_and_clear_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
-                              &mvm->status))
-               iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert,
-                                       false, 0);
-
        iwl_fw_cancel_timestamp(&mvm->fwrt);
        clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status);
        iwl_fwrt_stop_device(&mvm->fwrt);
index ad8dea01c638c801998839e3e1c385769189fed1..3cc6048d6a1044ed5e43c972c57804990fe4d02e 100644 (file)
@@ -1340,6 +1340,8 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)
                        }
                }
 
+               iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert,
+                                       false, 0);
                if (fw_error && mvm->fw_restart > 0)
                        mvm->fw_restart--;
                set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status);