Skip to content

Commit 1cfe1e9

Browse files
mwbringmanngregkh
authored andcommitted
powerpc/hotplug-mem: Fix missing endian conversion of aa_index
commit dc421b200f91930c9c6a9586810ff8c232cf10fc upstream. When adding or removing memory, the aa_index (affinity value) for the memblock must also be converted to match the endianness of the rest of the 'ibm,dynamic-memory' property. Otherwise, subsequent retrieval of the attribute will likely lead to non-existent nodes, followed by using the default node in the code inappropriately. Fixes: 5f97b2a ("powerpc/pseries: Implement memory hotplug add in the kernel") Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8c92870 commit 1cfe1e9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/powerpc/platforms/pseries/hotplug-memory.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn)
110110
for (i = 0; i < num_lmbs; i++) {
111111
lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr);
112112
lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index);
113+
lmbs[i].aa_index = be32_to_cpu(lmbs[i].aa_index);
113114
lmbs[i].flags = be32_to_cpu(lmbs[i].flags);
114115
}
115116

@@ -553,6 +554,7 @@ static void dlpar_update_drconf_property(struct device_node *dn,
553554
for (i = 0; i < num_lmbs; i++) {
554555
lmbs[i].base_addr = cpu_to_be64(lmbs[i].base_addr);
555556
lmbs[i].drc_index = cpu_to_be32(lmbs[i].drc_index);
557+
lmbs[i].aa_index = cpu_to_be32(lmbs[i].aa_index);
556558
lmbs[i].flags = cpu_to_be32(lmbs[i].flags);
557559
}
558560

0 commit comments

Comments
 (0)