sched/walt: core_ctl init out of order

core_ctl is launching a kthread which uses a spinlock, prior
to initializing the spinlock.  This creates a race, and a lockup.

Change-Id: I170a77addc6e4c2cc90b6683b50723008760f2f4
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
This commit is contained in:
Stephen Dickey 2021-04-09 13:55:16 -07:00 committed by Rishabh Bhatnagar
parent 91bd0dce3b
commit fe4c36c11b

View File

@ -1327,14 +1327,14 @@ int core_ctl_init(void)
struct walt_sched_cluster *cluster;
int ret;
/* initialize our single kthread */
spin_lock_init(&core_ctl_pending_lock);
/* initialize our single kthread, after spin lock init */
core_ctl_thread = kthread_run(try_core_ctl, NULL, "core_ctl");
if (IS_ERR(core_ctl_thread))
return PTR_ERR(core_ctl_thread);
spin_lock_init(&core_ctl_pending_lock);
sched_setscheduler_nocheck(core_ctl_thread, SCHED_FIFO, &param);
for_each_sched_cluster(cluster) {