All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug
@ 2017-05-22 20:44 Michael Bringmann
  2017-05-30 11:41 ` Michael Ellerman
  2017-06-01 13:31 ` Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Bringmann @ 2017-05-22 20:44 UTC (permalink / raw)
  To: paulus, Michael Ellerman, nfont, sahilmehta17, jallen, mwb,
	alastair, linuxppc-dev, linux-kernel


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 <mwb@linux.vnet.ibm.com>
---
 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);
 	}

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug
  2017-05-22 20:44 [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug Michael Bringmann
@ 2017-05-30 11:41 ` Michael Ellerman
  2017-05-30 17:35   ` Nathan Fontenot
  2017-06-01 13:31 ` Michael Ellerman
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2017-05-30 11:41 UTC (permalink / raw)
  To: Michael Bringmann, paulus, nfont, sahilmehta17, jallen, mwb,
	alastair, linuxppc-dev, linux-kernel

Michael Bringmann <mwb@linux.vnet.ibm.com> writes:

> 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 <mwb@linux.vnet.ibm.com>
>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug
  2017-05-30 11:41 ` Michael Ellerman
@ 2017-05-30 17:35   ` Nathan Fontenot
  2017-05-31  4:03     ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Fontenot @ 2017-05-30 17:35 UTC (permalink / raw)
  To: Michael Ellerman, Michael Bringmann, paulus, sahilmehta17,
	jallen, alastair, linuxppc-dev, linux-kernel

On 05/30/2017 06:41 AM, Michael Ellerman wrote:
> Michael Bringmann <mwb@linux.vnet.ibm.com> writes:
> 
>> 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 <mwb@linux.vnet.ibm.com>
>>
>> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug
  2017-05-30 17:35   ` Nathan Fontenot
@ 2017-05-31  4:03     ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2017-05-31  4:03 UTC (permalink / raw)
  To: Nathan Fontenot, Michael Bringmann, paulus, sahilmehta17, jallen,
	alastair, linuxppc-dev, linux-kernel

Nathan Fontenot <nfont@linux.vnet.ibm.com> writes:
> On 05/30/2017 06:41 AM, Michael Ellerman wrote:
>> Michael Bringmann <mwb@linux.vnet.ibm.com> writes:
>>> 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 <mwb@linux.vnet.ibm.com>
>>>
>>> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: powerpc/hotplug-mem: Fix aa_index match bug for hotplug
  2017-05-22 20:44 [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug Michael Bringmann
  2017-05-30 11:41 ` Michael Ellerman
@ 2017-06-01 13:31 ` Michael Ellerman
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2017-06-01 13:31 UTC (permalink / raw)
  To: Michael Bringmann, paulus, nfont, sahilmehta17, jallen, mwb,
	alastair, linuxppc-dev, linux-kernel

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 <mwb@linux.vnet.ibm.com>

Applied to powerpc fixes, thanks.

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

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-01 13:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 20:44 [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug Michael Bringmann
2017-05-30 11:41 ` Michael Ellerman
2017-05-30 17:35   ` Nathan Fontenot
2017-05-31  4:03     ` Michael Ellerman
2017-06-01 13:31 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.