summaryrefslogtreecommitdiff
path: root/patches/hrtimer-Allow-raw-wakeups-during-boot.patch
blob: 8fdb33e2288b3df971caeade3cf259aba6140cd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri, 9 Aug 2019 15:25:21 +0200
Subject: [PATCH] hrtimer: Allow raw wakeups during boot

There are a few wake-up timers during the early boot which are essencial for
the system to make progress. At this stage there are no softirq spawn for the
softirq processing so there is no timer processing in softirq.
The wakeup in question:

smpboot_create_thread()
 -> kthread_create_on_cpu()
    -> kthread_bind()
       -> wait_task_inactive()
         -> schedule_hrtimeout()

Let the timer fire in hardirq context during the system boot.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/time/hrtimer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1819,7 +1819,7 @@ static void __hrtimer_init_sleeper(struc
 	 * expiry.
 	 */
 	if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
-		if (task_is_realtime(current) && !(mode & HRTIMER_MODE_SOFT))
+		if ((task_is_realtime(current) && !(mode & HRTIMER_MODE_SOFT)) || system_state != SYSTEM_RUNNING)
 			mode |= HRTIMER_MODE_HARD;
 	}