Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d58d2fb6 authored by Joel Fernandes (Google)'s avatar Joel Fernandes (Google) Committed by Satya Durga Srinivasu Prabhala
Browse files

ANDROID: sched/walt: Fix lockdep warning



When lockdep enabled, a warning fires on boot up in the WALT code.
This is because the walt_irq_work handler acquires rq-locks in
succession however, this is forbidden. To fix the warning, we use the
raw_spin_lock_nested API to tell lockdep we are intentionally acquiring
the rq-lock in a nested fashion.

Bug: 110360156
Change-Id: I8598d79632991d799edcc8808d2e2f383b7a7ad3
Signed-off-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
[satyap@codeaurora.org: resolve trivial merge conflict]
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 6f232f58
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -3168,13 +3168,19 @@ void walt_irq_work(struct irq_work *irq_work)
	u64 wc;
	bool is_migration = false;
	u64 total_grp_load = 0;
	int level = 0;

	/* Am I the window rollover work or the migration work? */
	if (irq_work == &walt_migration_irq_work)
		is_migration = true;

	for_each_cpu(cpu, cpu_possible_mask)
	for_each_cpu(cpu, cpu_possible_mask) {
		if (level == 0)
			raw_spin_lock(&cpu_rq(cpu)->lock);
		else
			raw_spin_lock_nested(&cpu_rq(cpu)->lock, level);
		level++;
	}

	wc = sched_ktime_clock();
	walt_load_reported_window = atomic64_read(&walt_irq_work_lastq_ws);