OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:23:40 +0000 (15:23 +0200)
commitc84cc7b9064a22aaf73c3a5fc4c073cd4d588c98
tree4355a68d06743db0ce8feabe7ff54df7369cc2d0
parent75e5de50532f91b166d9340a128ffc4752da657f
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kernel/devtree.c