Skip to content

Commit d295ad3

Browse files
Waiman-Longrafaeljw
authored andcommitted
intel_idle: Fix false positive RCU splats due to incorrect hardirqs state
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]>
1 parent e0dccc3 commit d295ad3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/idle/intel_idle.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ static __cpuidle int intel_idle_irq(struct cpuidle_device *dev,
162162

163163
raw_local_irq_enable();
164164
ret = __intel_idle(dev, drv, index);
165-
raw_local_irq_disable();
165+
166+
/*
167+
* The lockdep hardirqs state may be changed to 'on' with timer
168+
* tick interrupt followed by __do_softirq(). Use local_irq_disable()
169+
* to keep the hardirqs state correct.
170+
*/
171+
local_irq_disable();
166172

167173
return ret;
168174
}

0 commit comments

Comments
 (0)