android_kernel_motorola_sm6225/kernel/irq
Herve Codina 9188f47cff genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
commit 5e7afb2eb7b2a7c81e9f608cbdf74a07606fd1b5 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:46:34 +00:00
..
affinity.c genirq/affinity: Spread IRQs to all available NUMA nodes 2019-02-12 19:46:57 +01:00
autoprobe.c genirq: Delay deactivation in free_irq() 2019-07-21 09:03:12 +02:00
chip.c genirq: Provide IRQCHIP_AFFINITY_PRE_STARTUP 2021-08-26 08:36:40 -04:00
cpuhotplug.c genirq: Delay deactivation in free_irq() 2019-07-21 09:03:12 +02:00
debug.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk 2018-02-01 13:36:15 -08:00
debugfs.c x86/apic/msi: Plug non-maskable MSI affinity race 2020-02-11 04:34:18 -08:00
devres.c genirq: Add missing SPDX identifiers 2018-03-20 14:23:28 +01:00
dummychip.c genirq: Add missing SPDX identifiers 2018-03-20 14:23:28 +01:00
generic-chip.c genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware 2023-11-28 16:46:34 +00:00
handle.c random: remove unused irq_flags argument from add_interrupt_randomness() 2022-06-25 11:49:01 +02:00
internals.h genirq: Synchronize interrupt thread startup 2022-05-12 12:20:24 +02:00
ipi.c genirq: Add missing SPDX identifiers 2018-03-20 14:23:28 +01:00
irq_sim.c genirq/irq_sim: Remove the license boilerplate 2018-04-26 22:26:39 +02:00
irqdesc.c genirq: Synchronize interrupt thread startup 2022-05-12 12:20:24 +02:00
irqdomain.c irqdomain: Drop bogus fwspec-mapping error handling 2023-03-11 16:31:52 +01:00
Kconfig genirq: Let GENERIC_IRQ_IPI select IRQ_DOMAIN_HIERARCHY 2020-11-18 19:18:41 +01:00
Makefile Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-11-13 17:33:11 -08:00
manage.c genirq: Synchronize interrupt thread startup 2022-05-12 12:20:24 +02:00
matrix.c genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() 2023-11-20 10:29:16 +01:00
migration.c genirq/migration: Avoid out of line call if pending is not set 2018-06-06 15:18:20 +02:00
msi.c genirq/msi: Ensure deactivation on teardown 2021-08-26 08:36:40 -04:00
pm.c genirq: Add missing SPDX identifiers 2018-03-20 14:23:28 +01:00
proc.c genirq/proc: Reject invalid affinity masks (again) 2020-02-28 16:38:59 +01:00
resend.c genirq: Prevent NULL pointer dereference in resend_irqs() 2019-09-19 09:09:34 +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 genirq: Cleanup top of file comments 2018-03-20 14:23:27 +01:00
timings.c genirq: Remove license boilerplate/references 2018-03-20 14:23:28 +01:00