Skip to content

Commit

Permalink
ARM: 7934/1: DT/kernel: fix arch_match_cpu_phys_id to avoid erroneous…
Browse files Browse the repository at this point in the history
… match

The MPIDR contains specific bitfields(MPIDR.Aff{2..0}) which uniquely
identify a CPU, in addition to some non-identifying information and
reserved bits. The ARM cpu binding defines the 'reg' property to only
contain the affinity bits, and any cpu nodes with other bits set in
their 'reg' entry are skipped.

As such it is not necessary to mask the phys_id with MPIDR_HWID_BITMASK,
and doing so could lead to matching erroneous CPU nodes in the device
tree. This patch removes the masking of the physical identifier.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Sudeep Holla authored and Russell King committed Jan 11, 2014
1 parent 6bcac80 commit e44ef89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/kernel/devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void __init arm_dt_init_cpu_maps(void)

bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
{
return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu);
return phys_id == cpu_logical_map(cpu);
}

static const void * __init arch_get_next_mach(const char *const **match)
Expand Down

0 comments on commit e44ef89

Please sign in to comment.