Skip to content

Commit 4c55116

Browse files
committed
Merge tag 'irq-core-2025-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull interrupt subsystem updates from Thomas Gleixner: - Consolidate the machine_kexec_mask_interrupts() by providing a generic implementation and replacing the copy & pasta orgy in the relevant architectures. - Prevent unconditional operations on interrupt chips during kexec shutdown, which can trigger warnings in certain cases when the underlying interrupt has been shut down before. - Make the enforcement of interrupt handling in interrupt context unconditionally available, so that it actually works for non x86 related interrupt chips. The earlier enablement for ARM GIC chips set the required chip flag, but did not notice that the check was hidden behind a config switch which is not selected by ARM[64]. - Decrapify the handling of deferred interrupt affinity setting. Some interrupt chips require that affinity changes are made from the context of handling an interrupt to avoid certain race conditions. For x86 this was the default, but with interrupt remapping this requirement was lifted and a flag was introduced which tells the core code that affinity changes can be done in any context. Unrestricted affinity changes are the default for the majority of interrupt chips. RISCV has the requirement to add the deferred mode to one of it's interrupt controllers, but with the original implementation this would require to add the any context flag to all other RISC-V interrupt chips. That's backwards, so reverse the logic and require that chips, which need the deferred mode have to be marked accordingly. That avoids chasing the 'sane' chips and marking them. - Add multi-node support to the Loongarch AVEC interrupt controller driver. - The usual tiny cleanups, fixes and improvements all over the place. * tag 'irq-core-2025-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq/generic_chip: Export irq_gc_mask_disable_and_ack_set() genirq/timings: Add kernel-doc for a function parameter genirq: Remove IRQ_MOVE_PCNTXT and related code x86/apic: Convert to IRQCHIP_MOVE_DEFERRED genirq: Provide IRQCHIP_MOVE_DEFERRED hexagon: Remove GENERIC_PENDING_IRQ leftover ARC: Remove GENERIC_PENDING_IRQ genirq: Remove handle_enforce_irqctx() wrapper genirq: Make handle_enforce_irqctx() unconditionally available irqchip/loongarch-avec: Add multi-nodes topology support irqchip/ts4800: Replace seq_printf() by seq_puts() irqchip/ti-sci-inta : Add module build support irqchip/ti-sci-intr: Add module build support irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack() by generic function irqchip: keystone: Use syscon_regmap_lookup_by_phandle_args genirq/kexec: Prevent redundant IRQ masking by checking state before shutdown kexec: Consolidate machine_kexec_mask_interrupts() implementation genirq: Reuse irq_thread_fn() for forced thread case genirq: Move irq_thread_fn() further up in the code
2 parents f200c31 + a4b3990 commit 4c55116

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+107
-229
lines changed

arch/arc/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ config ARC
2525
# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
2626
select GENERIC_IRQ_SHOW
2727
select GENERIC_PCI_IOMAP
28-
select GENERIC_PENDING_IRQ if SMP
2928
select GENERIC_SCHED_CLOCK
3029
select GENERIC_SMP_IDLE_THREAD
3130
select GENERIC_IOREMAP

arch/arc/kernel/mcip.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,6 @@ static void idu_cascade_isr(struct irq_desc *desc)
357357
static int idu_irq_map(struct irq_domain *d, unsigned int virq, irq_hw_number_t hwirq)
358358
{
359359
irq_set_chip_and_handler(virq, &idu_irq_chip, handle_level_irq);
360-
irq_set_status_flags(virq, IRQ_MOVE_PCNTXT);
361-
362360
return 0;
363361
}
364362

arch/arm/kernel/machine_kexec.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -127,29 +127,6 @@ void crash_smp_send_stop(void)
127127
cpus_stopped = 1;
128128
}
129129

130-
static void machine_kexec_mask_interrupts(void)
131-
{
132-
unsigned int i;
133-
struct irq_desc *desc;
134-
135-
for_each_irq_desc(i, desc) {
136-
struct irq_chip *chip;
137-
138-
chip = irq_desc_get_chip(desc);
139-
if (!chip)
140-
continue;
141-
142-
if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
143-
chip->irq_eoi(&desc->irq_data);
144-
145-
if (chip->irq_mask)
146-
chip->irq_mask(&desc->irq_data);
147-
148-
if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
149-
chip->irq_disable(&desc->irq_data);
150-
}
151-
}
152-
153130
void machine_crash_shutdown(struct pt_regs *regs)
154131
{
155132
local_irq_disable();

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ config ARM64
149149
select GENERIC_IDLE_POLL_SETUP
150150
select GENERIC_IOREMAP
151151
select GENERIC_IRQ_IPI
152+
select GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD
152153
select GENERIC_IRQ_PROBE
153154
select GENERIC_IRQ_SHOW
154155
select GENERIC_IRQ_SHOW_LEVEL

arch/arm64/Kconfig.platforms

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ config ARCH_K3
135135
select SOC_TI
136136
select TI_MESSAGE_MANAGER
137137
select TI_SCI_PROTOCOL
138-
select TI_SCI_INTR_IRQCHIP
139-
select TI_SCI_INTA_IRQCHIP
140138
select TI_K3_SOCINFO
141139
help
142140
This enables support for Texas Instruments' K3 multicore SoC

arch/arm64/kernel/machine_kexec.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -207,37 +207,6 @@ void machine_kexec(struct kimage *kimage)
207207
BUG(); /* Should never get here. */
208208
}
209209

210-
static void machine_kexec_mask_interrupts(void)
211-
{
212-
unsigned int i;
213-
struct irq_desc *desc;
214-
215-
for_each_irq_desc(i, desc) {
216-
struct irq_chip *chip;
217-
int ret;
218-
219-
chip = irq_desc_get_chip(desc);
220-
if (!chip)
221-
continue;
222-
223-
/*
224-
* First try to remove the active state. If this
225-
* fails, try to EOI the interrupt.
226-
*/
227-
ret = irq_set_irqchip_state(i, IRQCHIP_STATE_ACTIVE, false);
228-
229-
if (ret && irqd_irq_inprogress(&desc->irq_data) &&
230-
chip->irq_eoi)
231-
chip->irq_eoi(&desc->irq_data);
232-
233-
if (chip->irq_mask)
234-
chip->irq_mask(&desc->irq_data);
235-
236-
if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
237-
chip->irq_disable(&desc->irq_data);
238-
}
239-
}
240-
241210
/**
242211
* machine_crash_shutdown - shutdown non-crashing cpus and save registers
243212
*/

arch/hexagon/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ config HEXAGON
2020
# select ARCH_HAS_CPU_IDLE_WAIT
2121
# select GPIOLIB
2222
# select HAVE_CLK
23-
# select GENERIC_PENDING_IRQ if SMP
2423
select GENERIC_ATOMIC64
2524
select HAVE_PERF_EVENTS
2625
# GENERIC_ALLOCATOR is used by dma_alloc_coherent()

arch/powerpc/include/asm/kexec.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ struct pt_regs;
6161
extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
6262
master to copy new code to 0 */
6363
extern void default_machine_kexec(struct kimage *image);
64-
extern void machine_kexec_mask_interrupts(void);
6564

6665
void relocate_new_kernel(unsigned long indirection_page, unsigned long reboot_code_buffer,
6766
unsigned long start_address) __noreturn;

arch/powerpc/kexec/core.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,6 @@
2222
#include <asm/setup.h>
2323
#include <asm/firmware.h>
2424

25-
void machine_kexec_mask_interrupts(void) {
26-
unsigned int i;
27-
struct irq_desc *desc;
28-
29-
for_each_irq_desc(i, desc) {
30-
struct irq_chip *chip;
31-
32-
chip = irq_desc_get_chip(desc);
33-
if (!chip)
34-
continue;
35-
36-
if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
37-
chip->irq_eoi(&desc->irq_data);
38-
39-
if (chip->irq_mask)
40-
chip->irq_mask(&desc->irq_data);
41-
42-
if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
43-
chip->irq_disable(&desc->irq_data);
44-
}
45-
}
46-
4725
#ifdef CONFIG_CRASH_DUMP
4826
void machine_crash_shutdown(struct pt_regs *regs)
4927
{

arch/powerpc/kexec/core_32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Copyright (C) 2005 IBM Corporation.
88
*/
99

10+
#include <linux/irq.h>
1011
#include <linux/kexec.h>
1112
#include <linux/mm.h>
1213
#include <linux/string.h>

0 commit comments

Comments
 (0)