Skip to content

Commit

Permalink
intel_idle: Fix false positive RCU splats due to incorrect hardirqs s…
Browse files Browse the repository at this point in the history
…tate

Commit 32d4fd5 ("cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE")
uses raw_local_irq_enable/local_irq_disable() around call to
__intel_idle() in intel_idle_irq().

With interrupt enabled, timer tick interrupt can happen and a
subsequently call to __do_softirq() may change the lockdep hardirqs state
of a debug kernel back to 'on'. This will result in a mismatch between
the cpu hardirqs state (off) and the lockdep hardirqs state (on) causing
a number of false positive "WARNING: suspicious RCU usage" splats.

Fix that by using local_irq_disable() to disable interrupt in
intel_idle_irq().

Fixes: 32d4fd5 ("cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE")
Signed-off-by: Waiman Long <[email protected]>
Cc: 5.16+ <[email protected]> # 5.16+
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
Waiman-Long authored and rafaeljw committed Jul 25, 2022
1 parent e0dccc3 commit d295ad3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/idle/intel_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ static __cpuidle int intel_idle_irq(struct cpuidle_device *dev,

raw_local_irq_enable();
ret = __intel_idle(dev, drv, index);
raw_local_irq_disable();

/*
* The lockdep hardirqs state may be changed to 'on' with timer
* tick interrupt followed by __do_softirq(). Use local_irq_disable()
* to keep the hardirqs state correct.
*/
local_irq_disable();

return ret;
}
Expand Down

0 comments on commit d295ad3

Please sign in to comment.