diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-09-11 14:12:06 +0200 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-09-14 22:02:23 +0300 |
commit | 3d4060d58130aa805fb505c8ed4a9fbf8a3e09be (patch) | |
tree | 221a5c0682ac9110ff2d8e4b8158ce674df263b3 /drivers/net/wireless/iwlwifi/mvm/quota.c | |
parent | 4bfa47f3174155d4da088c5259e5fe2fcac01cf4 (diff) | |
download | lwn-3d4060d58130aa805fb505c8ed4a9fbf8a3e09be.tar.gz lwn-3d4060d58130aa805fb505c8ed4a9fbf8a3e09be.zip |
iwlwifi: mvm: fix quota update avoidance
When not updating the quota, the new command shouldn't be stored
as otherwise slowly drifting quota would never update the firmware.
Fix this by storing the command only when it was also sent.
Since the error message also only makes sense when attempting to
send the command, just short-circuit the function when there's no
need to send the command.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/quota.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/quota.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/quota.c b/drivers/net/wireless/iwlwifi/mvm/quota.c index 1eab2f2fee5d..dbb2594390e9 100644 --- a/drivers/net/wireless/iwlwifi/mvm/quota.c +++ b/drivers/net/wireless/iwlwifi/mvm/quota.c @@ -309,17 +309,16 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, "zero quota on binding %d\n", i); } - if (send) { - err = iwl_mvm_send_cmd_pdu(mvm, TIME_QUOTA_CMD, 0, - sizeof(cmd), &cmd); - } else { + if (!send) { /* don't send a practically unchanged command, the firmware has * to re-initialize a lot of state and that can have an adverse * impact on it */ - err = 0; + return 0; } + err = iwl_mvm_send_cmd_pdu(mvm, TIME_QUOTA_CMD, 0, sizeof(cmd), &cmd); + if (err) IWL_ERR(mvm, "Failed to send quota: %d\n", err); else |