mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
ARM: 8130/1: cpuidle/cpuidle-big_little: fix reading cpu id part number
Commit af040ffc9b ("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 <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Signed-off-by: Russell King <[email protected]>
This commit is contained in:
parent
2c32c65e37
commit
eba1c71819
3 changed files with 20 additions and 11 deletions
|
|
@ -138,25 +138,18 @@ static int bl_enter_powerdown(struct cpuidle_device *dev,
|
|||
return idx;
|
||||
}
|
||||
|
||||
static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int cpu_id)
|
||||
static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int part_id)
|
||||
{
|
||||
struct cpuinfo_arm *cpu_info;
|
||||
struct cpumask *cpumask;
|
||||
unsigned long cpuid;
|
||||
int cpu;
|
||||
|
||||
cpumask = kzalloc(cpumask_size(), GFP_KERNEL);
|
||||
if (!cpumask)
|
||||
return -ENOMEM;
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
cpu_info = &per_cpu(cpu_data, cpu);
|
||||
cpuid = is_smp() ? cpu_info->cpuid : read_cpuid_id();
|
||||
|
||||
/* read cpu id part number */
|
||||
if ((cpuid & 0xFFF0) == cpu_id)
|
||||
for_each_possible_cpu(cpu)
|
||||
if (smp_cpuid_part(cpu) == part_id)
|
||||
cpumask_set_cpu(cpu, cpumask);
|
||||
}
|
||||
|
||||
drv->cpumask = cpumask;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue