aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2013-06-28 04:15:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-25 17:07:22 -0400
commit382b9efb7be2d07e51f0a491ecd0a985e1ceb86e (patch)
tree4a0d92b1d9b9af345bcbb159d9bccd6316344ee2 /arch/powerpc
parentb26eb91187fdfa37b304b30003f799899e6373c9 (diff)
powerpc/perf: Don't enable if we have zero events
commit 4ea355b5368bde0574c12430df53334c4be3bdcf upstream. In power_pmu_enable() we still enable the PMU even if we have zero events. This should have no effect but doesn't make much sense. Instead just return after telling the hypervisor that we are not using the PMCs. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/perf/core-book3s.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index af4b4b1a691f..d3ee2e50a3a6 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -926,6 +926,11 @@ static void power_pmu_enable(struct pmu *pmu)
926 if (!cpuhw->disabled) 926 if (!cpuhw->disabled)
927 goto out; 927 goto out;
928 928
929 if (cpuhw->n_events == 0) {
930 ppc_set_pmu_inuse(0);
931 goto out;
932 }
933
929 cpuhw->disabled = 0; 934 cpuhw->disabled = 0;
930 935
931 /* 936 /*
@@ -937,8 +942,6 @@ static void power_pmu_enable(struct pmu *pmu)
937 if (!cpuhw->n_added) { 942 if (!cpuhw->n_added) {
938 mtspr(SPRN_MMCRA, cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE); 943 mtspr(SPRN_MMCRA, cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE);
939 mtspr(SPRN_MMCR1, cpuhw->mmcr[1]); 944 mtspr(SPRN_MMCR1, cpuhw->mmcr[1]);
940 if (cpuhw->n_events == 0)
941 ppc_set_pmu_inuse(0);
942 goto out_enable; 945 goto out_enable;
943 } 946 }
944 947