diff options
author | Luca Coelho <luciano.coelho@intel.com> | 2016-03-11 05:12:16 -0500 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2016-05-10 15:14:48 -0400 |
commit | 71b1230ca97e60d26b4205ac553af6331724ca60 (patch) | |
tree | 63e522c0a210fcbd7d07df90275157d3c9166860 /drivers/net/wireless/intel/iwlwifi/mvm/utils.c | |
parent | fa820d696c0ac0bb3cf1b49a817899982d774d61 (diff) |
iwlwifi: wake from runtime suspend before sending sync commands
If a host command was queued while in runtime suspend, it would go out
before the D0I3_END_CMD was sent. Sometimes it works, but sometimes
it fails, and it is obviously the wrong thing to do.
To fix this, have the opmode take a reference before sending a SYNC
command and make the pcie trans wait for the runtime state to become
active before actually queueing the command.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/utils.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c index f0ffd62f02d3..eb41d3bd8059 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c | |||
@@ -90,11 +90,17 @@ int iwl_mvm_send_cmd(struct iwl_mvm *mvm, struct iwl_host_cmd *cmd) | |||
90 | * the mutex, this ensures we don't try to send two | 90 | * the mutex, this ensures we don't try to send two |
91 | * (or more) synchronous commands at a time. | 91 | * (or more) synchronous commands at a time. |
92 | */ | 92 | */ |
93 | if (!(cmd->flags & CMD_ASYNC)) | 93 | if (!(cmd->flags & CMD_ASYNC)) { |
94 | lockdep_assert_held(&mvm->mutex); | 94 | lockdep_assert_held(&mvm->mutex); |
95 | if (!(cmd->flags & CMD_SEND_IN_IDLE)) | ||
96 | iwl_mvm_ref(mvm, IWL_MVM_REF_SENDING_CMD); | ||
97 | } | ||
95 | 98 | ||
96 | ret = iwl_trans_send_cmd(mvm->trans, cmd); | 99 | ret = iwl_trans_send_cmd(mvm->trans, cmd); |
97 | 100 | ||
101 | if (!(cmd->flags & (CMD_ASYNC | CMD_SEND_IN_IDLE))) | ||
102 | iwl_mvm_unref(mvm, IWL_MVM_REF_SENDING_CMD); | ||
103 | |||
98 | /* | 104 | /* |
99 | * If the caller wants the SKB, then don't hide any problems, the | 105 | * If the caller wants the SKB, then don't hide any problems, the |
100 | * caller might access the response buffer which will be NULL if | 106 | * caller might access the response buffer which will be NULL if |