From: Greg Kroah-Hartman Date: Tue, 20 May 2025 08:59:46 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.15.184~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ba27e2093cdaa81163ccc97643295e33b962ff7;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: clocksource-i8253-use-raw_spinlock_irqsave-in-clockevent_i8253_disable.patch --- diff --git a/queue-5.15/clocksource-i8253-use-raw_spinlock_irqsave-in-clockevent_i8253_disable.patch b/queue-5.15/clocksource-i8253-use-raw_spinlock_irqsave-in-clockevent_i8253_disable.patch new file mode 100644 index 0000000000..af0ac1b546 --- /dev/null +++ b/queue-5.15/clocksource-i8253-use-raw_spinlock_irqsave-in-clockevent_i8253_disable.patch @@ -0,0 +1,56 @@ +From 94cff94634e506a4a44684bee1875d2dbf782722 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Fri, 4 Apr 2025 15:31:16 +0200 +Subject: clocksource/i8253: Use raw_spinlock_irqsave() in clockevent_i8253_disable() + +From: Sebastian Andrzej Siewior + +commit 94cff94634e506a4a44684bee1875d2dbf782722 upstream. + +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 +Signed-off-by: Thomas Gleixner +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/all/20250404133116.p-XRWJXf@linutronix.de +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clocksource/i8253.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/clocksource/i8253.c ++++ b/drivers/clocksource/i8253.c +@@ -103,7 +103,9 @@ int __init clocksource_i8253_init(void) + #ifdef CONFIG_CLKEVT_I8253 + void clockevent_i8253_disable(void) + { +- raw_spin_lock(&i8253_lock); ++ unsigned long flags; ++ ++ raw_spin_lock_irqsave(&i8253_lock, flags); + + /* + * Writing the MODE register should stop the counter, according to +@@ -133,7 +135,7 @@ void clockevent_i8253_disable(void) + + outb_p(0x30, PIT_MODE); + +- raw_spin_unlock(&i8253_lock); ++ raw_spin_unlock_irqrestore(&i8253_lock, flags); + } + + static int pit_shutdown(struct clock_event_device *evt) diff --git a/queue-5.15/series b/queue-5.15/series index 27dcf82919..67eed7f2fc 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -44,3 +44,4 @@ dmaengine-ti-k3-udma-use-cap_mask-directly-from-dma_device-structure-instead-of- dmaengine-idxd-fix-memory-leak-in-error-handling-path-of-idxd_setup_engines.patch dmaengine-idxd-fix-memory-leak-in-error-handling-path-of-idxd_setup_groups.patch block-fix-direct-io-nowait-flag-not-work.patch +clocksource-i8253-use-raw_spinlock_irqsave-in-clockevent_i8253_disable.patch