From bd6d5f1dd586a27c2082ad4d95ee58913b471f5c Mon Sep 17 00:00:00 2001 From: Andrea Bastoni Date: Tue, 28 Sep 2010 11:08:17 -0400 Subject: hrtimer: add init function to properly set hrtimer_start_on_info params This helper function is also useful to remind us that if we use hrtimer_pull outside the scope of triggering remote releases, we need to take care of properly set the "state" field of hrtimer_start_on_info structure. --- include/linux/hrtimer.h | 1 + kernel/hrtimer.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 370096d132d1..9470a9e4a8ff 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -374,6 +374,7 @@ __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode, int wakeup); #ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS +extern void hrtimer_start_on_info_init(struct hrtimer_start_on_info *info); extern int hrtimer_start_on(int cpu, struct hrtimer_start_on_info *info, struct hrtimer *timer, ktime_t time, const enum hrtimer_mode mode); diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 18314ae830ee..fdf95968e517 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1045,6 +1045,15 @@ EXPORT_SYMBOL_GPL(hrtimer_start); #ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS +/** + * hrtimer_start_on_info_init - Initialize hrtimer_start_on_info + */ +void hrtimer_start_on_info_init(struct hrtimer_start_on_info *info) +{ + memset(info, 0, sizeof(struct hrtimer_start_on_info)); + atomic_set(&info->state, HRTIMER_START_ON_INACTIVE); +} + /** * hrtimer_pull - PULL_TIMERS_VECTOR callback on remote cpu */ -- cgit v1.2.2