ARM: 8616/1: dt: Respect property size when parsing CPUs
authorRobin Murphy <robin.murphy@arm.com>
Mon, 26 Sep 2016 15:50:55 +0000 (16:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Feb 2017 22:32:53 +0000 (23:32 +0100)
commit88654a154ab6581cad22d2d73266b61242410fb8
tree4dec6103287dff9acb1a9534cb212b3b926260bd
parent7a6111b804ca8a4461a884e6494f6f17d6e3460b
ARM: 8616/1: dt: Respect property size when parsing CPUs

commit ba6dea4f7cedb4b1c17e36f4087675d817c2e24b upstream.

Whilst MPIDR values themselves are less than 32 bits, it is still
perfectly valid for a DT to have #address-cells > 1 in the CPUs node,
resulting in the "reg" property having leading zero cell(s). In that
situation, the big-endian nature of the data conspires with the current
behaviour of only reading the first cell to cause the kernel to think
all CPUs have ID 0, and become resoundingly unhappy as a consequence.

Take the full property length into account when parsing CPUs so as to
be correct under any circumstances.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/arm/kernel/devtree.c