sched/walt: prevent lockup when system is suspending

When the system is suspending, the console itself can be locked
up for a period of time. Unfortunately, pr_err will wait until
the console is unlocked, causing significant delays. This causes
a defect that seems to point to walt_pause.

Fix this by ensuring that all pr_err statements are eliminated
by using printk_deferred throughout walt_pause. This will ensure
that the operation is not locked on console access.

Change-Id: Id2e93a33d5c272fe0ee9b6f18bef5eb8ad4de07d
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
This commit is contained in:
Stephen Dickey 2021-06-21 13:37:25 -07:00 committed by Rishabh Bhatnagar
parent 4969204927
commit 72cb1a9422

View File

@ -71,7 +71,7 @@ int walt_pause_cpus(struct cpumask *cpus)
ret = pause_cpus(cpus);
if (ret < 0) {
pr_err("pause_cpus failure ret=%d cpus=%*pbl\n", ret,
printk_deferred("pause_cpus failure ret=%d cpus=%*pbl\n", ret,
cpumask_pr_args(&requested_cpus));
/* ref counts recorded, suppress failure */
@ -103,7 +103,7 @@ int walt_resume_cpus(struct cpumask *cpus)
ret = resume_cpus(cpus);
if (ret < 0) {
pr_err("resume_cpus failure ret=%d cpus=%*pbl\n", ret,
printk_deferred("resume_cpus failure ret=%d cpus=%*pbl\n", ret,
cpumask_pr_args(&requested_cpus));
/* ref counts recorded, suppress failure */
@ -169,7 +169,7 @@ static void walt_pause_online_workfn(struct work_struct *work)
mutex_unlock(&pause_lock);
if (ret < 0)
pr_err("pause_cpus during online failure ret=%d cpus=%*pb1\n", ret,
printk_deferred("pause_cpus during online failure ret=%d cpus=%*pb1\n", ret,
cpumask_pr_args(&re_pause_cpus));
}
@ -194,6 +194,6 @@ void walt_pause_init(void)
walt_pause_hp_online, NULL);
if (ret < 0)
pr_err("failure to register cpuhp online state ret=%d\n", ret);
printk_deferred("failure to register cpuhp online state ret=%d\n", ret);
}
#endif /* CONFIG_HOTPLUG_CPU */