diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2015-02-04 12:03:21 +1100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-02-04 12:03:21 +1100 |
commit | a604c96eb07b2b65734a8aa0e9e8c1bfc435ee4f (patch) | |
tree | b1fad9ec35f0282acddbf71f3885a0b6a85f399b /arch/powerpc/perf | |
parent | 5c65670c9bfa3be1234d29f36b742897c0360ef3 (diff) | |
parent | 0dc294f717d41bfbafc746a7a96a7bc0f114c20c (diff) | |
download | linux-a604c96eb07b2b65734a8aa0e9e8c1bfc435ee4f.tar.bz2 |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux into next
Freescale updates from Scott:
"Highlights include 8xx optimizations, some more work on datapath device
tree content, e300 machine check support, t1040 corenet error reporting,
and various cleanups and fixes."
Diffstat (limited to 'arch/powerpc/perf')
-rw-r--r-- | arch/powerpc/perf/core-fsl-emb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c index 4acaea01fe03..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) } local64_set(&event->hw.prev_count, val); - if (!(flags & PERF_EF_START)) { + if (unlikely(!(flags & PERF_EF_START))) { event->hw.state = PERF_HES_STOPPED | PERF_HES_UPTODATE; val = 0; + } else { + event->hw.state &= ~(PERF_HES_STOPPED | PERF_HES_UPTODATE); } write_pmc(i, val); @@ -389,6 +391,7 @@ static void fsl_emb_pmu_del(struct perf_event *event, int flags) static void fsl_emb_pmu_start(struct perf_event *event, int ef_flags) { unsigned long flags; + unsigned long val; s64 left; if (event->hw.idx < 0 || !event->hw.sample_period) @@ -405,7 +408,10 @@ static void fsl_emb_pmu_start(struct perf_event *event, int ef_flags) event->hw.state = 0; left = local64_read(&event->hw.period_left); - write_pmc(event->hw.idx, left); + val = 0; + if (left < 0x80000000L) + val = 0x80000000L - left; + write_pmc(event->hw.idx, val); perf_event_update_userpage(event); perf_pmu_enable(event->pmu); |