aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r--kernel/perf_counter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index db02eb16c777..473ed2cafbfc 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -2716,7 +2716,8 @@ static int cpu_clock_perf_counter_enable(struct perf_counter *counter)
2716 2716
2717static void cpu_clock_perf_counter_disable(struct perf_counter *counter) 2717static void cpu_clock_perf_counter_disable(struct perf_counter *counter)
2718{ 2718{
2719 hrtimer_cancel(&counter->hw.hrtimer); 2719 if (counter->hw.irq_period)
2720 hrtimer_cancel(&counter->hw.hrtimer);
2720 cpu_clock_perf_counter_update(counter); 2721 cpu_clock_perf_counter_update(counter);
2721} 2722}
2722 2723
@@ -2767,7 +2768,8 @@ static int task_clock_perf_counter_enable(struct perf_counter *counter)
2767 2768
2768static void task_clock_perf_counter_disable(struct perf_counter *counter) 2769static void task_clock_perf_counter_disable(struct perf_counter *counter)
2769{ 2770{
2770 hrtimer_cancel(&counter->hw.hrtimer); 2771 if (counter->hw.irq_period)
2772 hrtimer_cancel(&counter->hw.hrtimer);
2771 task_clock_perf_counter_update(counter, counter->ctx->time); 2773 task_clock_perf_counter_update(counter, counter->ctx->time);
2772 2774
2773} 2775}