Skip to content

Commit

Permalink
perf_counter: powerpc: clean up perc_counter_interrupt
Browse files Browse the repository at this point in the history
Impact: cleanup

This updates the powerpc perf_counter_interrupt following on from the
"perf_counter: unify irq output code" patch.  Since we now use the
generic perf_counter_output code, which sets the perf_counter_pending
flag directly, we no longer need the need_wakeup variable.

This removes need_wakeup and makes perf_counter_interrupt use
get_perf_counter_pending() instead.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Orig-LKML-Reference: <20090319194234.024464535@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Paul Mackerras authored and Ingo Molnar committed Apr 6, 2009
1 parent 0322cd6 commit db4fb5a
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions arch/powerpc/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,6 @@ static void perf_counter_interrupt(struct pt_regs *regs)
/* counter has overflowed */
found = 1;
record_and_restart(counter, val, regs);
if (counter->wakeup_pending)
need_wakeup = 1;
}
}

Expand Down Expand Up @@ -754,17 +752,14 @@ static void perf_counter_interrupt(struct pt_regs *regs)
/*
* If we need a wakeup, check whether interrupts were soft-enabled
* when we took the interrupt. If they were, we can wake stuff up
* immediately; otherwise we'll have to set a flag and do the
* wakeup when interrupts get soft-enabled.
* immediately; otherwise we'll have do the wakeup when interrupts
* get soft-enabled.
*/
if (need_wakeup) {
if (regs->softe) {
irq_enter();
perf_counter_do_pending();
irq_exit();
} else {
set_perf_counter_pending();
}
if (get_perf_counter_pending() && regs->softe) {
irq_enter();
clear_perf_counter_pending();
perf_counter_do_pending();
irq_exit();
}
}

Expand Down

0 comments on commit db4fb5a

Please sign in to comment.