sched: walt: add nested spinlock api

Use nested spin lock api to avoid deadlock warning

Change-Id: Ia2aed8f025bb209876ff87ba5a9e32b2b80718d8
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
This commit is contained in:
Ashay Jaiswal 2022-04-07 14:58:38 +05:30
parent af6c9318b1
commit 6966d0f7fe

View File

@ -4220,10 +4220,15 @@ static int walt_init_stop_handler(void *data)
struct task_struct *g, *p;
u64 window_start_ns, nr_windows;
struct walt_rq *wrq;
int level = 0;
read_lock(&tasklist_lock);
for_each_possible_cpu(cpu) {
raw_spin_lock(&cpu_rq(cpu)->lock);
if (level == 0)
raw_spin_lock(&cpu_rq(cpu)->lock);
else
raw_spin_lock_nested(&cpu_rq(cpu)->lock, level);
level++;
}
do_each_thread(g, p) {