[PATCH 02/10] cpufreq: OMAP: Add SMP support for OMAP4+

Viresh Kumar viresh.kumar at linaro.org
Thu Aug 29 06:02:55 EDT 2013


On Fri, Sep 23, 2011 at 2:37 AM, Kevin Hilman <khilman at ti.com> wrote:
> From: Russell King <rmk+kernel at arm.linux.org.uk>
>
> On OMAP SMP configuartion, both processors share the voltage
> and clock. So both CPUs needs to be scaled together and hence
> needs software co-ordination.
>
> Also, update lpj with reference value to avoid progressive error.
>
> Adjust _both_ the per-cpu loops_per_jiffy and global lpj. Calibrate
> them with with reference to the initial values to avoid a
> progressively bigger and bigger error in the value over time.
>
> While at this, re-use the notifiers for UP/SMP since on UP machine or
> UP_ON_SMP policy->cpus mask would contain only the boot CPU.
>
> Based on initial SMP support by Santosh Shilimkar.
>
> Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar at ti.com>
> [khilman at ti.com: due to overlap/rework, combined original Santosh patch
>                  and Russell's rework]
> Signed-off-by: Kevin Hilman <khilman at ti.com>
> ---
>  drivers/cpufreq/omap-cpufreq.c |   80 +++++++++++++++++++++++++++++++++++-----
>  1 files changed, 70 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c

> +       /*
> +        * On OMAP SMP configuartion, both processors share the voltage
> +        * and clock. So both CPUs needs to be scaled together and hence
> +        * needs software co-ordination. Use cpufreq affected_cpus
> +        * interface to handle this scenario. Additional is_smp() check
> +        * is to keep SMP_ON_UP build working.
> +        */
> +       if (is_smp()) {
> +               policy->shared_type = CPUFREQ_SHARED_TYPE_ANY;
> +               cpumask_or(cpumask, cpumask_of(policy->cpu), cpumask);
> +               cpumask_copy(policy->cpus, cpumask);
> +       }

Does somebody remember importance of is_smp() here??

Current code looks like:

if (is_smp())
    cpumask_setall(policy->cpus);

And I was looking to remove this check if it is no more useful.. And
so simply do

cpumask_setall(policy->cpus);



More information about the linux-arm-kernel mailing list