]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Drivers: hv: vmbus: Replace lockdep_hardirq_threaded() with lockdep annotation
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 21 Jul 2026 15:32:15 +0000 (17:32 +0200)
committerWei Liu <wei.liu@kernel.org>
Wed, 22 Jul 2026 23:51:14 +0000 (23:51 +0000)
lockdep_hardirq_threaded() is supposed to be used within IRQ core code
and not within drivers. It is not obvious from within the driver, that
this is the only interrupt service routing and that it is not shared
handler.

Replace lockdep_hardirq_threaded() with a lockdep annotation limiting
threaded context on PREEMPT_RT to __vmbus_isr().

Fixes: f8e6343b7a89c ("Drivers: hv: vmbus: Use kthread for vmbus interrupts on PREEMPT_RT")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/vmbus_drv.c

index a6b9a33db65789a4bb5e4484e1814faa33100b0b..7d095c0add25d293a565b3c4f1d9956b875b0140 100644 (file)
@@ -1384,8 +1384,19 @@ void vmbus_isr(void)
        if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
                vmbus_irqd_wake();
        } else {
-               lockdep_hardirq_threaded();
+               static DEFINE_WAIT_OVERRIDE_MAP(vmbus_map, LD_WAIT_CONFIG);
+
+               /*
+                * vmbus_isr is never force-threaded and always invoked at hard
+                * IRQ level. __vmbus_isr() below can acquire a spinlock_t
+                * which becomes a sleeping lock and must not be acquired in
+                * this context. Therefore on PREEMPT_RT this will be threaded
+                * via vmbus_irqd_wake(). On non-PREEMPT the annotation lets
+                * lockdep know that acquiring a spinlock_t is not an issue.
+                */
+               lock_map_acquire_try(&vmbus_map);
                __vmbus_isr();
+               lock_map_release(&vmbus_map);
        }
 }
 EXPORT_SYMBOL_FOR_MODULES(vmbus_isr, "mshv_vtl");