diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-12-31 06:06:27 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-12-31 06:06:27 +0000 |
commit | 4b32f160bc40db2f938ace7c46675aae1e555757 (patch) | |
tree | 82cb3cc5e087b587151a3dfdb341f16e389f831a /sys-kernel/linux-image-redcore/files/5.4-0010-Don-t-use-hrtimer-overlay-when-pm_freezing-since-som.patch | |
parent | 03aeee4f84e9c065db81e0eff914fe7ba8ae7d30 (diff) |
sys-kernel/linux-{image,sources}-redcore : version bump to v5.4.5, enable aditional hardening options
Diffstat (limited to 'sys-kernel/linux-image-redcore/files/5.4-0010-Don-t-use-hrtimer-overlay-when-pm_freezing-since-som.patch')
-rw-r--r-- | sys-kernel/linux-image-redcore/files/5.4-0010-Don-t-use-hrtimer-overlay-when-pm_freezing-since-som.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/sys-kernel/linux-image-redcore/files/5.4-0010-Don-t-use-hrtimer-overlay-when-pm_freezing-since-som.patch b/sys-kernel/linux-image-redcore/files/5.4-0010-Don-t-use-hrtimer-overlay-when-pm_freezing-since-som.patch new file mode 100644 index 00000000..585ae59c --- /dev/null +++ b/sys-kernel/linux-image-redcore/files/5.4-0010-Don-t-use-hrtimer-overlay-when-pm_freezing-since-som.patch @@ -0,0 +1,69 @@ +From 33b744fc53a49695b73d2f54868b72ea83b6809e Mon Sep 17 00:00:00 2001 +From: Con Kolivas <kernel@kolivas.org> +Date: Mon, 20 Feb 2017 13:32:58 +1100 +Subject: [PATCH 10/16] Don't use hrtimer overlay when pm_freezing since some + drivers still don't correctly use freezable timeouts. + +--- + kernel/time/hrtimer.c | 2 +- + kernel/time/timer.c | 9 +++++---- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index defde211815c..10cc9f1e5dfe 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -2228,7 +2228,7 @@ long __sched schedule_msec_hrtimeout(long timeout) + * (yet) better than Hz, as would occur during startup, use regular + * timers. + */ +- if (jiffs > 4 || hrtimer_resolution >= NSEC_PER_SEC / HZ) ++ if (jiffs > 4 || hrtimer_resolution >= NSEC_PER_SEC / HZ || pm_freezing) + return schedule_timeout(jiffs); + + secs = timeout / 1000; +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 4ba3f6447a61..13034cc7c9a4 100644 +--- a/kernel/time/timer.c ++++ b/kernel/time/timer.c +@@ -43,6 +43,7 @@ + #include <linux/sched/debug.h> + #include <linux/slab.h> + #include <linux/compat.h> ++#include <linux/freezer.h> + + #include <linux/uaccess.h> + #include <asm/unistd.h> +@@ -2064,12 +2065,12 @@ void msleep(unsigned int msecs) + * Use high resolution timers where the resolution of tick based + * timers is inadequate. + */ +- if (jiffs < 5 && hrtimer_resolution < NSEC_PER_SEC / HZ) { ++ if (jiffs < 5 && hrtimer_resolution < NSEC_PER_SEC / HZ && !pm_freezing) { + while (msecs) + msecs = schedule_msec_hrtimeout_uninterruptible(msecs); + return; + } +- timeout = msecs_to_jiffies(msecs) + 1; ++ timeout = jiffs + 1; + + while (timeout) + timeout = schedule_timeout_uninterruptible(timeout); +@@ -2086,12 +2087,12 @@ unsigned long msleep_interruptible(unsigned int msecs) + int jiffs = msecs_to_jiffies(msecs); + unsigned long timeout; + +- if (jiffs < 5 && hrtimer_resolution < NSEC_PER_SEC / HZ) { ++ if (jiffs < 5 && hrtimer_resolution < NSEC_PER_SEC / HZ && !pm_freezing) { + while (msecs && !signal_pending(current)) + msecs = schedule_msec_hrtimeout_interruptible(msecs); + return msecs; + } +- timeout = msecs_to_jiffies(msecs) + 1; ++ timeout = jiffs + 1; + + while (timeout && !signal_pending(current)) + timeout = schedule_timeout_interruptible(timeout); +-- +2.20.1 + |