Skip to content

Commit 0b29600

Browse files
committed
Merge tag 'irq-drivers-2025-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull interrupt chip driver updates from Thomas Gleixner: - Add support of forced affinity setting to yet offline CPUs for the MIPS-GIC to ensure that the affinity of per CPU interrupts can be set during the early bringup phase of a secondary CPU in the hotplug code before the CPU is set online and interrupts are enabled - Add support for the MIPS (RISC-V !?!?) P8700 SoC in the ACLINT_SSWI interrupt chip - Make the interrupt routing to RISV-V harts specification compliant so it supports arbitrary hart indices - Add a command line parameter and related handling to disable the generic RISCV IMSIC mechanism on platforms which use a trap-emulated IMSIC. Unfortunatly this is required because there is no mechanism available to discover this programatically. - Enable wakeup sources on the Renesas RZV2H driver - Convert interrupt chip drivers, which use a open coded variant of msi_create_parent_irq_domain() to use the new functionality - Convert interrupt chip drivers, which use the old style two level implementation of MSI support over to the MSI parent mechanism to prepare for removing at least one of the three PCI/MSI backend variants. - The usual cleanups and improvements all over the place * tag 'irq-drivers-2025-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (28 commits) irqchip/renesas-irqc: Convert to DEFINE_SIMPLE_DEV_PM_OPS() irqchip/renesas-intc-irqpin: Convert to DEFINE_SIMPLE_DEV_PM_OPS() irqchip/riscv-imsic: Add kernel parameter to disable IPIs irqchip/gic-v3: Fix GICD_CTLR register naming irqchip/ls-scfg-msi: Fix NULL dereference in error handling irqchip/ls-scfg-msi: Switch to use msi_create_parent_irq_domain() irqchip/armada-370-xp: Switch to msi_create_parent_irq_domain() irqchip/alpine-msi: Switch to msi_create_parent_irq_domain() irqchip/alpine-msi: Convert to __free irqchip/alpine-msi: Convert to lock guards irqchip/alpine-msi: Clean up whitespace style irqchip/sg2042-msi: Switch to msi_create_parent_irq_domain() irqchip/loongson-pch-msi.c: Switch to msi_create_parent_irq_domain() irqchip/imx-mu-msi: Convert to msi_create_parent_irq_domain() helper irqchip/riscv-imsic: Convert to msi_create_parent_irq_domain() helper irqchip/bcm2712-mip: Switch to msi_create_parent_irq_domain() irqdomain: Add device pointer to irq_domain_info and msi_domain_info irqchip/renesas-rzv2h: Remove unneeded includes irqchip/renesas-rzv2h: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND irqchip/aslint-sswi: Resolve hart index ...
2 parents b34111a + 2aad477 commit 0b29600

40 files changed

+402
-318
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,6 +2538,13 @@
25382538
requires the kernel to be built with
25392539
CONFIG_ARM64_PSEUDO_NMI.
25402540

2541+
irqchip.riscv_imsic_noipi
2542+
[RISC-V,EARLY]
2543+
Force the kernel to not use IMSIC software injected MSIs
2544+
as IPIs. Intended for system where IMSIC is trap-n-emulated,
2545+
and thus want to reduce MMIO traps when triggering IPIs
2546+
to multiple harts.
2547+
25412548
irqfixup [HW]
25422549
When an interrupt is not handled search all handlers
25432550
for it. Intended to get systems with badly broken

Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-sswi.yaml

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,32 @@
44
$id: http://devicetree.org/schemas/interrupt-controller/thead,c900-aclint-sswi.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

7-
title: T-HEAD C900 ACLINT Supervisor-level Software Interrupt Device
7+
title: ACLINT Supervisor-level Software Interrupt Device
88

99
maintainers:
1010
- Inochi Amaoto <[email protected]>
1111

