]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clocksource/i8253: Use raw_spinlock_irqsave() in clockevent_i8253_disable()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 4 Apr 2025 13:31:16 +0000 (15:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:10:01 +0000 (14:10 +0200)
commit718df1494811db9d467e5a93c41f85ed0fdbc85e
treeb802991f17cb1728bb57533cb3620fe4ac315c42
parentc4a550e0bae6b476c0ee5b1f53c93ed404b93193
clocksource/i8253: Use raw_spinlock_irqsave() in clockevent_i8253_disable()

[ Upstream commit 94cff94634e506a4a44684bee1875d2dbf782722 ]

On x86 during boot, clockevent_i8253_disable() can be invoked via
x86_late_time_init -> hpet_time_init() -> pit_timer_init() which happens
with enabled interrupts.

If some of the old i8253 hardware is actually used then lockdep will notice
that i8253_lock is used in hard interrupt context. This causes lockdep to
complain because it observed the lock being acquired with interrupts
enabled and in hard interrupt context.

Make clockevent_i8253_disable() acquire the lock with
raw_spinlock_irqsave() to cure this.

[ tglx: Massage change log and use guard() ]

Fixes: c8c4076723dac ("x86/timer: Skip PIT initialization on modern chipsets")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20250404133116.p-XRWJXf@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clocksource/i8253.c