summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/perf_event.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-02-18 15:26:37 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-02-18 15:26:37 -0800
commit06ca7c4376b779e6cb11527abc4f609ddca35b58 (patch)
tree3762945d93d82c1489d1ef254941d2af0c5fdc57 /arch/powerpc/kernel/perf_event.c
parent7bcd5b4671c3aa9185a7e6f76ee12e392070ddea (diff)
parent9a45a9407c69d068500923480884661e2b9cc421 (diff)
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Here are a few more fixes for powerpc. Some are regressions, the rest is simple/obvious/nasty enough that I deemed it good to go now. Here's also step one of deprecating legacy iSeries support: we are removing it from the main defconfig. Nobody seems to be using it anymore and the code is nasty to maintain, (involves horrible hacks in various low level areas of the kernel) so we plan to actually rip it out at some point. For now let's just avoid building it by default. Stephen will proceed to do the actual removal later (probably 3.4 or 3.5). * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc/perf: power_pmu_start restores incorrect values, breaking frequency events powerpc/adb: Use set_current_state() powerpc: Disable interrupts early in Program Check powerpc: Remove legacy iSeries from ppc64_defconfig powerpc/fsl/pci: Fix PCIe fixup regression powerpc: Fix kernel log of oops/panic instruction dump
Diffstat (limited to 'arch/powerpc/kernel/perf_event.c')
-rw-r--r--arch/powerpc/kernel/perf_event.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c
index 10a140f82cb8..64483fde95c6 100644
--- a/arch/powerpc/kernel/perf_event.c
+++ b/arch/powerpc/kernel/perf_event.c
@@ -865,6 +865,7 @@ static void power_pmu_start(struct perf_event *event, int ef_flags)
{
unsigned long flags;
s64 left;
+ unsigned long val;
if (!event->hw.idx || !event->hw.sample_period)
return;
@@ -880,7 +881,12 @@ static void power_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);