summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/tt.c
diff options
context:
space:
mode:
authorIdo Yariv2014-01-17 03:12:02 +0100
committerEmmanuel Grumbach2014-02-03 21:23:38 +0100
commit0c0e2c71b4da1818693acd73d49c4971283c8e72 (patch)
treeb7650106a27245d5559110158afa9136d95d1c15 /drivers/net/wireless/iwlwifi/mvm/tt.c
parentiwlwifi: pcie: retrieve and parse ACPI power limitations (diff)
downloadkernel-qcow2-linux-0c0e2c71b4da1818693acd73d49c4971283c8e72.tar.gz
kernel-qcow2-linux-0c0e2c71b4da1818693acd73d49c4971283c8e72.tar.xz
kernel-qcow2-linux-0c0e2c71b4da1818693acd73d49c4971283c8e72.zip
iwlwifi: mvm: handle platform PCIe power limitation
The tx backoff settings used by the thermal throttling mechanism can also be used for enforcing a limit on the power consumption of the module. Handle the platform PCIe power limitation by translating the limit (measured in mw) to its respective tx backoff value. The translation is module specific. The resulting tx backoff value is sent to the ucode, and also serves as the minimal backoff value that can be set by the thermal throttling mechanism. Signed-off-by: Ido Yariv <idox.yariv@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/tt.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/tt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/tt.c b/drivers/net/wireless/iwlwifi/mvm/tt.c
index 3afa6b6bf835..7a99fa361954 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tt.c
@@ -403,7 +403,7 @@ static void iwl_mvm_tt_tx_protection(struct iwl_mvm *mvm, bool enable)
}
}
-static void iwl_mvm_tt_tx_backoff(struct iwl_mvm *mvm, u32 backoff)
+void iwl_mvm_tt_tx_backoff(struct iwl_mvm *mvm, u32 backoff)
{
struct iwl_host_cmd cmd = {
.id = REPLY_THERMAL_MNG_BACKOFF,
@@ -412,6 +412,8 @@ static void iwl_mvm_tt_tx_backoff(struct iwl_mvm *mvm, u32 backoff)
.flags = CMD_SYNC,
};
+ backoff = max(backoff, mvm->thermal_throttle.min_backoff);
+
if (iwl_mvm_send_cmd(mvm, &cmd) == 0) {
IWL_DEBUG_TEMP(mvm, "Set Thermal Tx backoff to: %u\n",
backoff);
@@ -534,7 +536,7 @@ static const struct iwl_tt_params iwl7000_high_temp_tt_params = {
.support_tx_backoff = true,
};
-void iwl_mvm_tt_initialize(struct iwl_mvm *mvm)
+void iwl_mvm_tt_initialize(struct iwl_mvm *mvm, u32 min_backoff)
{
struct iwl_mvm_tt_mgmt *tt = &mvm->thermal_throttle;
@@ -546,6 +548,7 @@ void iwl_mvm_tt_initialize(struct iwl_mvm *mvm)
tt->params = &iwl7000_tt_params;
tt->throttle = false;
+ tt->min_backoff = min_backoff;
INIT_DELAYED_WORK(&tt->ct_kill_exit, check_exit_ctkill);
}