[PATCH 2/2] omap2+: pm: cpufreq: Fix loops_per_jiffy calculation
Premi, Sanjeev
premi at ti.com
Fri Jun 24 06:48:31 EDT 2011
> -----Original Message-----
> From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
> Sent: Friday, June 24, 2011 4:14 PM
> To: Premi, Sanjeev
> Cc: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH 2/2] omap2+: pm: cpufreq: Fix
> loops_per_jiffy calculation
>
> On Fri, Jun 24, 2011 at 04:05:42PM +0530, Sanjeev Premi wrote:
> > Currently, loops_per_jiffy is being calculated before calling
> > cpufreq_notify_transition().
> >
> > However, generic cpufreq driver adjusts the jiffies as well.
> > Double adjustment leads to incorrect value being assigned to
> > loops_per_jiffy.
>
> Are you sure the generic cpufreq driver adjusts the per-cpu
> loops_per_jiffy
> values? I don't believe it does.
Russell,
I am quoting the function from drivers/cpufreq/cpufreq.h
Follow the arrows:
[quote]
void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
{
[snip]...[snip]
case CPUFREQ_PRECHANGE:
[snip]...[snip]
srcu_notifier_call_chain(&cpufreq_transition_notifier_list,
CPUFREQ_PRECHANGE, freqs);
----> adjust_jiffies(CPUFREQ_PRECHANGE, freqs);
break;
case CPUFREQ_POSTCHANGE:
----> adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
[snip]...[snip]
}
}
[/quote]
Same can be viewed here:
http://lxr.free-electrons.com/source/drivers/cpufreq/cpufreq.c?a=arm#L300
~sanjeev
[snip]...[snip]
More information about the linux-arm-kernel
mailing list