summaryrefslogtreecommitdiff
path: root/backport/backport-include/linux/freezer.h
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2019-02-21 10:23:08 +0100
committerDominik Sliwa <dominik.sliwa@toradex.com>2019-02-21 10:23:44 +0100
commit0bdb080c70495ea4efbed7661b4fe6100bd5adde (patch)
tree9b0e0278c74c56b724540c9c12621f2fed70a6ff /backport/backport-include/linux/freezer.h
parente5561ba59729bf97f11bc11bb61fd4ef5c08c3b9 (diff)
Revert "backports: Remove unused parts"
This reverts commit ab3fd3b9a801a9faa2619e2e65207e736f859a6d.
Diffstat (limited to 'backport/backport-include/linux/freezer.h')
-rw-r--r--backport/backport-include/linux/freezer.h32
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..c6053f30
--- /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_IS_LESS(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_IS_LESS(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 */