[PATCH] powerpc/pseries: Fix maximum memory value

Aravinda Prasad aravinda at linux.vnet.ibm.com
Thu Jun 27 18:38:34 AEST 2019



On Thursday 27 June 2019 04:06 AM, Nathan Lynch wrote:
> Aravinda Prasad <aravinda at linux.vnet.ibm.com> writes:
>> Calculating the maximum memory based on the number of lmbs
>> and lmb size does not account for the RMA region. Hence
>> use drmem_lmb_memory_max(), which already accounts for the
>> RMA region, to fetch the maximum memory value.
>>
>> Fixes: 772b039fd9a7: ("powerpc/pseries: Export maximum memory value")
>> Signed-off-by: Aravinda Prasad <aravinda at linux.vnet.ibm.com>
>> ---
>>  arch/powerpc/platforms/pseries/lparcfg.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c
>> index e33e8bc..f425842 100644
>> --- a/arch/powerpc/platforms/pseries/lparcfg.c
>> +++ b/arch/powerpc/platforms/pseries/lparcfg.c
>> @@ -435,7 +435,7 @@ static void maxmem_data(struct seq_file *m)
>>  {
>>  	unsigned long maxmem = 0;
>>  
>> -	maxmem += drmem_info->n_lmbs * drmem_info->lmb_size;
>> +	maxmem += drmem_lmb_memory_max();
> 
> Would memory_hotplug_max() be better here? There's no guarantee an LPAR
> will have the device tree node/properties that populate drmem.

I see memory_hotplug_max() calling drmem_lmb_memory_max() if "/rtas"
node is not available or else it fetches from "ibm,lrdr-capacity". So I
think memory_hotplug_max() can be used.

Regards,
Aravinda

> 

-- 
Regards,
Aravinda


More information about the Linuxppc-dev mailing list