iwlwifi: mvm: make sure state isn't in d0i3 when collecting fw dbg
authorLiad Kaufman <liad.kaufman@intel.com>
Thu, 1 Jan 2015 15:42:46 +0000 (17:42 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 22 Jan 2015 15:53:54 +0000 (17:53 +0200)
This makes sure that we're not trying to read/write any of
the FW debug data collected during d0i3.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/debugfs.c
drivers/net/wireless/iwlwifi/mvm/mvm.h
drivers/net/wireless/iwlwifi/mvm/ops.c

index a1b276c4dee04d93c01d6faa0b17825a24677815..f1b3405c44bddb3a2aa18a1300c26d717a3d382e 100644 (file)
@@ -1390,6 +1390,7 @@ static ssize_t iwl_dbgfs_d0i3_refs_read(struct file *file,
        PRINT_MVM_REF(IWL_MVM_REF_TM_CMD);
        PRINT_MVM_REF(IWL_MVM_REF_EXIT_WORK);
        PRINT_MVM_REF(IWL_MVM_REF_PROTECT_CSA);
+       PRINT_MVM_REF(IWL_MVM_REF_FW_DBG_COLLECT);
 
        return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
 }
index b2100b4140553e2625125f70be383a1b28d5bc97..c95297e1f83681a1577c0fdc750bbcc0403da0c6 100644 (file)
@@ -276,6 +276,7 @@ enum iwl_mvm_ref_type {
        IWL_MVM_REF_TM_CMD,
        IWL_MVM_REF_EXIT_WORK,
        IWL_MVM_REF_PROTECT_CSA,
+       IWL_MVM_REF_FW_DBG_COLLECT,
 
        /* update debugfs.c when changing this */
 
index 239f033e3b9319fbbab0f84082a1ab5cb7ad3e07..b0583fc227a7d54dfc857fbdc5fc811af2716ff1 100644 (file)
@@ -818,9 +818,14 @@ static void iwl_mvm_fw_error_dump_wk(struct work_struct *work)
        struct iwl_mvm *mvm =
                container_of(work, struct iwl_mvm, fw_error_dump_wk);
 
+       if (iwl_mvm_ref_sync(mvm, IWL_MVM_REF_FW_DBG_COLLECT))
+               return;
+
        mutex_lock(&mvm->mutex);
        iwl_mvm_fw_error_dump(mvm);
        mutex_unlock(&mvm->mutex);
+
+       iwl_mvm_unref(mvm, IWL_MVM_REF_FW_DBG_COLLECT);
 }
 
 void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)