1212
description:
13-
The SSWI device is a part of the THEAD ACLINT device. It provides
14-
supervisor-level IPI functionality for a set of HARTs on a THEAD
15-
platform. It provides a register to set an IPI (SETSSIP) for each
16-
HART connected to the SSWI device.
13+
The SSWI device is a part of the ACLINT device. It provides
14+
supervisor-level IPI functionality for a set of HARTs on a supported
15+
platforms. It provides a register to set an IPI (SETSSIP) for each
16+
HART connected to the SSWI device. See draft specification
17+
https://github.com/riscvarchive/riscv-aclint
18+
19+
Following variants of the SSWI ACLINT supported, using dedicated
20+
compatible string
21+
- THEAD C900
22+
- MIPS P8700
1723

1824
properties:
1925
compatible:
20-
items:
21-
- enum:
22-
- sophgo,sg2044-aclint-sswi
23-
- const: thead,c900-aclint-sswi
26+
oneOf:
27+
- items:
28+
- enum:
29+
- sophgo,sg2044-aclint-sswi
30+
- const: thead,c900-aclint-sswi
31+
- items:
32+
- const: mips,p8700-aclint-sswi
2433

2534
reg:
2635
maxItems: 1
@@ -34,6 +43,14 @@ properties:
3443
minItems: 1
3544
maxItems: 4095
3645

46+
riscv,hart-indexes:
47+
$ref: /schemas/types.yaml#/definitions/uint32-array
48+
minItems: 1
49+
maxItems: 4095
50+
description:
51+
A list of hart indexes that APLIC should use to address each hart
52+
that is mentioned in the "interrupts-extended"
53+
3754
additionalProperties: false
3855

3956
required:
@@ -43,8 +60,22 @@ required:
4360
- interrupt-controller
4461
- interrupts-extended
4562

63+
allOf:
64+
- if:
65+
properties:
66+
compatible:
67+
contains:
68+
const: mips,p8700-aclint-sswi
69+
then:
70+
required:
71+
- riscv,hart-indexes
72+
else:
73+
properties:
74+
riscv,hart-indexes: false
75+
4676
examples:
4777
- |
78+
//Example 1
4879
interrupt-controller@94000000 {
4980
compatible = "sophgo,sg2044-aclint-sswi", "thead,c900-aclint-sswi";
5081
reg = <0x94000000 0x00004000>;
@@ -55,4 +86,19 @@ examples:
5586
<&cpu3intc 1>,
5687
<&cpu4intc 1>;
5788
};
89+
90+
- |
91+
//Example 2
92+
interrupt-controller@94000000 {
93+
compatible = "mips,p8700-aclint-sswi";
94+
reg = <0x94000000 0x00004000>;
95+
#interrupt-cells = <0>;
96+
interrupt-controller;
97+
interrupts-extended = <&cpu1intc 1>,
98+
<&cpu2intc 1>,
99+
<&cpu3intc 1>,
100+
<&cpu4intc 1>;
101+
riscv,hart-indexes = <0x0 0x1 0x10 0x11>;
102+
};
103+
58104
...

arch/riscv/include/asm/irq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ void arch_trigger_cpumask_backtrace(const cpumask_t *mask, int exclude_cpu);
2222
void riscv_set_intc_hwnode_fn(struct fwnode_handle *(*fn)(void));
2323

2424
struct fwnode_handle *riscv_get_intc_hwnode(void);
25+
int riscv_get_hart_index(struct fwnode_handle *fwnode, u32 logical_index,
26+
u32 *hart_index);
2527

2628
#ifdef CONFIG_ACPI
2729

arch/riscv/kernel/irq.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,40 @@ struct fwnode_handle *riscv_get_intc_hwnode(void)
3232
}
3333
EXPORT_SYMBOL_GPL(riscv_get_intc_hwnode);
3434

