powerpc/perf: Fix IMC_MAX_PMU macro
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Wed, 22 Nov 2017 05:15:39 +0000 (10:45 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 16:59:25 +0000 (17:59 +0100)
commit80da94a1c9f2a5002b9090a70d6a77d9c47a5a51
tree0ed4a3a97327908708e62452be82656d8342f0a3
parent97b858bfe955141edcca59a5824e974f52940fd5
powerpc/perf: Fix IMC_MAX_PMU macro

commit 73ce9aec65b17433e18163d07eb5cb6bf114bd6c upstream.

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.
But going forward, microcode could support more nest units. Instead
of static storage, patch to fix the code to dynamically allocate an
array based on the number of nest imc units found in the device tree.

Fixes:8f95faaac56c1 ('powerpc/powernv: Detect and create IMC device')
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/imc-pmu.h
arch/powerpc/perf/imc-pmu.c
arch/powerpc/platforms/powernv/opal-imc.c