diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-05-16 14:42:43 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-05-23 04:01:37 -0400 |
commit | b4def42724594cd399cfee365221f5b38639711d (patch) | |
tree | 43f7cd625e390349ad27d0a260674e5be7da2c0f /kernel/async.c | |
parent | b903dfb277c09e53d499480e9670557dcce36fbd (diff) |
async: Adjust system_state checks
To enable smp_processor_id() and might_sleep() debug checks earlier, it's
required to add system states between SYSTEM_BOOTING and SYSTEM_RUNNING.
Adjust the system_state check in async_run_entry_fn() and
async_synchronize_cookie_domain() to handle the extra states.
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20170516184735.865155020@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/async.c')
-rw-r--r-- | kernel/async.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/async.c b/kernel/async.c index d2edd6efec56..2cbd3dd5940d 100644 --- a/kernel/async.c +++ b/kernel/async.c | |||
@@ -114,14 +114,14 @@ static void async_run_entry_fn(struct work_struct *work) | |||
114 | ktime_t uninitialized_var(calltime), delta, rettime; | 114 | ktime_t uninitialized_var(calltime), delta, rettime; |
115 | 115 | ||
116 | /* 1) run (and print duration) */ | 116 | /* 1) run (and print duration) */ |
117 | if (initcall_debug && system_state == SYSTEM_BOOTING) { | 117 | if (initcall_debug && system_state < SYSTEM_RUNNING) { |
118 | pr_debug("calling %lli_%pF @ %i\n", | 118 | pr_debug("calling %lli_%pF @ %i\n", |
119 | (long long)entry->cookie, | 119 | (long long)entry->cookie, |
120 | entry->func, task_pid_nr(current)); | 120 | entry->func, task_pid_nr(current)); |
121 | calltime = ktime_get(); | 121 | calltime = ktime_get(); |
122 | } | 122 | } |
123 | entry->func(entry->data, entry->cookie); | 123 | entry->func(entry->data, entry->cookie); |
124 | if (initcall_debug && system_state == SYSTEM_BOOTING) { | 124 | if (initcall_debug && system_state < SYSTEM_RUNNING) { |
125 | rettime = ktime_get(); | 125 | rettime = ktime_get(); |
126 | delta = ktime_sub(rettime, calltime); | 126 | delta = ktime_sub(rettime, calltime); |
127 | pr_debug("initcall %lli_%pF returned 0 after %lld usecs\n", | 127 | pr_debug("initcall %lli_%pF returned 0 after %lld usecs\n", |
@@ -284,14 +284,14 @@ void async_synchronize_cookie_domain(async_cookie_t cookie, struct async_domain | |||
284 | { | 284 | { |
285 | ktime_t uninitialized_var(starttime), delta, endtime; | 285 | ktime_t uninitialized_var(starttime), delta, endtime; |
286 | 286 | ||
287 | if (initcall_debug && system_state == SYSTEM_BOOTING) { | 287 | if (initcall_debug && system_state < SYSTEM_RUNNING) { |
288 | pr_debug("async_waiting @ %i\n", task_pid_nr(current)); | 288 | pr_debug("async_waiting @ %i\n", task_pid_nr(current)); |
289 | starttime = ktime_get(); | 289 | starttime = ktime_get(); |
290 | } | 290 | } |
291 | 291 | ||
292 | wait_event(async_done, lowest_in_progress(domain) >= cookie); | 292 | wait_event(async_done, lowest_in_progress(domain) >= cookie); |
293 | 293 | ||
294 | if (initcall_debug && system_state == SYSTEM_BOOTING) { | 294 | if (initcall_debug && system_state < SYSTEM_RUNNING) { |
295 | endtime = ktime_get(); | 295 | endtime = ktime_get(); |
296 | delta = ktime_sub(endtime, starttime); | 296 | delta = ktime_sub(endtime, starttime); |
297 | 297 | ||