diff options
author | Will Deacon <will.deacon@arm.com> | 2012-02-24 12:20:16 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-04-28 18:31:37 +0200 |
commit | 0bd82adee38046fcf180a60ca56c181702287646 (patch) | |
tree | 9505fb85fa35a47a63c62df735e1f12a81e2019e /arch/arm/kernel/smp_scu.c | |
parent | ARM: 7374/1: add TRACEHOOK support (diff) | |
download | linux-0bd82adee38046fcf180a60ca56c181702287646.tar.xz linux-0bd82adee38046fcf180a60ca56c181702287646.zip |
ARM: 7347/1: SCU: use cpu_logical_map for per-CPU low power mode
scu_power_mode changes the power mode for the current CPU, which it
determines from smp_processor_id(). However, this assumes that the
physical CPU number is equal to Linux's logical CPU number and if this
is not true, we will power off the wrong CPU.
This patch uses cpu_logical_map to translate the logical CPU number
into a physical one in scu_power_mode.
Reported-by: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/smp_scu.c')
-rw-r--r-- | arch/arm/kernel/smp_scu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c index 8f5dd7963356..b9f015e843d8 100644 --- a/arch/arm/kernel/smp_scu.c +++ b/arch/arm/kernel/smp_scu.c @@ -11,6 +11,7 @@ #include <linux/init.h> #include <linux/io.h> +#include <asm/smp_plat.h> #include <asm/smp_scu.h> #include <asm/cacheflush.h> #include <asm/cputype.h> @@ -74,7 +75,7 @@ void scu_enable(void __iomem *scu_base) int scu_power_mode(void __iomem *scu_base, unsigned int mode) { unsigned int val; - int cpu = smp_processor_id(); + int cpu = cpu_logical_map(smp_processor_id()); if (mode > 3 || mode == 1 || cpu > 3) return -EINVAL; |