aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru-Cezar Sardan <alexandru.sardan@freescale.com>2014-06-26 04:58:58 -0400
committerScott Wood <scottwood@freescale.com>2015-01-30 00:44:18 -0500
commit0d7d9b3a456aa8670cd9552f69529d57716f3122 (patch)
tree278c0c31448d4b3c144be1e8043774eb35ec5b44
parent5db431285d832156852d6f0013089b5d2305a28d (diff)
perf/powerpc: reset event hw state when adding it to the PMU
When adding an event to the PMU with PERF_EF_START the STOPPED and UPTODATE flags need to be cleared in the hw.event status variable because they are preventing the update of the event count on overflow interrupt. Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r--arch/powerpc/perf/core-fsl-emb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c
index e9fe904b6538..5d747b4cb8ee 100644
--- a/arch/powerpc/perf/core-fsl-emb.c
+++ b/arch/powerpc/perf/core-fsl-emb.c
@@ -330,9 +330,11 @@ static int fsl_emb_pmu_add(struct perf_event *event, int flags)
330 } 330 }
331 local64_set(&event->hw.prev_count, val); 331 local64_set(&event->hw.prev_count, val);
332 332
333 if (!(flags & PERF_EF_START)) { 333 if (unlikely(!(flags & PERF_EF_START))) {
334 event->hw.state = PERF_HES_STOPPED | PERF_HES_UPTODATE; 334 event->hw.state = PERF_HES_STOPPED | PERF_HES_UPTODATE;
335 val = 0; 335 val = 0;
336 } else {
337 event->hw.state &= ~(PERF_HES_STOPPED | PERF_HES_UPTODATE);
336 } 338 }
337 339
338 write_pmc(i, val); 340 write_pmc(i, val);