浏览代码

iwlwifi: don't fail power set when calibration is not done yet

This patch doesn't fail power save setting when calibration is
not done yet. The new power index is registered and will
be evaluated again anyway upon calibration completion.

This patch also eliminates WARN_ON in mac80211 hw_config during
initialization

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Winkler, Tomas 17 年之前
父节点
当前提交
a71c8f62d4
共有 1 个文件被更改,包括 8 次插入9 次删除
  1. 8 9
      drivers/net/wireless/iwlwifi/iwl-power.c

+ 8 - 9
drivers/net/wireless/iwlwifi/iwl-power.c

@@ -257,15 +257,11 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
 	struct iwl_power_mgr *setting = &(priv->power_data);
 	struct iwl_power_mgr *setting = &(priv->power_data);
 	int ret = 0;
 	int ret = 0;
 	u16 uninitialized_var(final_mode);
 	u16 uninitialized_var(final_mode);
+	bool update_chains;
 
 
 	/* Don't update the RX chain when chain noise calibration is running */
 	/* Don't update the RX chain when chain noise calibration is running */
-	if (priv->chain_noise_data.state != IWL_CHAIN_NOISE_DONE &&
-	    priv->chain_noise_data.state != IWL_CHAIN_NOISE_ALIVE) {
-		IWL_DEBUG_POWER("Cannot update the power, chain noise "
-			"calibration running: %d\n",
-			priv->chain_noise_data.state);
-		return -EAGAIN;
-	}
+	update_chains = priv->chain_noise_data.state == IWL_CHAIN_NOISE_DONE ||
+			priv->chain_noise_data.state == IWL_CHAIN_NOISE_ALIVE;
 
 
 	/* If on battery, set to 3,
 	/* If on battery, set to 3,
 	 * if plugged into AC power, set to CAM ("continuously aware mode"),
 	 * if plugged into AC power, set to CAM ("continuously aware mode"),
@@ -313,9 +309,12 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
 		else
 		else
 			set_bit(STATUS_POWER_PMI, &priv->status);
 			set_bit(STATUS_POWER_PMI, &priv->status);
 
 
-		if (priv->cfg->ops->lib->update_chain_flags)
+		if (priv->cfg->ops->lib->update_chain_flags && update_chains)
 			priv->cfg->ops->lib->update_chain_flags(priv);
 			priv->cfg->ops->lib->update_chain_flags(priv);
-
+		else
+			IWL_DEBUG_POWER("Cannot update the power, chain noise "
+					"calibration running: %d\n",
+					priv->chain_noise_data.state);
 		if (!ret)
 		if (!ret)
 			setting->power_mode = final_mode;
 			setting->power_mode = final_mode;
 	}
 	}