* [PATCH] ARM: ux500: send cpufreq notification for all cpus
@ 2011-08-24 6:44 Vincent Guittot
2011-08-24 7:42 ` Linus Walleij
2011-08-24 8:26 ` Santosh
0 siblings, 2 replies; 6+ messages in thread
From: Vincent Guittot @ 2011-08-24 6:44 UTC (permalink / raw)
To: linux-arm-kernel
The same clock is used for all cpus so we must notify the frequency change
for each one in order to update the configuration of all twd clockevents.
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
drivers/cpufreq/db8500-cpufreq.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/db8500-cpufreq.c b/drivers/cpufreq/db8500-cpufreq.c
index 0d8dd1c..4cb5785 100644
--- a/drivers/cpufreq/db8500-cpufreq.c
+++ b/drivers/cpufreq/db8500-cpufreq.c
@@ -76,13 +76,13 @@ static int db8500_cpufreq_target(struct cpufreq_policy *policy,
freqs.old = policy->cur;
freqs.new = freq_table[idx].frequency;
- freqs.cpu = policy->cpu;
if (freqs.old == freqs.new)
return 0;
/* pre-change notification */
- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+ for_each_online_cpu(freqs.cpu)
+ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
/* request the PRCM unit for opp change */
if (prcmu_set_arm_opp(idx2opp[idx])) {
@@ -91,7 +91,8 @@ static int db8500_cpufreq_target(struct cpufreq_policy *policy,
}
/* post change notification */
- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+ for_each_online_cpu(freqs.cpu)
+ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
return 0;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] ARM: ux500: send cpufreq notification for all cpus
2011-08-24 6:44 [PATCH] ARM: ux500: send cpufreq notification for all cpus Vincent Guittot
@ 2011-08-24 7:42 ` Linus Walleij
2011-08-24 7:56 ` Kyungmin Park
2011-08-24 8:26 ` Santosh
1 sibling, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2011-08-24 7:42 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Aug 24, 2011 at 8:44 AM, Vincent Guittot
<vincent.guittot@linaro.org> wrote:
> The same clock is used for all cpus so we must notify the frequency change
> for each one in order to update the configuration of all twd clockevents.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: ux500: send cpufreq notification for all cpus
2011-08-24 7:42 ` Linus Walleij
@ 2011-08-24 7:56 ` Kyungmin Park
2011-08-24 8:02 ` Vincent Guittot
0 siblings, 1 reply; 6+ messages in thread
From: Kyungmin Park @ 2011-08-24 7:56 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Aug 24, 2011 at 4:42 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Aug 24, 2011 at 8:44 AM, Vincent Guittot
> <vincent.guittot@linaro.org> wrote:
>
>> The same clock is used for all cpus so we must notify the frequency change
>> for each one in order to update the configuration of all twd clockevents.
BTW, does it same as other ARM cpus?. e.g., exynos4 has same codes as this.
How to you think it? Need to modify the same way?
Thank you,
Kyungmin Park
>>
>> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
> Yours,
> Linus Walleij
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: ux500: send cpufreq notification for all cpus
2011-08-24 7:56 ` Kyungmin Park
@ 2011-08-24 8:02 ` Vincent Guittot
0 siblings, 0 replies; 6+ messages in thread
From: Vincent Guittot @ 2011-08-24 8:02 UTC (permalink / raw)
To: linux-arm-kernel
On 24 August 2011 09:56, Kyungmin Park <kmpark@infradead.org> wrote:
> On Wed, Aug 24, 2011 at 4:42 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
>> On Wed, Aug 24, 2011 at 8:44 AM, Vincent Guittot
>> <vincent.guittot@linaro.org> wrote:
>>
>>> The same clock is used for all cpus so we must notify the frequency change
>>> for each one in order to update the configuration of all twd clockevents.
>
> BTW, does it same as other ARM cpus?. e.g., exynos4 has same codes as this.
>
> How to you think it? Need to modify the same way?
>
yes, each ARM platform which uses twd timer should check that the
notification is sent for each cpu.
> Thank you,
> Kyungmin Park
>>>
>>> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>>
>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>>
>> Yours,
>> Linus Walleij
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: ux500: send cpufreq notification for all cpus
2011-08-24 6:44 [PATCH] ARM: ux500: send cpufreq notification for all cpus Vincent Guittot
2011-08-24 7:42 ` Linus Walleij
@ 2011-08-24 8:26 ` Santosh
2011-08-24 9:26 ` Vincent Guittot
1 sibling, 1 reply; 6+ messages in thread
From: Santosh @ 2011-08-24 8:26 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 24 August 2011 12:14 PM, Vincent Guittot wrote:
> The same clock is used for all cpus so we must notify the frequency change
> for each one in order to update the configuration of all twd clockevents.
>
> Signed-off-by: Vincent Guittot<vincent.guittot@linaro.org>
> ---
> drivers/cpufreq/db8500-cpufreq.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/cpufreq/db8500-cpufreq.c b/drivers/cpufreq/db8500-cpufreq.c
> index 0d8dd1c..4cb5785 100644
> --- a/drivers/cpufreq/db8500-cpufreq.c
> +++ b/drivers/cpufreq/db8500-cpufreq.c
> @@ -76,13 +76,13 @@ static int db8500_cpufreq_target(struct cpufreq_policy *policy,
>
> freqs.old = policy->cur;
> freqs.new = freq_table[idx].frequency;
> - freqs.cpu = policy->cpu;
>
> if (freqs.old == freqs.new)
> return 0;
>
> /* pre-change notification */
> - cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
> + for_each_online_cpu(freqs.cpu)
> + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
Blind notfier on all online CPU's will race. Take a example whete CPU
is marked online but not yet registered to CPUFREQ. I have seen such a
race in OMAP and fixed that using the policy->cpus field.
Regards
Santosh
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: ux500: send cpufreq notification for all cpus
2011-08-24 8:26 ` Santosh
@ 2011-08-24 9:26 ` Vincent Guittot
0 siblings, 0 replies; 6+ messages in thread
From: Vincent Guittot @ 2011-08-24 9:26 UTC (permalink / raw)
To: linux-arm-kernel
On 24 August 2011 10:26, Santosh <santosh.shilimkar@ti.com> wrote:
> On Wednesday 24 August 2011 12:14 PM, Vincent Guittot wrote:
>>
>> The same clock is used for all cpus so we must notify the frequency change
>> for each one in order to update the configuration of all twd clockevents.
>>
>> Signed-off-by: Vincent Guittot<vincent.guittot@linaro.org>
>> ---
>> ?drivers/cpufreq/db8500-cpufreq.c | ? ?7 ++++---
>> ?1 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/cpufreq/db8500-cpufreq.c
>> b/drivers/cpufreq/db8500-cpufreq.c
>> index 0d8dd1c..4cb5785 100644
>> --- a/drivers/cpufreq/db8500-cpufreq.c
>> +++ b/drivers/cpufreq/db8500-cpufreq.c
>> @@ -76,13 +76,13 @@ static int db8500_cpufreq_target(struct cpufreq_policy
>> *policy,
>>
>> ? ? ? ?freqs.old = policy->cur;
>> ? ? ? ?freqs.new = freq_table[idx].frequency;
>> - ? ? ? freqs.cpu = policy->cpu;
>>
>> ? ? ? ?if (freqs.old == freqs.new)
>> ? ? ? ? ? ? ? ?return 0;
>>
>> ? ? ? ?/* pre-change notification */
>> - ? ? ? cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
>> + ? ? ? for_each_online_cpu(freqs.cpu)
>> + ? ? ? ? ? ? ? cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
>
> Blind notfier on all online CPU's will race. Take a example whete CPU
> is marked online but not yet registered to CPUFREQ. I have seen such a
> race in OMAP and fixed that using the policy->cpus field.
>
You're right, I'm going to use policy->cpus instead
> Regards
> Santosh
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-08-24 9:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-24 6:44 [PATCH] ARM: ux500: send cpufreq notification for all cpus Vincent Guittot
2011-08-24 7:42 ` Linus Walleij
2011-08-24 7:56 ` Kyungmin Park
2011-08-24 8:02 ` Vincent Guittot
2011-08-24 8:26 ` Santosh
2011-08-24 9:26 ` Vincent Guittot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).