linux-stable/kernel/irq
Herve Codina 943347e53a genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
commit 5e7afb2eb7 upstream.

irq_remove_generic_chip() calculates the Linux interrupt number for removing the
handler and interrupt chip based on gc::irq_base as a linear function of
the bit positions of set bits in the @msk argument.

When the generic chip is present in an irq domain, i.e. created with a call
to irq_alloc_domain_generic_chips(), gc::irq_base contains not the base
Linux interrupt number.  It contains the base hardware interrupt for this
chip. It is set to 0 for the first chip in the domain, 0 + N for the next
chip, where $N is the number of hardware interrupts per chip.

That means the Linux interrupt number cannot be calculated based on
gc::irq_base for irqdomain based chips without a domain map lookup, which
is currently missing.

Rework the code to take the irqdomain case into account and calculate the
Linux interrupt number by a irqdomain lookup of the domain specific
hardware interrupt number.

[ tglx: Massage changelog. Reshuffle the logic and add a proper comment. ]

Fixes: cfefd21e69 ("genirq: Add chip suspend and resume callbacks")
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20231024150335.322282-1-herve.codina@bootlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 16:54:58 +00:00
..
Kconfig genirq: GENERIC_IRQ_IPI depends on SMP 2022-08-21 15:15:28 +02:00
Makefile genirq/timings: Add selftest for circular array 2019-06-12 10:47:04 +02:00
affinity.c genirq/affinity: Consider that CPUs on nodes can be unbalanced 2022-04-20 09:23:29 +02:00
autoprobe.c genirq: Delay deactivation in free_irq() 2019-07-03 10:12:28 +02:00
chip.c irq: Fix typos in comments 2023-03-17 08:45:07 +01:00
cpuhotplug.c genirq, sched/isolation: Isolate from handling managed interrupts 2020-01-22 16:29:49 +01:00
debug.h
debugfs.c Merge branch 'irq/qcom-pdc-wakeup' into irq/irqchip-next 2020-10-06 11:28:03 +01:00
devres.c genirq/devres: Use struct_size() in devm_kzalloc() 2019-04-16 21:54:03 +02:00
dummychip.c irq: Fix typos in comments 2023-03-17 08:45:07 +01:00
generic-chip.c genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware 2023-11-28 16:54:58 +00:00
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 genirq: Fix various typos in comments 2018-12-18 14:22:28 +01:00
irq_sim.c genirq/irq_sim: Simplify the API 2020-05-18 10:30:21 +01:00
irqdesc.c irq: Fix typos in comments 2023-03-17 08:45:07 +01:00
irqdomain.c irqdomain: Fix domain registration race 2023-03-17 08:45:08 +01:00
manage.c irq: Fix typos in comments 2023-03-17 08:45:07 +01:00
matrix.c genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() 2023-11-20 11:06:44 +01:00
migration.c
msi.c irq: Fix typos in comments 2023-03-17 08:45:07 +01:00
pm.c genirq/PM: Introduce IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND flag 2020-10-06 11:23:41 +01:00
proc.c genirq: Allow interrupts to be excluded from /proc/interrupts 2020-09-13 17:04:38 +01:00
resend.c genirq: Walk the irq_data hierarchy when resending an interrupt 2020-09-06 18:25:23 +01:00
settings.h genirq: Allow interrupts to be excluded from /proc/interrupts 2020-09-13 17:04:38 +01:00
spurious.c genirq: Add missing __must_hold() sparse annotation 2020-01-09 18:03:37 +01:00
timings.c irq: Fix typos in comments 2023-03-17 08:45:07 +01:00