Search Linux Wireless

Re: [PATCH 3/8] iwlwifi: separate thermal throttling function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux