Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of/fdt: Remove PPC32 longtrail hack in memory scan

When the OF code was originally made common by Grant in commit
51975db0b733 ("of/flattree: merge early_init_dt_scan_memory() common
code") (Feb 2010), the common code inherited a hack to handle
PPC "longtrail" machines, which had a "memory@0" node with no
device_type.

That check was then made to only apply to PPC32 in b44aa25d20e2 ("of:
Handle memory@0 node on PPC32 only") (May 2014).

But according to Paul Mackerras the "longtrail" machines are long
dead, if they were ever seen in the wild at all. If someone does still
have one, we can handle this firmware wart in powerpc platform code.

So remove the hack once and for all.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Michael Ellerman and committed by
Rob Herring
da653130 791d3ef2

+1 -8
+1 -8
drivers/of/fdt.c
··· 1034 1034 bool hotpluggable; 1035 1035 1036 1036 /* We are scanning "memory" nodes only */ 1037 - if (type == NULL) { 1038 - /* 1039 - * The longtrail doesn't have a device_type on the 1040 - * /memory node, so look for the node called /memory@0. 1041 - */ 1042 - if (!IS_ENABLED(CONFIG_PPC32) || depth != 1 || strcmp(uname, "memory@0") != 0) 1043 - return 0; 1044 - } else if (strcmp(type, "memory") != 0) 1037 + if (type == NULL || strcmp(type, "memory") != 0) 1045 1038 return 0; 1046 1039 1047 1040 reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);