From: Santosh Shilimkar <santosh.shilimkar@ti.com>
To: Colin Cross <ccross@google.com>
Cc: Sanjeev Premi <premi@ti.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Russell King - ARM Linux <linux@arm.linux.org.uk>
Subject: Re: [PATCHv2] omap2+: pm: cpufreq: Fix loops_per_jiffy calculation
Date: Tue, 28 Jun 2011 15:45:22 -0700 [thread overview]
Message-ID: <4E0A5982.8040002@ti.com> (raw)
In-Reply-To: <CAMbhsRQUKBZbC3jJt8XpjTW2n7uA529D6G0g4eT5iLEHn2iNLg@mail.gmail.com>
On 6/28/2011 3:29 PM, Colin Cross wrote:
> <resending as plain text>
>
> On Fri, Jun 24, 2011 at 6:53 AM, Sanjeev Premi<premi@ti.com> wrote:
>>
>> +#ifdef CONFIG_SMP
>> + /* Adjust jiffies before transition */
>> + for_each_cpu(i, policy->cpus) {
>> + unsigned long lpj = per_cpu(cpu_data, i).loops_per_jiffy;
>> +
>> + per_cpu(cpu_data, i).loops_per_jiffy = cpufreq_scale(lpj,
>> + freqs.old,
>> + freqs.new);
This isn't the right patch since it does suffer from the progressive
error. There was an updated patch on this thread from Russell which
I re-based.
> Can't this rewrite the loops_per_jiffy for the other CPU while it is
> in a udelay? If it has already calculated the number of loops
> necessary, and the CPU frequency increases, it could end up returning
> too early from udelay.
>
> There were previous discussions about polling a fixed-frequency timer
> for udelay on SMP systems.
>
The udelay code doesn't use the per-cpu lpj variable. It uses the global
lpj. Secondly the calibration of no. of loops to be done is
precalculateed so overwrite shouldn't impact the scenario you mentioned.
Though it has an issue where, pre-calculated loops can become short/long
based on new clock change which impacts both CPU's on OMAP, when the
other CPU is in in the middle of u-delay routine..
When CPU can scale independently, then we have bigger problem since
global lpj based udelay becomes always error prone in all scenario's.
So for the OMAP, where the whole CPU cluster is scaled together,
I don't see this as a bigger problem.
Regards
Santosh
next prev parent reply other threads:[~2011-06-28 22:45 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 13:53 [PATCHv2] omap2+: pm: cpufreq: Fix loops_per_jiffy calculation Sanjeev Premi
2011-06-24 13:59 ` Premi, Sanjeev
2011-06-24 14:01 ` Russell King - ARM Linux
2011-06-24 14:09 ` Premi, Sanjeev
2011-06-24 14:14 ` Russell King - ARM Linux
2011-06-24 15:12 ` Russell King - ARM Linux
2011-06-24 15:34 ` Premi, Sanjeev
2011-06-24 17:50 ` Premi, Sanjeev
2011-06-24 18:51 ` Russell King - ARM Linux
2011-06-24 20:14 ` Kevin Hilman
2011-06-25 16:20 ` Premi, Sanjeev
2011-06-24 18:48 ` Santosh Shilimkar
2011-06-25 18:53 ` Premi, Sanjeev
2011-06-25 19:09 ` Russell King - ARM Linux
2011-06-27 4:54 ` Premi, Sanjeev
2011-06-27 7:40 ` Russell King - ARM Linux
2011-06-24 14:35 ` Santosh Shilimkar
2011-06-24 14:40 ` Premi, Sanjeev
2011-06-24 14:47 ` Santosh Shilimkar
2011-06-28 22:29 ` Colin Cross
2011-06-28 22:45 ` Santosh Shilimkar [this message]
2011-06-28 22:56 ` Colin Cross
[not found] ` <CAMbhsRRctHC2wSi7cWjO2Fn_rM7=dMtTrt6PbsVehrgx9SKwzw@mail.gmail.com>
2011-06-28 23:00 ` Santosh Shilimkar
2011-06-28 23:04 ` Santosh Shilimkar
2011-06-28 23:03 ` Russell King - ARM Linux
2011-06-28 23:07 ` Santosh Shilimkar
2011-06-28 22:55 ` Russell King - ARM Linux
2011-06-28 22:58 ` Colin Cross
2011-06-28 23:17 ` Russell King - ARM Linux
2011-06-28 23:37 ` Colin Cross
2011-06-28 23:46 ` Russell King - ARM Linux
2011-06-28 23:59 ` Colin Cross
2011-06-29 14:00 ` Russell King - ARM Linux
2011-06-29 16:57 ` Colin Cross
2011-06-29 18:29 ` Stephen Boyd
2011-06-29 18:43 ` Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E0A5982.8040002@ti.com \
--to=santosh.shilimkar@ti.com \
--cc=ccross@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=premi@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox