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 genirq/affinity: Consider that CPUs on nodes can be unbalanced 2022-04-20 09:34:20 +02:00
autoprobe.c
chip.c genirq: Don't return error on missing optional irq_request_resources() 2022-08-17 14:23:00 +02:00
cpuhotplug.c genirq/cpuhotplug: Demote debug printk to KERN_DEBUG 2021-08-24 09:16:20 +02: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
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 16:56:30 +00:00
handle.c random: remove unused irq_flags argument from add_interrupt_randomness() 2022-05-30 09:29:00 +02:00
internals.h genirq/irqdesc: Don't try to remove non-existing sysfs files 2022-12-31 13:14:03 +01:00
ipi.c genirq: Fix kernel-doc warnings in pm.c, msi.c and ipi.c 2021-08-11 14:33:35 +02:00
irq_sim.c The usual updates from the irq departement: 2021-04-26 09:43:16 -07:00
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 genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
msi.c genirq/msi: Shutdown managed interrupts with unsatifiable affinities 2022-12-02 17:41:11 +01:00
pm.c genirq: Fix kernel-doc warnings in pm.c, msi.c and ipi.c 2021-08-11 14:33:35 +02:00
proc.c genirq: Improve "hwirq" output in /proc and /sys/ 2021-07-30 23:07:31 +02:00
resend.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
settings.h genirq: Add a IRQF_NO_DEBUG flag 2021-05-17 20:01:35 +02:00
spurious.c genirq: Reduce irqdebug cacheline bouncing 2021-04-10 13:35:54 +02:00
timings.c Updates to the interrupt core and driver subsystems: 2021-08-30 14:38:37 -07:00