From 0f0ce0455cad3062453ff389277841fbfc59b6d7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 24 Oct 2014 22:33:48 +0200 Subject: [PATCH] backports: add freezable_schedule_hrtimeout_range() This is used by the pt3 driver. Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/freezer.h | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 backport/backport-include/linux/freezer.h diff --git a/backport/backport-include/linux/freezer.h b/backport/backport-include/linux/freezer.h new file mode 100644 index 000000000000..6bd6985d70c9 --- /dev/null +++ b/backport/backport-include/linux/freezer.h @@ -0,0 +1,32 @@ +#ifndef __BACKPORT_FREEZER_H_INCLUDED +#define __BACKPORT_FREEZER_H_INCLUDED +#include_next + +#ifdef CONFIG_FREEZER +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) +/* + * Like schedule_hrtimeout_range(), but should not block the freezer. Do not + * call this with locks held. + */ +#define freezable_schedule_hrtimeout_range LINUX_BACKPORT(freezable_schedule_hrtimeout_range) +static inline int freezable_schedule_hrtimeout_range(ktime_t *expires, + unsigned long delta, const enum hrtimer_mode mode) +{ + int __retval; + freezer_do_not_count(); + __retval = schedule_hrtimeout_range(expires, delta, mode); + freezer_count(); + return __retval; +} +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) */ + +#else /* !CONFIG_FREEZER */ + +#ifndef freezable_schedule_hrtimeout_range +#define freezable_schedule_hrtimeout_range(expires, delta, mode) \ + schedule_hrtimeout_range(expires, delta, mode) +#endif + +#endif /* !CONFIG_FREEZER */ + +#endif /* __BACKPORT_FREEZER_H_INCLUDED */ -- 2.30.2