diff options
author | Juri Lelli <juri.lelli@arm.com> | 2014-08-15 10:53:14 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-08-27 10:40:45 -0400 |
commit | eba1c71819d210f5e0d522571f9b8abce94fe9c5 (patch) | |
tree | 9ce0c82dc16f8f20caecb76956b234377de52a6a /arch | |
parent | 2c32c65e3726c773760038910be30cce1b4d4149 (diff) |
ARM: 8130/1: cpuidle/cpuidle-big_little: fix reading cpu id part number
Commit af040ffc9ba1 ("ARM: make it easier to check the CPU part number
correctly") changed ARM_CPU_PART_X masks, and the way they are returned and
checked against. Usage of read_cpuid_part_number() is now deprecated, and
calling places updated accordingly. This actually broke cpuidle-big_little
initialization, as bl_idle_driver_init() performs a check using an hardcoded
mask on cpu_id.
Create an interface to perform the check (that is now even easier to read).
Define also a proper mask (ARM_CPU_PART_MASK) that makes this kind of checks
cleaner and helps preventing bugs in the future. Update usage accordingly.
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/cputype.h | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/smp_plat.h | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h index 963a2515906d..819777d0e91f 100644 --- a/arch/arm/include/asm/cputype.h +++ b/arch/arm/include/asm/cputype.h | |||
@@ -74,6 +74,7 @@ | |||
74 | #define ARM_CPU_PART_CORTEX_A12 0x4100c0d0 | 74 | #define ARM_CPU_PART_CORTEX_A12 0x4100c0d0 |
75 | #define ARM_CPU_PART_CORTEX_A17 0x4100c0e0 | 75 | #define ARM_CPU_PART_CORTEX_A17 0x4100c0e0 |
76 | #define ARM_CPU_PART_CORTEX_A15 0x4100c0f0 | 76 | #define ARM_CPU_PART_CORTEX_A15 0x4100c0f0 |
77 | #define ARM_CPU_PART_MASK 0xff00fff0 | ||
77 | 78 | ||
78 | #define ARM_CPU_XSCALE_ARCH_MASK 0xe000 | 79 | #define ARM_CPU_XSCALE_ARCH_MASK 0xe000 |
79 | #define ARM_CPU_XSCALE_ARCH_V1 0x2000 | 80 | #define ARM_CPU_XSCALE_ARCH_V1 0x2000 |
@@ -179,7 +180,7 @@ static inline unsigned int __attribute_const__ read_cpuid_implementor(void) | |||
179 | */ | 180 | */ |
180 | static inline unsigned int __attribute_const__ read_cpuid_part(void) | 181 | static inline unsigned int __attribute_const__ read_cpuid_part(void) |
181 | { | 182 | { |
182 | return read_cpuid_id() & 0xff00fff0; | 183 | return read_cpuid_id() & ARM_CPU_PART_MASK; |
183 | } | 184 | } |
184 | 185 | ||
185 | static inline unsigned int __attribute_const__ __deprecated read_cpuid_part_number(void) | 186 | static inline unsigned int __attribute_const__ __deprecated read_cpuid_part_number(void) |
diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h index a252c0bfacf5..0ad7d490ee6f 100644 --- a/arch/arm/include/asm/smp_plat.h +++ b/arch/arm/include/asm/smp_plat.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/cpumask.h> | 8 | #include <linux/cpumask.h> |
9 | #include <linux/err.h> | 9 | #include <linux/err.h> |
10 | 10 | ||
11 | #include <asm/cpu.h> | ||
11 | #include <asm/cputype.h> | 12 | #include <asm/cputype.h> |
12 | 13 | ||
13 | /* | 14 | /* |
@@ -25,6 +26,20 @@ static inline bool is_smp(void) | |||
25 | #endif | 26 | #endif |
26 | } | 27 | } |
27 | 28 | ||
29 | /** | ||
30 | * smp_cpuid_part() - return part id for a given cpu | ||
31 | * @cpu: logical cpu id. | ||
32 | * | ||
33 | * Return: part id of logical cpu passed as argument. | ||
34 | */ | ||
35 | static inline unsigned int smp_cpuid_part(int cpu) | ||
36 | { | ||
37 | struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpu); | ||
38 | |||
39 | return is_smp() ? cpu_info->cpuid & ARM_CPU_PART_MASK : | ||
40 | read_cpuid_part(); | ||
41 | } | ||
42 | |||
28 | /* all SMP configurations have the extended CPUID registers */ | 43 | /* all SMP configurations have the extended CPUID registers */ |
29 | #ifndef CONFIG_MMU | 44 | #ifndef CONFIG_MMU |
30 | #define tlb_ops_need_broadcast() 0 | 45 | #define tlb_ops_need_broadcast() 0 |