linux-stable/kernel/irq
Herve Codina 614b5b7177 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:45:45 +00:00
..
Kconfig genirq: Let GENERIC_IRQ_IPI select IRQ_DOMAIN_HIERARCHY 2020-11-18 18:27:53 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
affinity.c genirq/affinity: Don't return with empty affinity masks on error 2019-01-13 10:01:02 +01:00
autoprobe.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
chip.c genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent() 2019-04-17 08:37:53 +02:00
cpuhotplug.c genirq/cpuhotplug: Add sanity check for effective affinity mask 2017-10-09 13:26:48 +02:00
debug.h genirq: Guard handle_bad_irq log messages 2018-03-03 10:24:31 +01:00
debugfs.c
devres.c
dummychip.c
generic-chip.c genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware 2023-11-28 16:45:45 +00:00
handle.c random: remove unused irq_flags argument from add_interrupt_randomness() 2022-06-25 11:46:30 +02:00
internals.h genirq/proc: Reject invalid affinity masks (again) 2020-02-28 16:36:15 +01:00
ipi.c
irq_sim.c
irqdesc.c genirq: Properly pair kobject_del() with kobject_add() 2019-08-29 08:26:44 +02:00
irqdomain.c irqdomain: Drop bogus fwspec-mapping error handling 2023-03-11 16:26:47 +01:00
manage.c genirq: Disable interrupts for force threaded handlers 2021-03-24 11:05:06 +01:00
migration.c genirq/generic_pending: Do not lose pending affinity update 2020-06-03 08:18:12 +02:00
msi.c genirq/msi: Fix populating multiple interrupts 2017-09-06 11:41:20 +02:00
pm.c
proc.c genirq/proc: Reject invalid affinity masks (again) 2020-02-28 16:36:15 +01:00
resend.c genirq: Prevent NULL pointer dereference in resend_irqs() 2019-09-19 09:08:04 +02:00
settings.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spurious.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
timings.c