diff mbox

[V4,02/15] ARM: ux500: cpuidle: replace for_each_online_cpu by for_each_possible_cpu

Message ID 1366707285-12179-3-git-send-email-daniel.lezcano@linaro.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Daniel Lezcano April 23, 2013, 8:54 a.m. UTC
All the drivers are using, in their initialization function, the
for_each_possible_cpu macro.

Using for_each_online_cpu means the driver must handle the initialization
of the cpuidle device when a cpu is up which is not the case here.

Change the macro to for_each_possible_cpu as that fix the hotplug
initialization and make the initialization routine consistent with the
rest of the code in the different drivers.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-ux500/cpuidle.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Chander Kashyap April 30, 2013, 9:16 a.m. UTC | #1
On 23 April 2013 14:24, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
> All the drivers are using, in their initialization function, the
> for_each_possible_cpu macro.
>
> Using for_each_online_cpu means the driver must handle the initialization
> of the cpuidle device when a cpu is up which is not the case here.
>
> Change the macro to for_each_possible_cpu as that fix the hotplug
> initialization and make the initialization routine consistent with the
> rest of the code in the different drivers.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/mach-ux500/cpuidle.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c
> index c29c1bf..5657d4a 100644
> --- a/arch/arm/mach-ux500/cpuidle.c
> +++ b/arch/arm/mach-ux500/cpuidle.c
> @@ -125,7 +125,7 @@ int __init ux500_idle_init(void)
>                 return ret;
>         }
>
> -       for_each_online_cpu(cpu) {
> +       for_each_possible(cpu) {

for_each_possible(cpu) or for_each_possible_cpu(cpu) ?
>                 device = &per_cpu(ux500_cpuidle_device, cpu);
>                 device->cpu = cpu;
>                 ret = cpuidle_register_device(device);
> @@ -139,7 +139,7 @@ out:
>         return ret;
>
>  out_unregister:
> -       for_each_online_cpu(cpu) {
> +       for_each_possible_cpu(cpu) {
>                 device = &per_cpu(ux500_cpuidle_device, cpu);
>                 cpuidle_unregister_device(device);
>         }
> --
> 1.7.9.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



--
with warm regards,
Chander Kashyap
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c
index c29c1bf..5657d4a 100644
--- a/arch/arm/mach-ux500/cpuidle.c
+++ b/arch/arm/mach-ux500/cpuidle.c
@@ -125,7 +125,7 @@  int __init ux500_idle_init(void)
 		return ret;
 	}
 
-	for_each_online_cpu(cpu) {
+	for_each_possible(cpu) {
 		device = &per_cpu(ux500_cpuidle_device, cpu);
 		device->cpu = cpu;
 		ret = cpuidle_register_device(device);
@@ -139,7 +139,7 @@  out:
 	return ret;
 
 out_unregister:
-	for_each_online_cpu(cpu) {
+	for_each_possible_cpu(cpu) {
 		device = &per_cpu(ux500_cpuidle_device, cpu);
 		cpuidle_unregister_device(device);
 	}