Hi John, Based on ours previous conversation, I understand the thermal throttling patch is not being merge it, since it has a stupid bug I create and being identify by Johannes, is it ok for you to merge the attached patch with the original patch work while you ready to push? Thanks On Fri, 2010-08-06 at 06:14 -0700, Johannes Berg wrote: > > @@ -325,9 +283,15 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force) > > else if (priv->cfg->supports_idle && > > priv->hw->conf.flags & IEEE80211_CONF_IDLE) > > iwl_static_sleep_cmd(priv, &cmd, IWL_POWER_INDEX_5, 20); > > - else if (tt->state >= IWL_TI_1) > > - iwl_static_sleep_cmd(priv, &cmd, tt->tt_power_mode, dtimper); > > - else if (!enabled) > > + else if (priv->cfg->ops->lib->tt_ops.lower_power_detection && > > + priv->cfg->ops->lib->tt_ops.tt_power_mode) { > > + if (priv->cfg->ops->lib->tt_ops.lower_power_detection(priv)) { > > + /* in thermal throttling low power state */ > > + iwl_static_sleep_cmd(priv, &cmd, > > + priv->cfg->ops->lib->tt_ops.tt_power_mode(priv), > > + dtimper); > > + } > > + } else if (!enabled) > > iwl_power_sleep_cam_cmd(priv, &cmd); > > else if (priv->power_data.debug_sleep_level_override >= 0) > > iwl_static_sleep_cmd(priv, &cmd, > > This is very very broken because it adds an often-used code path that > will not initialise "cmd" at all. It needs to be > > ... > else if (priv->...lower_power_detection && > priv->...tt_power_mode && > priv->...lower_power_detection(priv)) > iwl_static_sleep_cmd(...) > else if (!enabled) > ... > > johannes >
>From 98ec32fb40c92ce0175a3246660f4ae7969308d7 Mon Sep 17 00:00:00 2001 From: Wey-Yi Guy <wey-yi.w.guy@xxxxxxxxx> Date: Fri, 6 Aug 2010 12:39:14 -0700 Subject: [PATCH 1/1] iwlwifi: fix thermal throttling related power manageent operation The current approach is very broken because it adds an often-used code path that will not initialise "cmd" at all. Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> Signed-off-by: Shanyu Zhao <shanyu.zhao.intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@xxxxxxxxx> --- drivers/net/wireless/iwlwifi/iwl-power.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index da1f2ae..63c0ab4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c @@ -284,13 +284,11 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force) priv->hw->conf.flags & IEEE80211_CONF_IDLE) iwl_static_sleep_cmd(priv, &cmd, IWL_POWER_INDEX_5, 20); else if (priv->cfg->ops->lib->tt_ops.lower_power_detection && - priv->cfg->ops->lib->tt_ops.tt_power_mode) { - if (priv->cfg->ops->lib->tt_ops.lower_power_detection(priv)) { - /* in thermal throttling low power state */ - iwl_static_sleep_cmd(priv, &cmd, - priv->cfg->ops->lib->tt_ops.tt_power_mode(priv), - dtimper); - } + priv->cfg->ops->lib->tt_ops.tt_power_mode && + priv->cfg->ops->lib->tt_ops.lower_power_detection(priv)) { + /* in thermal throttling low power state */ + iwl_static_sleep_cmd(priv, &cmd, + priv->cfg->ops->lib->tt_ops.tt_power_mode(priv), dtimper); } else if (!enabled) iwl_power_sleep_cam_cmd(priv, &cmd); else if (priv->power_data.debug_sleep_level_override >= 0) -- 1.5.6.3