linux-stable/kernel/irq
Herve Codina c62bad84b7 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 17:15:02 +00:00
..
Kconfig genirq: Add mechanism to multiplex a single HW IPI 2023-02-05 10:57:55 +00:00
Makefile genirq: Add mechanism to multiplex a single HW IPI 2023-02-05 10:57:55 +00:00
affinity.c genirq/affinity: Move group_cpus_evenly() into lib/ 2023-01-17 18:50:06 +01:00
autoprobe.c genirq: Delay deactivation in free_irq() 2019-07-03 10:12:28 +02:00
chip.c irqchip updates for 6.5 2023-06-26 11:05:49 +02:00
cpuhotplug.c sched/isolation: Use single feature type while referring to housekeeping cpumask 2022-02-16 15:57:55 +01:00
debug.h
debugfs.c x86/apic/msi: Fix misconfigured non-maskable MSI quirk 2023-11-28 17:14:59 +00:00
devres.c
dummychip.c irq: Fix typos in comments 2021-03-22 04:23:14 +01:00
generic-chip.c genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware 2023-11-28 17:15:02 +00:00
handle.c irq: remove unused flags argument from __handle_irq_event_percpu() 2022-01-07 00:25:25 +01:00
internals.h irqchip updates for 6.5 2023-06-26 11:05:49 +02:00
ipi-mux.c genirq/ipi-mux: Use irq_domain_alloc_irqs() 2023-02-06 17:21:15 +00:00
ipi.c genirq/ipi: Fix NULL pointer deref in irq_data_get_affinity_mask() 2023-02-20 13:53:41 +01:00
irq_sim.c genirq/irq_sim: Make the irq_work always run in hard irq context 2022-05-14 17:48:27 +02:00
irqdesc.c genirq: Use a maple tree for interrupt descriptor management 2023-05-24 11:39:44 +02:00
irqdomain.c irqdomain: Use return value of strreplace() 2023-06-30 11:13:44 +02:00
manage.c genirq: Update affinity of secondary threads 2023-04-15 10:17:16 +02:00
matrix.c genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() 2023-11-20 11:56:45 +01:00
migration.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
msi.c x86/apic/msi: Fix misconfigured non-maskable MSI quirk 2023-11-28 17:14:59 +00:00
pm.c genirq/PM: Unexport {suspend,resume}_device_irqs() 2022-06-13 12:27:37 +02:00
proc.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
resend.c genirq: Fix software resend lockup and nested resend 2023-08-26 19:14:31 +02:00
settings.h genirq: Add a IRQF_NO_DEBUG flag 2021-05-17 20:01:35 +02:00
spurious.c genirq: Disable irqfixup/poll on PREEMPT_RT. 2021-09-19 23:01:15 +02:00
timings.c Updates to the interrupt core and driver subsystems: 2021-08-30 14:38:37 -07:00