35+
/**
36+
* riscv_get_hart_index() - get hart index for interrupt delivery
37+
* @fwnode: interrupt controller node
38+
* @logical_index: index within the "interrupts-extended" property
39+
* @hart_index: filled with the hart index to use
40+
*
41+
* RISC-V uses term "hart index" for its interrupt controllers, for the
42+
* purpose of the interrupt routing to destination harts.
43+
* It may be arbitrary numbers assigned to each destination hart in context
44+
* of the particular interrupt domain.
45+
*
46+
* These numbers encoded in the optional property "riscv,hart-indexes"
47+
* that should contain hart index for each interrupt destination in the same
48+
* order as in the "interrupts-extended" property. If this property
49+
* not exist, it assumed equal to the logical index, i.e. index within the
50+
* "interrupts-extended" property.
51+
*
52+
* Return: error code
53+
*/
54+
int riscv_get_hart_index(struct fwnode_handle *fwnode, u32 logical_index,
55+
u32 *hart_index)
56+
{
57+
static const char *prop_hart_index = "riscv,hart-indexes";
58+
struct device_node *np = to_of_node(fwnode);
59+
60+
if (!np || !of_property_present(np, prop_hart_index)) {
61+
*hart_index = logical_index;
62+
return 0;
63+
}
64+
65+
return of_property_read_u32_index(np, prop_hart_index,
66+
logical_index, hart_index);
67+
}
68+
3569
#ifdef CONFIG_IRQ_STACKS
3670
#include <asm/irq_stack.h>
3771

drivers/irqchip/Kconfig

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@ config ARMADA_370_XP_IRQ
8080
bool
8181
select GENERIC_IRQ_CHIP
8282
select PCI_MSI if PCI
83+
select IRQ_MSI_LIB if PCI
8384
select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
8485

8586
config ALPINE_MSI
8687
bool
8788
depends on PCI
8889
select PCI_MSI
90+
select IRQ_MSI_LIB
8991
select GENERIC_IRQ_CHIP
9092

9193
config AL_FIC
@@ -435,6 +437,7 @@ config LS_SCFG_MSI
435437
def_bool y if SOC_LS1021A || ARCH_LAYERSCAPE
436438
select IRQ_MSI_IOMMU
437439
depends on PCI_MSI
440+
select IRQ_MSI_LIB
438441

439442
config PARTITION_PERCPU
440443
bool
@@ -635,18 +638,25 @@ config STARFIVE_JH8100_INTC
635638

636639
If you don't know what to do here, say Y.
637640

638-
config THEAD_C900_ACLINT_SSWI
639-
bool "THEAD C9XX ACLINT S-mode IPI Interrupt Controller"
641+
config ACLINT_SSWI
642+
bool "RISC-V ACLINT S-mode IPI Interrupt Controller"
640643
depends on RISCV
641644
depends on SMP
642645
select IRQ_DOMAIN_HIERARCHY
643646
select GENERIC_IRQ_IPI_MUX
644647
help
645-
This enables support for T-HEAD specific ACLINT SSWI device
646-
support.
648+
This enables support for variants of the RISC-V ACLINT-SSWI device.
649+
Supported variants are:
650+
- T-HEAD, with compatible "thead,c900-aclint-sswi"
651+
- MIPS P8700, with compatible "mips,p8700-aclint-sswi"
647652

648653
If you don't know what to do here, say Y.
649654

655+
# Backwards compatibility so oldconfig does not drop it.
656+
config THEAD_C900_ACLINT_SSWI
657+
bool
658+
select ACLINT_SSWI
659+
650660
config EXYNOS_IRQ_COMBINER
651661
bool "Samsung Exynos IRQ combiner support" if COMPILE_TEST
652662
depends on (ARCH_EXYNOS && ARM) || COMPILE_TEST

drivers/irqchip/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ obj-$(CONFIG_RISCV_APLIC_MSI) += irq-riscv-aplic-msi.o
105105
obj-$(CONFIG_RISCV_IMSIC) += irq-riscv-imsic-state.o irq-riscv-imsic-early.o irq-riscv-imsic-platform.o
106106
obj-$(CONFIG_SIFIVE_PLIC) += irq-sifive-plic.o
107107
obj-$(CONFIG_STARFIVE_JH8100_INTC) += irq-starfive-jh8100-intc.o
108-
obj-$(CONFIG_THEAD_C900_ACLINT_SSWI) += irq-thead-c900-aclint-sswi.o
108+
obj-$(CONFIG_ACLINT_SSWI) += irq-aclint-sswi.o
109109
obj-$(CONFIG_IMX_IRQSTEER) += irq-imx-irqsteer.o
110110
obj-$(CONFIG_IMX_INTMUX) += irq-imx-intmux.o
111111
obj-$(CONFIG_IMX_MU_MSI) += irq-imx-mu-msi.o

0 commit comments

Comments
 (0)