From: Madhavan Srinivasan Date: Wed, 22 Nov 2017 05:15:38 +0000 (+0530) Subject: powerpc/perf: Fix pmu_count to count only nest imc pmus X-Git-Tag: v4.19~2055^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de34787f1096cce38e2590be0013b44418d14546;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c index 21f6531..b150f4d 100644 --- a/arch/powerpc/platforms/powernv/opal-imc.c +++ b/arch/powerpc/platforms/powernv/opal-imc.c @@ -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;