[PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3350d

5 messages, 4 authors, 2017-06-01 · open the first message on its own page

[PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug

From: Michael Bringmann <hidden>
Date: 2017-05-22 20:44:46

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.

Signed-off-by: Michael Bringmann <redacted>
---
 arch/powerpc/platforms/pseries/hotplug-memory.c |    2 ++
 1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index e104c71..1fb162b 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -124,6 +124,7 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn)
 	for (i = 0; i < num_lmbs; i++) {
 		lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr);
 		lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index);
+		lmbs[i].aa_index = be32_to_cpu(lmbs[i].aa_index);
 		lmbs[i].flags = be32_to_cpu(lmbs[i].flags);
 	}
 
@@ -147,6 +148,7 @@ static void dlpar_update_drconf_property(struct device_node *dn,
 	for (i = 0; i < num_lmbs; i++) {
 		lmbs[i].base_addr = cpu_to_be64(lmbs[i].base_addr);
 		lmbs[i].drc_index = cpu_to_be32(lmbs[i].drc_index);
+		lmbs[i].aa_index = cpu_to_be32(lmbs[i].aa_index);
 		lmbs[i].flags = cpu_to_be32(lmbs[i].flags);
 	}

Re: [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-05-30 11:42:05

Michael Bringmann [off-list ref] writes:
quoted hunk
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.

Signed-off-by: Michael Bringmann <redacted>
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index e104c71..1fb162b 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -124,6 +124,7 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn)
 	for (i = 0; i < num_lmbs; i++) {
 		lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr);
 		lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index);
+		lmbs[i].aa_index = be32_to_cpu(lmbs[i].aa_index);
 		lmbs[i].flags = be32_to_cpu(lmbs[i].flags);
 	}
 
AFAICS this code was added in commit 5f97b2a0d176 ("powerpc/pseries:
Implement memory hotplug add in the kernel").

So this should probably be marked:

  Fixes: 5f97b2a0d176 ("powerpc/pseries: Implement memory hotplug add in the kernel")

And it seems like a bug we'd want fixed in stable, so:

  Cc: stable@vger.kernel.org # v4.1+


Am I right?

cheers

Re: [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug

From: Nathan Fontenot <hidden>
Date: 2017-05-30 17:35:54

On 05/30/2017 06:41 AM, Michael Ellerman wrote:
Michael Bringmann [off-list ref] writes:
quoted
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.

Signed-off-by: Michael Bringmann <redacted>
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index e104c71..1fb162b 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -124,6 +124,7 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn)
 	for (i = 0; i < num_lmbs; i++) {
 		lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr);
 		lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index);
+		lmbs[i].aa_index = be32_to_cpu(lmbs[i].aa_index);
 		lmbs[i].flags = be32_to_cpu(lmbs[i].flags);
 	}
 
AFAICS this code was added in commit 5f97b2a0d176 ("powerpc/pseries:
Implement memory hotplug add in the kernel").

So this should probably be marked:

  Fixes: 5f97b2a0d176 ("powerpc/pseries: Implement memory hotplug add in the kernel")

And it seems like a bug we'd want fixed in stable, so:

  Cc: stable@vger.kernel.org # v4.1+


Am I right?
Yes, that is correct.

-Nathan

Re: [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-05-31 04:03:27

Nathan Fontenot [off-list ref] writes:
On 05/30/2017 06:41 AM, Michael Ellerman wrote:
quoted
Michael Bringmann [off-list ref] writes:
quoted
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.

Signed-off-by: Michael Bringmann <redacted>
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index e104c71..1fb162b 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -124,6 +124,7 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn)
 	for (i = 0; i < num_lmbs; i++) {
 		lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr);
 		lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index);
+		lmbs[i].aa_index = be32_to_cpu(lmbs[i].aa_index);
 		lmbs[i].flags = be32_to_cpu(lmbs[i].flags);
 	}
 
AFAICS this code was added in commit 5f97b2a0d176 ("powerpc/pseries:
Implement memory hotplug add in the kernel").

So this should probably be marked:

  Fixes: 5f97b2a0d176 ("powerpc/pseries: Implement memory hotplug add in the kernel")

And it seems like a bug we'd want fixed in stable, so:

  Cc: stable@vger.kernel.org # v4.1+

Am I right?
Yes, that is correct.
Thanks.

cheers

Re: powerpc/hotplug-mem: Fix aa_index match bug for hotplug

From: Michael Ellerman <hidden>
Date: 2017-06-01 13:31:11

On Mon, 2017-05-22 at 20:44:37 UTC, Michael Bringmann wrote:
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.

Signed-off-by: Michael Bringmann <redacted>
Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/dc421b200f91930c9c6a9586810ff8

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help