Skip to content

Commit de34787

Browse files
Madhavan Srinivasanmpe
authored andcommitted
powerpc/perf: Fix pmu_count to count only nest imc pmus
"pmu_count" in opal_imc_counters_probe() is intended to hold the number of successful nest imc pmu registerations. But current code also counts other imc units like core_imc and thread_imc. Patch add a check to count only nest imc pmus. Signed-off-by: Madhavan Srinivasan <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 252eb55 commit de34787

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/powerpc/platforms/powernv/opal-imc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,10 @@ static int opal_imc_counters_probe(struct platform_device *pdev)
191191
break;
192192
}
193193

194-
if (!imc_pmu_create(imc_dev, pmu_count, domain))
195-
pmu_count++;
194+
if (!imc_pmu_create(imc_dev, pmu_count, domain)) {
195+
if (domain == IMC_DOMAIN_NEST)
196+
pmu_count++;
197+
}
196198
}
197199

198200
return 0;

0 commit comments

Comments
 (0)