diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2013-06-28 12:15:11 +0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-07-01 05:49:54 +0400 |
commit | 378a6ee99e4a431ec84e4e61893445c041c93007 (patch) | |
tree | 0939805d144a03d8d083fd7a241660671fb3b075 /arch/powerpc/perf/power7-pmu.c | |
parent | d8bec4c9cd58f6d3679e09b7293851fb92ad7557 (diff) | |
download | linux-378a6ee99e4a431ec84e4e61893445c041c93007.tar.xz |
powerpc/perf: Rework disable logic in pmu_disable()
In pmu_disable() we disable the PMU by setting the FC (Freeze Counters)
bit in MMCR0. In order to do this we have to read/modify/write MMCR0.
It's possible that we read a value from MMCR0 which has PMAO (PMU Alert
Occurred) set. When we write that value back it will cause an interrupt
to occur. We will then end up in the PMU interrupt handler even though
we are supposed to have just disabled the PMU.
We can avoid this by making sure we never write PMAO back. We should not
lose interrupts because when the PMU is re-enabled the overflowed values
will cause another interrupt.
We also reorder the clearing of SAMPLE_ENABLE so that is done after the
PMU is frozen. Otherwise there is a small window between the clearing of
SAMPLE_ENABLE and the setting of FC where we could take an interrupt and
incorrectly see SAMPLE_ENABLE not set. This would for example change the
logic in perf_read_regs().
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
CC: <stable@vger.kernel.org> [v3.10]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/perf/power7-pmu.c')
0 files changed, 0 insertions, 0 deletions