linux-stable/kernel/irq
Herve Codina c407ff72fb 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:56:30 +00:00
..
Kconfig genirq: GENERIC_IRQ_IPI depends on SMP 2022-08-17 14:23:01 +02:00
Makefile
affinity.c
autoprobe.c
chip.c
cpuhotplug.c
debug.h
debugfs.c
devres.c
dummychip.c
generic-chip.c genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware 2023-11-28 16:56:30 +00:00
handle.c
internals.h genirq/irqdesc: Don't try to remove non-existing sysfs files 2022-12-31 13:14:03 +01:00
ipi.c
irq_sim.c
irqdesc.c genirq/irqdesc: Don't try to remove non-existing sysfs files 2022-12-31 13:14:03 +01:00
irqdomain.c irqdomain: Fix mapping-creation race 2023-03-17 08:48:58 +01:00
manage.c genirq: Take the proposed affinity at face value if force==true 2022-12-02 17:41:12 +01:00
matrix.c genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() 2023-11-20 11:08:13 +01:00
migration.c
msi.c genirq/msi: Shutdown managed interrupts with unsatifiable affinities 2022-12-02 17:41:11 +01:00
pm.c
proc.c
resend.c
settings.h
spurious.c
timings.c