diff options
| author | Dmitry Shmidt <dimitrysh@google.com> | 2016-10-14 13:34:43 -0700 |
|---|---|---|
| committer | Dmitry Shmidt <dimitrysh@google.com> | 2016-10-14 13:34:43 -0700 |
| commit | 14de94f03d2c7562542599224e88965bc4d20a1d (patch) | |
| tree | be0ea1d0fd305bf61d91f11f7ffc31f930f1aa49 /arch/arm/kernel | |
| parent | fed8e608c338037d3ae408089631b731d21a8d80 (diff) | |
| parent | 11bfbae19413a2ffe70378b6e572be263869a2bc (diff) | |
Merge tag 'v4.4.24' into android-4.4.y
This is the 4.4.24 stable release
Diffstat (limited to 'arch/arm/kernel')
| -rw-r--r-- | arch/arm/kernel/devtree.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index 65addcbf5b30..b3b950fc8ea0 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c @@ -87,6 +87,8 @@ void __init arm_dt_init_cpu_maps(void) return; for_each_child_of_node(cpus, cpu) { + const __be32 *cell; + int prop_bytes; u32 hwid; if (of_node_cmp(cpu->type, "cpu")) @@ -98,7 +100,8 @@ void __init arm_dt_init_cpu_maps(void) * properties is considered invalid to build the * cpu_logical_map. */ - if (of_property_read_u32(cpu, "reg", &hwid)) { + cell = of_get_property(cpu, "reg", &prop_bytes); + if (!cell || prop_bytes < sizeof(*cell)) { pr_debug(" * %s missing reg property\n", cpu->full_name); of_node_put(cpu); @@ -106,10 +109,15 @@ void __init arm_dt_init_cpu_maps(void) } /* - * 8 MSBs must be set to 0 in the DT since the reg property + * Bits n:24 must be set to 0 in the DT since the reg property * defines the MPIDR[23:0]. */ - if (hwid & ~MPIDR_HWID_BITMASK) { + do { + hwid = be32_to_cpu(*cell++); + prop_bytes -= sizeof(*cell); + } while (!hwid && prop_bytes > 0); + + if (prop_bytes || (hwid & ~MPIDR_HWID_BITMASK)) { of_node_put(cpu); return; } |
