mirror-linux/kernel/irq
Brian Norris 5b65258229 genirq/test: Resolve irq lock inversion warnings
irq_shutdown_and_deactivate() is normally called with the descriptor lock
held, and interrupts disabled. Nested a few levels down, it grabs the
global irq_resend_lock. Lockdep rightfully complains when interrupts are
not disabled:

       CPU0                    CPU1
       ----                    ----
  lock(irq_resend_lock);
                               local_irq_disable();
                               lock(&irq_desc_lock_class);
                               lock(irq_resend_lock);
  <Interrupt>
    lock(&irq_desc_lock_class);

...
   _raw_spin_lock+0x2b/0x40
   clear_irq_resend+0x14/0x70
   irq_shutdown_and_deactivate+0x29/0x80
   irq_shutdown_depth_test+0x1ce/0x600
   kunit_try_run_case+0x90/0x120

Grab the descriptor lock and disable interrupts, to resolve the
problem.

Fixes: 66067c3c8a ("genirq: Add kunit tests for depth counts")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/all/aJJONEIoIiTSDMqc@google.com
Closes: https://lore.kernel.org/lkml/31a761e4-8f81-40cf-aaf5-d220ba11911c@roeck-us.net/
2025-08-06 10:29:48 +02:00
..
Kconfig genirq: Add kunit tests for depth counts 2025-06-13 15:24:44 +02:00
Makefile genirq: Add kunit tests for depth counts 2025-06-13 15:24:44 +02:00
affinity.c lib/group_cpus: Let group_cpu_evenly() return the number of initialized masks 2025-07-01 10:24:11 -06:00
autoprobe.c
chip.c pci-v6.17-changes 2025-08-01 13:59:07 -07:00
cpuhotplug.c genirq/cpuhotplug: Restore affinity even for suspended IRQ 2025-06-13 15:13:35 +02:00
debug.h
debugfs.c
devres.c
dummychip.c
generic-chip.c
handle.c
internals.h genirq: Split up irq_pm_check_wakeup() 2025-07-22 14:30:42 +02:00
ipi-mux.c
ipi.c
irq_sim.c genirq/irq_sim: Initialize work context pointers properly 2025-06-13 15:36:35 +02:00
irq_test.c genirq/test: Resolve irq lock inversion warnings 2025-08-06 10:29:48 +02:00
irqdesc.c genirq/irqdesc: Remove double locking in hwirq_show() 2025-05-21 17:48:23 +02:00
irqdomain.c Networking changes for 6.17. 2025-07-30 08:58:55 -07:00
kexec.c
manage.c
matrix.c
migration.c
msi.c irqdomain: Add device pointer to irq_domain_info and msi_domain_info 2025-07-03 15:49:24 +02:00
pm.c genirq: Split up irq_pm_check_wakeup() 2025-07-22 14:30:42 +02:00
proc.c
resend.c
settings.h
spurious.c genirq: Move irq_wait_for_poll() to call site 2025-07-22 14:30:42 +02:00
timings.c