Commit ee9f2989 authored by Wey-Yi Guy's avatar Wey-Yi Guy Committed by John W. Linville
Browse files

iwlwifi: fix legacy thermal throttling power index

For legacy thermal throttling, set the new Thermal Throttling
state and change power index when thermal throttling manager detects
temperature changed. The current implementation sets the state to the
previous Thermal Throttling state, which causes system to enter wrong
power index. The worse case, it will trying to set the
lower power index when device reach critical temperature, it will cuase
issue for both system and the device.
Signed-off-by: default avatarWey-Yi Guy <>
Signed-off-by: default avatarReinette Chatre <>
Signed-off-by: default avatarJohn W. Linville <>
parent a28027cd
......@@ -425,7 +425,7 @@ static void iwl_perform_ct_kill_task(struct iwl_priv *priv,
static void iwl_legacy_tt_handler(struct iwl_priv *priv, s32 temp)
struct iwl_tt_mgmt *tt = &priv->;
enum iwl_tt_state new_state;
enum iwl_tt_state old_state;
struct iwl_power_mgr *setting = &priv->power_data;
......@@ -438,26 +438,27 @@ static void iwl_legacy_tt_handler(struct iwl_priv *priv, s32 temp)
(temp - tt->tt_previous_temp));
old_state = tt->state;
/* in Celsius */
new_state = IWL_TI_CT_KILL;
tt->state = IWL_TI_CT_KILL;
new_state = IWL_TI_2;
tt->state = IWL_TI_2;
new_state = IWL_TI_1;
tt->state = IWL_TI_1;
new_state = IWL_TI_0;
tt->state = IWL_TI_0;
tt->tt_previous_temp = temp;
if (tt->state != new_state) {
if (tt->state == IWL_TI_0) {
if (tt->state != old_state) {
if (old_state == IWL_TI_0) {
tt->sys_power_mode = setting->power_mode;
IWL_DEBUG_POWER(priv, "current power mode: %u\n",
switch (new_state) {
switch (tt->state) {
case IWL_TI_0:
/* when system ready to go back to IWL_TI_0 state
* using system power mode instead of TT power mode
......@@ -486,15 +487,15 @@ static void iwl_legacy_tt_handler(struct iwl_priv *priv, s32 temp)
/* TT state not updated
* try again during next temperature read
tt->state = old_state;
IWL_ERR(priv, "Cannot update power mode, "
"TT state not updated\n");
} else {
if (new_state == IWL_TI_CT_KILL)
if (tt->state == IWL_TI_CT_KILL)
iwl_perform_ct_kill_task(priv, true);
else if (tt->state == IWL_TI_CT_KILL &&
new_state != IWL_TI_CT_KILL)
else if (old_state == IWL_TI_CT_KILL &&
tt->state != IWL_TI_CT_KILL)
iwl_perform_ct_kill_task(priv, false);
tt->state = new_state;
IWL_DEBUG_POWER(priv, "Temperature state changed %u\n",
IWL_DEBUG_POWER(priv, "Power Index change to %u\n",
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment