diff mbox series

powerpc/powernv: Fix IMC_MAX_PMU macro

Message ID 1510229426-5547-1-git-send-email-anju@linux.vnet.ibm.com (mailing list archive)
State Changes Requested
Headers show
Series powerpc/powernv: Fix IMC_MAX_PMU macro | expand

Commit Message

Anju T Sudhakar Nov. 9, 2017, 12:10 p.m. UTC
IMC_MAX_PMU is used for static storage (per_nest_pmu_arr) which holds
nest pmu information. Current value for the macro is 32 based on
the initial number of nest pmu units supported by the nest microcode.
Currently 29 nest units are enabled based on the system configuration.
But going forward, microcode could support more nest units (max of 64
nest units). Hence fix the value for the macro.

Fixes:8f95faaac56c1 ('powerpc/powernv: Detect and create IMC device')
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/imc-pmu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Ellerman Nov. 9, 2017, 9:02 p.m. UTC | #1
Anju T Sudhakar <anju@linux.vnet.ibm.com> writes:

> IMC_MAX_PMU is used for static storage (per_nest_pmu_arr) which holds
> nest pmu information. Current value for the macro is 32 based on
> the initial number of nest pmu units supported by the nest microcode.
> Currently 29 nest units are enabled based on the system configuration.
> But going forward, microcode could support more nest units (max of 64
> nest units). Hence fix the value for the macro.

There should be no reason to have a hard coded limit.

We should just fix the code to dynamically size the array based on
what's found in the device tree.

cheers

> Fixes:8f95faaac56c1 ('powerpc/powernv: Detect and create IMC device')
> Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/imc-pmu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/imc-pmu.h b/arch/powerpc/include/asm/imc-pmu.h
> index 7f74c28..f9f0f2e 100644
> --- a/arch/powerpc/include/asm/imc-pmu.h
> +++ b/arch/powerpc/include/asm/imc-pmu.h
> @@ -23,7 +23,7 @@
>  /*
>   * For static allocation of some of the structures.
>   */
> -#define IMC_MAX_PMUS			32
> +#define IMC_MAX_PMUS			64
>  
>  /*
>   * Compatibility macros for IMC devices
> -- 
> 2.7.4
maddy Nov. 10, 2017, 1:02 a.m. UTC | #2
On Friday 10 November 2017 02:32 AM, Michael Ellerman wrote:
> Anju T Sudhakar <anju@linux.vnet.ibm.com> writes:
>
>> IMC_MAX_PMU is used for static storage (per_nest_pmu_arr) which holds
>> nest pmu information. Current value for the macro is 32 based on
>> the initial number of nest pmu units supported by the nest microcode.
>> Currently 29 nest units are enabled based on the system configuration.
>> But going forward, microcode could support more nest units (max of 64
>> nest units). Hence fix the value for the macro.
> There should be no reason to have a hard coded limit.
>
> We should just fix the code to dynamically size the array based on
> what's found in the device tree.

Yes. My bad. Device tree handling part is done in the
platform/powernv side and this data (total number of nest pmus)
can be extended from there. Will work on it.

Thanks for review comments.
Maddy

>
> cheers
>
>> Fixes:8f95faaac56c1 ('powerpc/powernv: Detect and create IMC device')
>> Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
>> ---
>>   arch/powerpc/include/asm/imc-pmu.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/include/asm/imc-pmu.h b/arch/powerpc/include/asm/imc-pmu.h
>> index 7f74c28..f9f0f2e 100644
>> --- a/arch/powerpc/include/asm/imc-pmu.h
>> +++ b/arch/powerpc/include/asm/imc-pmu.h
>> @@ -23,7 +23,7 @@
>>   /*
>>    * For static allocation of some of the structures.
>>    */
>> -#define IMC_MAX_PMUS			32
>> +#define IMC_MAX_PMUS			64
>>   
>>   /*
>>    * Compatibility macros for IMC devices
>> -- 
>> 2.7.4
diff mbox series

Patch

diff --git a/arch/powerpc/include/asm/imc-pmu.h b/arch/powerpc/include/asm/imc-pmu.h
index 7f74c28..f9f0f2e 100644
--- a/arch/powerpc/include/asm/imc-pmu.h
+++ b/arch/powerpc/include/asm/imc-pmu.h
@@ -23,7 +23,7 @@ 
 /*
  * For static allocation of some of the structures.
  */
-#define IMC_MAX_PMUS			32
+#define IMC_MAX_PMUS			64
 
 /*
  * Compatibility macros for IMC devices