linux-yocto/kernel/irq
Barry Song 50aaa6b174 genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()
[ Upstream commit cbe16f35be ]

Many drivers don't want interrupts enabled automatically via request_irq().
So they are handling this issue by either way of the below two:

(1)
  irq_set_status_flags(irq, IRQ_NOAUTOEN);
  request_irq(dev, irq...);

(2)
  request_irq(dev, irq...);
  disable_irq(irq);

The code in the second way is silly and unsafe. In the small time gap
between request_irq() and disable_irq(), interrupts can still come.

The code in the first way is safe though it's subobtimal.

Add a new IRQF_NO_AUTOEN flag which can be handed in by drivers to
request_irq() and request_nmi(). It prevents the automatic enabling of the
requested interrupt/nmi in the same safe way as #1 above. With that the
various usage sites of #1 and #2 above can be simplified and corrected.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: dmitry.torokhov@gmail.com
Link: https://lore.kernel.org/r/20210302224916.13980-2-song.bao.hua@hisilicon.com
Stable-dep-of: 99c05e4283 ("iio: adis: add '__adis_enable_irq()' implementation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-14 10:15:58 +01:00
..
affinity.c genirq/affinity: Consider that CPUs on nodes can be unbalanced 2022-04-20 09:23:29 +02:00
autoprobe.c
chip.c genirq: Don't return error on missing optional irq_request_resources() 2022-08-21 15:15:28 +02:00
cpuhotplug.c
debug.h
debugfs.c
devres.c
dummychip.c
generic-chip.c
handle.c random: remove unused irq_flags argument from add_interrupt_randomness() 2022-05-30 09:33:27 +02:00
internals.h genirq/irqdesc: Don't try to remove non-existing sysfs files 2023-01-14 10:15:18 +01:00
ipi.c
irq_sim.c
irqdesc.c genirq/irqdesc: Don't try to remove non-existing sysfs files 2023-01-14 10:15:18 +01:00
irqdomain.c
Kconfig genirq: GENERIC_IRQ_IPI depends on SMP 2022-08-21 15:15:28 +02:00
Makefile
manage.c genirq: Add IRQF_NO_AUTOEN for request_irq/nmi() 2023-01-14 10:15:58 +01:00
matrix.c genirq/matrix: Prevent allocation counter corruption 2021-05-11 14:47:17 +02:00
migration.c
msi.c genirq/msi: Shutdown managed interrupts with unsatifiable affinities 2022-12-02 17:40:06 +01:00
pm.c
proc.c
resend.c
settings.h
spurious.c
timings.c genirq/timings: Fix error return code in irq_timings_test_irqs() 2021-09-15 09:50:29 +02:00