Skip to content

Commit

Permalink
cpuidle: tegra: Annotate tegra_pm_set_cpu_in_lp2() with RCU_NONIDLE
Browse files Browse the repository at this point in the history
[ Upstream commit c39de53 ]

Annotate tegra_pm_set[clear]_cpu_in_lp2() with RCU_NONIDLE in order to
fix lockdep warning about suspicious RCU usage of a spinlock during late
idling phase.

 WARNING: suspicious RCU usage
 ...
 include/trace/events/lock.h:13 suspicious rcu_dereference_check() usage!
 ...
  (dump_stack) from (lock_acquire)
  (lock_acquire) from (_raw_spin_lock)
  (_raw_spin_lock) from (tegra_pm_set_cpu_in_lp2)
  (tegra_pm_set_cpu_in_lp2) from (tegra_cpuidle_enter)
  (tegra_cpuidle_enter) from (cpuidle_enter_state)
  (cpuidle_enter_state) from (cpuidle_enter_state_coupled)
  (cpuidle_enter_state_coupled) from (cpuidle_enter)
  (cpuidle_enter) from (do_idle)
 ...

Tested-by: Peter Geis <pgwipeout@gmail.com>
Reported-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
digetx authored and gregkh committed Dec 2, 2020
1 parent 8180cdb commit 977865d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/cpuidle/cpuidle-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static int tegra_cpuidle_state_enter(struct cpuidle_device *dev,
}

local_fiq_disable();
tegra_pm_set_cpu_in_lp2();
RCU_NONIDLE(tegra_pm_set_cpu_in_lp2());
cpu_pm_enter();

switch (index) {
Expand All @@ -207,7 +207,7 @@ static int tegra_cpuidle_state_enter(struct cpuidle_device *dev,
}

cpu_pm_exit();
tegra_pm_clear_cpu_in_lp2();
RCU_NONIDLE(tegra_pm_clear_cpu_in_lp2());
local_fiq_enable();

return err ?: index;
Expand Down

0 comments on commit 977865d

Please sign in to comment.