Commit b4def427 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

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: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarArjan 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.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent b903dfb2
...@@ -114,14 +114,14 @@ static void async_run_entry_fn(struct work_struct *work) ...@@ -114,14 +114,14 @@ static void async_run_entry_fn(struct work_struct *work)
ktime_t uninitialized_var(calltime), delta, rettime; ktime_t uninitialized_var(calltime), delta, rettime;
/* 1) run (and print duration) */ /* 1) run (and print duration) */
if (initcall_debug && system_state == SYSTEM_BOOTING) { if (initcall_debug && system_state < SYSTEM_RUNNING) {
pr_debug("calling %lli_%pF @ %i\n", pr_debug("calling %lli_%pF @ %i\n",
(long long)entry->cookie, (long long)entry->cookie,
entry->func, task_pid_nr(current)); entry->func, task_pid_nr(current));
calltime = ktime_get(); calltime = ktime_get();
} }
entry->func(entry->data, entry->cookie); entry->func(entry->data, entry->cookie);
if (initcall_debug && system_state == SYSTEM_BOOTING) { if (initcall_debug && system_state < SYSTEM_RUNNING) {
rettime = ktime_get(); rettime = ktime_get();
delta = ktime_sub(rettime, calltime); delta = ktime_sub(rettime, calltime);
pr_debug("initcall %lli_%pF returned 0 after %lld usecs\n", 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,14 +284,14 @@ void async_synchronize_cookie_domain(async_cookie_t cookie, struct async_domain
{ {
ktime_t uninitialized_var(starttime), delta, endtime; ktime_t uninitialized_var(starttime), delta, endtime;
if (initcall_debug && system_state == SYSTEM_BOOTING) { if (initcall_debug && system_state < SYSTEM_RUNNING) {
pr_debug("async_waiting @ %i\n", task_pid_nr(current)); pr_debug("async_waiting @ %i\n", task_pid_nr(current));
starttime = ktime_get(); starttime = ktime_get();
} }
wait_event(async_done, lowest_in_progress(domain) >= cookie); wait_event(async_done, lowest_in_progress(domain) >= cookie);
if (initcall_debug && system_state == SYSTEM_BOOTING) { if (initcall_debug && system_state < SYSTEM_RUNNING) {
endtime = ktime_get(); endtime = ktime_get();
delta = ktime_sub(endtime, starttime); delta = ktime_sub(endtime, starttime);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment