Re: [PATCH v5 2/7] cpufreq: Add boost frequency support in core

From: Viresh Kumar
Date: Tue Jul 16 2013 - 05:42:01 EST


On 4 July 2013 14:20, Lukasz Majewski <l.majewski@xxxxxxxxxxx> wrote:
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c

> +int cpufreq_boost_trigger_state(int state)
> +{
> + unsigned long flags;
> + int ret = 0;
> +
> + if (boost_enabled != state) {
> + write_lock_irqsave(&cpufreq_driver_lock, flags);
> + boost_enabled = state;
> +
> + ret = cpufreq_driver->enable_boost(state);
> + if (ret)
> + boost_enabled = 0;
> +
> + write_unlock_irqrestore(&cpufreq_driver_lock, flags);
> +
> + if (ret)
> + pr_err("%s: BOOST cannot enable (%d)\n",

Who said we are enabling it?

> + __func__, ret);
> + }
> +
> + return ret;
> +}
> +
> +int cpufreq_boost_supported(void)
> +{
> + if (cpufreq_driver)
> + return cpufreq_driver->boost_supported;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(cpufreq_boost_supported);
> +
> +int cpufreq_boost_enabled(void)
> +{
> + return boost_enabled;
> +}
> +EXPORT_SYMBOL_GPL(cpufreq_boost_enabled);
> +
> +void cpufreq_set_boost_enabled(int state)

Maybe cpufreq_block_boost? As suggested by Rafael.

> +{
> + boost_enabled = state;
> +}
> +EXPORT_SYMBOL_GPL(cpufreq_set_boost_enabled);
> +
> +/*********************************************************************
> * REGISTER / UNREGISTER CPUFREQ DRIVER *
> *********************************************************************/
>
> @@ -2001,6 +2094,22 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
> cpufreq_driver = driver_data;
> write_unlock_irqrestore(&cpufreq_driver_lock, flags);
>
> + if (cpufreq_driver->boost_supported) {
> + /*
> + * Check if boost driver provides function to enable boost -
> + * if not, use cpufreq_boost_enable_sw as default
> + */
> + if (!cpufreq_driver->enable_boost)
> + cpufreq_driver->enable_boost = &cpufreq_boost_enable_sw;

& is redundant.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/