Re: [PATCH 2.5] cpufreq: minor cleanups

Dominik Brodowski (linux@brodo.de)
Thu, 26 Dec 2002 23:07:10 +0100


On Sun, Dec 22, 2002 at 10:25:59PM +0100, Pavel Machek wrote:
> Hi!
>
> > Get rid of CPUFREQ_ALL_CPUS codepaths not used anymore.
>
> Get rid of? Seems you are adding it.

Only in cpufreq_set(). If that is called with cpu==CPUFREQ_ALL_CPUS, this
value can't be passed to cpufreq_set_policy any more. So the
cpufreq_set_policy call needs to be iterated over all cpus. The reason for
this is that on some architectures, not all CPUs support the same frequency
ranges.
In all other instances, CPUFREQ_ALL_CPUS is removed by that patch you're
commenting on; will re-send it soon for 2.5.53.

Dominik

> > - return cpufreq_set_policy(&policy);
> > + if (policy.cpu == CPUFREQ_ALL_CPUS)
> > + {
> > + unsigned int i;
> > + unsigned int ret = 0;
> > + for (i=0; i<NR_CPUS; i++)
> > + {
> > + policy.cpu = i;
> > + if (cpu_online(i))
> > + ret |= cpufreq_set_policy(&policy);
> > + }
> > + return ret;
> > + }
> > + else
> > + return cpufreq_set_policy(&policy);
> > }
> > EXPORT_SYMBOL_GPL(cpufreq_set);
> >
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/