summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/debugfs.c
diff options
context:
space:
mode:
authorEran Harary2013-07-03 10:00:06 +0200
committerJohannes Berg2013-07-31 11:05:03 +0200
commit291aa7c4a4c01ef925b366174fc05ff2a757fad0 (patch)
tree2dd26a70766ddcdafa30e848b726653bdfba7aeb /drivers/net/wireless/iwlwifi/mvm/debugfs.c
parentiwlwifi: mvm: Change beacon filtering command (diff)
downloadkernel-qcow2-linux-291aa7c4a4c01ef925b366174fc05ff2a757fad0.tar.gz
kernel-qcow2-linux-291aa7c4a4c01ef925b366174fc05ff2a757fad0.tar.xz
kernel-qcow2-linux-291aa7c4a4c01ef925b366174fc05ff2a757fad0.zip
iwlwifi: mvm: fix debugfs restart if fw_restart is disabled
If fw_restart is disabled, using the fw_restart debugfs file will enable fw_restart and then send the failing command, but this still frequently fails restart because it resets fw_restart afterwards and is thus racy. Fix this by tracking fw_restart separately and allowing "always restart", "never restart" and "restart N times". Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/debugfs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/debugfs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index 347aa1cb29d5..15d52bad2d2a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -597,20 +597,19 @@ static ssize_t iwl_dbgfs_fw_restart_write(struct file *file,
size_t count, loff_t *ppos)
{
struct iwl_mvm *mvm = file->private_data;
- bool restart_fw = iwlwifi_mod_params.restart_fw;
int ret;
- iwlwifi_mod_params.restart_fw = true;
-
mutex_lock(&mvm->mutex);
+ /* allow one more restart that we're provoking here */
+ if (mvm->restart_fw >= 0)
+ mvm->restart_fw++;
+
/* take the return value to make compiler happy - it will fail anyway */
ret = iwl_mvm_send_cmd_pdu(mvm, REPLY_ERROR, CMD_SYNC, 0, NULL);
mutex_unlock(&mvm->mutex);
- iwlwifi_mod_params.restart_fw = restart_fw;
-
return count;
}