diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2014-10-24 22:33:48 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2014-10-25 11:10:07 +0200 |
commit | 0f0ce0455cad3062453ff389277841fbfc59b6d7 (patch) | |
tree | 2a108e098b27518fbfa63108ef608ec578a6cc3c /backport/backport-include | |
parent | f5570308a43f6379a659232ab2c38b5ce083f1a2 (diff) |
backports: add freezable_schedule_hrtimeout_range()
This is used by the pt3 driver.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'backport/backport-include')
-rw-r--r-- | backport/backport-include/linux/freezer.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/backport/backport-include/linux/freezer.h b/backport/backport-include/linux/freezer.h new file mode 100644 index 00000000..6bd6985d --- /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 <linux/freezer.h> + +#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 */ |