Skip to content

Commit

Permalink
powerpc/perf: Fix pmu_count to count only nest imc pmus
Browse files Browse the repository at this point in the history
"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]>
  • Loading branch information
Madhavan Srinivasan authored and mpe committed Nov 22, 2017
1 parent 252eb55 commit de34787
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/powerpc/platforms/powernv/opal-imc.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ static int opal_imc_counters_probe(struct platform_device *pdev)
break;
}

if (!imc_pmu_create(imc_dev, pmu_count, domain))
pmu_count++;
if (!imc_pmu_create(imc_dev, pmu_count, domain)) {
if (domain == IMC_DOMAIN_NEST)
pmu_count++;
}
}

return 0;
Expand Down

0 comments on commit de34787

Please sign in to comment.