From 37496baeea800e745a77620e90660496135f7fa5 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 20 Feb 2017 13:31:42 +1100 Subject: [PATCH 16/25] Fix build for disabled highres timers with hrtimeout code. --- include/linux/freezer.h | 1 + include/linux/sched.h | 22 ++++++++++++++++++++++ kernel/time/timer.c | 2 ++ 3 files changed, 25 insertions(+) diff --git a/include/linux/freezer.h b/include/linux/freezer.h index dd03e83..2fda682 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h @@ -296,6 +296,7 @@ static inline void set_freezable(void) {} #define wait_event_freezekillable_unsafe(wq, condition) \ wait_event_killable(wq, condition) +#define pm_freezing (false) #endif /* !CONFIG_FREEZER */ #endif /* FREEZER_H_INCLUDED */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 46544f4..680494d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -458,10 +458,32 @@ extern signed long schedule_timeout_killable(signed long timeout); extern signed long schedule_timeout_uninterruptible(signed long timeout); extern signed long schedule_timeout_idle(signed long timeout); +#ifdef CONFIG_HIGH_RES_TIMERS extern signed long schedule_msec_hrtimeout(signed long timeout); extern signed long schedule_min_hrtimeout(void); extern signed long schedule_msec_hrtimeout_interruptible(signed long timeout); extern signed long schedule_msec_hrtimeout_uninterruptible(signed long timeout); +#else +static inline signed long schedule_msec_hrtimeout(signed long timeout) +{ + return schedule_timeout(msecs_to_jiffies(timeout)); +} + +static inline signed long schedule_min_hrtimeout(void) +{ + return schedule_timeout(1); +} + +static inline signed long schedule_msec_hrtimeout_interruptible(signed long timeout) +{ + return schedule_timeout_interruptible(msecs_to_jiffies(timeout)); +} + +static inline signed long schedule_msec_hrtimeout_uninterruptible(signed long timeout) +{ + return schedule_timeout_uninterruptible(msecs_to_jiffies(timeout)); +} +#endif asmlinkage void schedule(void); extern void schedule_preempt_disabled(void); diff --git a/kernel/time/timer.c b/kernel/time/timer.c index bc53598..0e22641 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1750,6 +1750,7 @@ signed long __sched schedule_timeout(signed long timeout) expire = timeout + jiffies; +#ifdef CONFIG_HIGH_RES_TIMERS if (timeout == 1 && hrtimer_resolution < NSEC_PER_SEC / HZ) { /* * Special case 1 as being a request for the minimum timeout @@ -1760,6 +1761,7 @@ signed long __sched schedule_timeout(signed long timeout) return 0; goto out_timeout; } +#endif setup_timer_on_stack(&timer, process_timeout, (unsigned long)current); __mod_timer(&timer, expire, false); -- 2.9.3