* [PATCH RFC] riscv: dts: spacemit: k3: Disable the ACLINT SSWI node
@ 2026-12-04 9:26 Guodong Xu
2026-12-05 15:50 ` Junhui Liu
0 siblings, 1 reply; 3+ messages in thread
From: Guodong Xu @ 2026-12-04 9:26 UTC (permalink / raw)
To: Yixun Lan, Junhui Liu
Cc: Troy Mitchell, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Anup Patel, devicetree, linux-riscv, spacemit, linux-kernel,
Guodong Xu
The K3 has two devices that can deliver IPIs for an S-mode kernel, the
IMSIC and the ACLINT SSWI [1], and the kernel uses one of them. The
IMSIC node comes first in the device tree, so the IMSIC registers first
and provides the IPIs.
With the SSWI driver built in (CONFIG_ACLINT_SSWI=y), the SSWI probe
then fails on each boot. On a K3 Pico-ITX board:
[ 0.000000] riscv-imsic: interrupt-controller@e0400000: providing IPIs using interrupt 1
[ 0.000000] irq_aclint_sswi: interrupt-controller@f181c000: register 8 CPUs
[ 0.000000] irq_aclint_sswi: unable to create muxed IPIs
[ 0.000000] OF: of_irq_init: Failed to init /soc/interrupt-controller@f181c000 ((____ptrval____)), parent (____ptrval____)
With irqchip.riscv_imsic_noipi [2] the IMSIC does not register for IPIs
and the SSWI takes over. On a K3 CoM260 board with the vendor firmware
that boot stops with a store access fault at the first IPI: the
firmware does not let S-mode write the SSWI registers.
[ 0.000000] Kernel command line: console=ttyS0,115200 earlycon clk_ignore_unused irqchip.riscv_imsic_noipi boot_mode=nor
[ 0.000000] irq_aclint_sswi: interrupt-controller@f181c000: register 8 CPUs
[ 0.000000] irq_aclint_sswi: providing IPIs using ACLINT SSWI
[ 0.089686] smp: Bringing up secondary CPUs ...
[ 0.094223] Oops - store (or AMO) access fault [#1]
[ 0.094233] Hardware name: SpacemiT K3 CoM260 IFX (DT)
[ 0.094235] epc : aclint_sswi_ipi_send+0x2c/0x52
[ 0.094243] ra : ipi_mux_send_mask+0xa0/0xc0
[ 0.094267] status: 0000000200000100 badaddr: ffffffc600040000 cause: 0000000000000007
[ 0.094270] [<ffffffff8061aa86>] aclint_sswi_ipi_send+0x2c/0x52
[ 0.094274] [<ffffffff8009fbca>] ipi_mux_send_mask+0xa0/0xc0
[ 0.094278] [<ffffffff8009f9d2>] __ipi_send_mask+0x1e/0xe0
[ 0.094281] [<ffffffff8001bcec>] arch_irq_work_raise+0x32/0x3a
[ 0.094346] Kernel panic - not syncing: Fatal exception in interrupt
Disable the node, so that the kernel does not probe the SSWI on K3.
Link: https://lore.kernel.org/r/20260918-k3-aclint-v3-6-cf4fd4050e14@pigmoral.tech [1]
Link: https://lore.kernel.org/r/20250716123745.557585-1-apatel@ventanamicro.com [2]
Signed-off-by: Guodong Xu <guodong.xu@oss.qualcomm.com>
---
This is an RFC because it takes back part of commit cc6371a7f519
("riscv: dts: spacemit: k3: Replace incorrect CLINT node with ACLINT
nodes"), which made the SSWI node available to the kernel.
Junhui, Yixun: is the SSWI meant to be used by Linux on K3? If not,
this patch is enough.
About the firmware: the cover of the series that added the node says
that OpenSBI leaves the SSWI range available to S-mode [3]. On my
CoM260, with the vendor firmware, the write faults; the panic and the
kernel command line are in the commit message above. The kernel prints
this about the firmware:
[ 0.000000] SBI specification v2.0 detected
[ 0.000000] SBI implementation ID=0x1 Version=0x10006
Which firmware was [3] tested with?
Background: the RISC-V defconfig does not build the SSWI driver at the
moment. Its entry is still CONFIG_THEAD_C900_ACLINT_SSWI=y, the option
name from before v6.17; the option is now called ACLINT_SSWI [4]. I am
preparing the patch that changes the entry to CONFIG_ACLINT_SSWI=y, and
these messages showed up when I tested it on K3.
I used status = "disabled". mimsic and maplic in the same file use
"reserved"; tell me if that fits better here.
[3] https://lore.kernel.org/r/20260918-k3-aclint-v3-0-cf4fd4050e14@pigmoral.tech
[4] https://lore.kernel.org/r/20261129-riscv-defconfig-cleanup-v1-0-a1499084d8bc@oss.qualcomm.com
---
arch/riscv/boot/dts/spacemit/k3.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index e89d2cc5ca8cc..79003d977b995 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -1495,6 +1495,7 @@ aclint_sswi: interrupt-controller@f181c000 {
<&cpu2_intc 1>, <&cpu3_intc 1>,
<&cpu4_intc 1>, <&cpu5_intc 1>,
<&cpu6_intc 1>, <&cpu7_intc 1>;
+ status = "disabled";
};
};
};
---
base-commit: 9606889b9da76bfb92eb711088e0b26902b72bdf
change-id: 20261204-k3-dts-sswi-disable-ee9df877e306
Best regards,
--
Guodong Xu <guodong.xu@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RFC] riscv: dts: spacemit: k3: Disable the ACLINT SSWI node
2026-12-04 9:26 [PATCH RFC] riscv: dts: spacemit: k3: Disable the ACLINT SSWI node Guodong Xu
@ 2026-12-05 15:50 ` Junhui Liu
2026-12-06 5:47 ` Guodong Xu
0 siblings, 1 reply; 3+ messages in thread
From: Junhui Liu @ 2026-12-05 15:50 UTC (permalink / raw)
To: Guodong Xu, Yixun Lan, Junhui Liu
Cc: Troy Mitchell, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Anup Patel, devicetree, linux-riscv, spacemit, linux-kernel,
Guodong Xu
Hi Guodong,
Thanks for your report.
On Fri Dec 4, 2026 at 5:26 PM CST, Guodong Xu wrote:
> The K3 has two devices that can deliver IPIs for an S-mode kernel, the
> IMSIC and the ACLINT SSWI [1], and the kernel uses one of them. The
> IMSIC node comes first in the device tree, so the IMSIC registers first
> and provides the IPIs.
>
> With the SSWI driver built in (CONFIG_ACLINT_SSWI=y), the SSWI probe
> then fails on each boot. On a K3 Pico-ITX board:
>
> [ 0.000000] riscv-imsic: interrupt-controller@e0400000: providing IPIs using interrupt 1
> [ 0.000000] irq_aclint_sswi: interrupt-controller@f181c000: register 8 CPUs
> [ 0.000000] irq_aclint_sswi: unable to create muxed IPIs
> [ 0.000000] OF: of_irq_init: Failed to init /soc/interrupt-controller@f181c000 ((____ptrval____)), parent (____ptrval____)
The initialization failure above seems to be due to both drivers trying to
register as the IPI provider. I don't think this justifies disabling SSWI.
If the error messages need addressing, that should be handled on the
driver side.
>
> With irqchip.riscv_imsic_noipi [2] the IMSIC does not register for IPIs
> and the SSWI takes over. On a K3 CoM260 board with the vendor firmware
> that boot stops with a store access fault at the first IPI: the
> firmware does not let S-mode write the SSWI registers.
>
> [ 0.000000] Kernel command line: console=ttyS0,115200 earlycon clk_ignore_unused irqchip.riscv_imsic_noipi boot_mode=nor
> [ 0.000000] irq_aclint_sswi: interrupt-controller@f181c000: register 8 CPUs
> [ 0.000000] irq_aclint_sswi: providing IPIs using ACLINT SSWI
> [ 0.089686] smp: Bringing up secondary CPUs ...
> [ 0.094223] Oops - store (or AMO) access fault [#1]
> [ 0.094233] Hardware name: SpacemiT K3 CoM260 IFX (DT)
> [ 0.094235] epc : aclint_sswi_ipi_send+0x2c/0x52
> [ 0.094243] ra : ipi_mux_send_mask+0xa0/0xc0
> [ 0.094267] status: 0000000200000100 badaddr: ffffffc600040000 cause: 0000000000000007
> [ 0.094270] [<ffffffff8061aa86>] aclint_sswi_ipi_send+0x2c/0x52
> [ 0.094274] [<ffffffff8009fbca>] ipi_mux_send_mask+0xa0/0xc0
> [ 0.094278] [<ffffffff8009f9d2>] __ipi_send_mask+0x1e/0xe0
> [ 0.094281] [<ffffffff8001bcec>] arch_irq_work_raise+0x32/0x3a
> [ 0.094346] Kernel panic - not syncing: Fatal exception in interrupt
I reproduced your issue with vendor firmware v4.0.6 (built on 2026-08-19).
Looking at the vendor code, the ACLINT was also incorrectly described as a
CLINT in the firmware's device tree. This caused OpenSBI to mark the SSWI
register range as M-mode-only, preventing S-mode from accessing it.
The vendor code removed this incorrect CLINT node on 2026-08-28. I tested
vendor firmware v4.0.7 (built on 2026-09-07), and SSWI worked correctly.
Could you please retest with vendor firmware v4.0.7 or later?
>
> Disable the node, so that the kernel does not probe the SSWI on K3.
>
> Link: https://lore.kernel.org/r/20260918-k3-aclint-v3-6-cf4fd4050e14@pigmoral.tech [1]
> Link: https://lore.kernel.org/r/20250716123745.557585-1-apatel@ventanamicro.com [2]
> Signed-off-by: Guodong Xu <guodong.xu@oss.qualcomm.com>
> ---
> This is an RFC because it takes back part of commit cc6371a7f519
> ("riscv: dts: spacemit: k3: Replace incorrect CLINT node with ACLINT
> nodes"), which made the SSWI node available to the kernel.
>
> Junhui, Yixun: is the SSWI meant to be used by Linux on K3? If not,
> this patch is enough.
>
> About the firmware: the cover of the series that added the node says
> that OpenSBI leaves the SSWI range available to S-mode [3]. On my
> CoM260, with the vendor firmware, the write faults; the panic and the
> kernel command line are in the commit message above. The kernel prints
> this about the firmware:
>
> [ 0.000000] SBI specification v2.0 detected
> [ 0.000000] SBI implementation ID=0x1 Version=0x10006
>
> Which firmware was [3] tested with?
>
> Background: the RISC-V defconfig does not build the SSWI driver at the
> moment. Its entry is still CONFIG_THEAD_C900_ACLINT_SSWI=y, the option
> name from before v6.17; the option is now called ACLINT_SSWI [4]. I am
> preparing the patch that changes the entry to CONFIG_ACLINT_SSWI=y, and
> these messages showed up when I tested it on K3.
>
> I used status = "disabled". mimsic and maplic in the same file use
> "reserved"; tell me if that fits better here.
>
> [3] https://lore.kernel.org/r/20260918-k3-aclint-v3-0-cf4fd4050e14@pigmoral.tech
> [4] https://lore.kernel.org/r/20261129-riscv-defconfig-cleanup-v1-0-a1499084d8bc@oss.qualcomm.com
> ---
> arch/riscv/boot/dts/spacemit/k3.dtsi | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
> index e89d2cc5ca8cc..79003d977b995 100644
> --- a/arch/riscv/boot/dts/spacemit/k3.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
> @@ -1495,6 +1495,7 @@ aclint_sswi: interrupt-controller@f181c000 {
> <&cpu2_intc 1>, <&cpu3_intc 1>,
> <&cpu4_intc 1>, <&cpu5_intc 1>,
> <&cpu6_intc 1>, <&cpu7_intc 1>;
> + status = "disabled";
> };
> };
> };
So, it seems this patch is not needed.
>
> ---
> base-commit: 9606889b9da76bfb92eb711088e0b26902b72bdf
> change-id: 20261204-k3-dts-sswi-disable-ee9df877e306
>
> Best regards,
> --
> Guodong Xu <guodong.xu@oss.qualcomm.com>
--
Best regards,
Junhui Liu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RFC] riscv: dts: spacemit: k3: Disable the ACLINT SSWI node
2026-12-05 15:50 ` Junhui Liu
@ 2026-12-06 5:47 ` Guodong Xu
0 siblings, 0 replies; 3+ messages in thread
From: Guodong Xu @ 2026-12-06 5:47 UTC (permalink / raw)
To: Junhui Liu, Yixun Lan, Anup Patel
Cc: Troy Mitchell, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
devicetree, linux-riscv, spacemit, linux-kernel
Hi Junhui,
On Sat, 05 Dec 2026 23:50:48 +0800, Junhui Liu wrote:
> On Fri Dec 4, 2026 at 5:26 PM CST, Guodong Xu wrote:
>> The K3 has two devices that can deliver IPIs for an S-mode kernel, the
>> IMSIC and the ACLINT SSWI [1], and the kernel uses one of them. The
>> IMSIC node comes first in the device tree, so the IMSIC registers first
>> and provides the IPIs.
>>
>> With the SSWI driver built in (CONFIG_ACLINT_SSWI=y), the SSWI probe
>> then fails on each boot. On a K3 Pico-ITX board:
>>
>> [ 0.000000] riscv-imsic: interrupt-controller@e0400000: providing IPIs using interrupt 1
>> [ 0.000000] irq_aclint_sswi: interrupt-controller@f181c000: register 8 CPUs
>> [ 0.000000] irq_aclint_sswi: unable to create muxed IPIs
>> [ 0.000000] OF: of_irq_init: Failed to init /soc/interrupt-controller@f181c000 ((____ptrval____)), parent (____ptrval____)
>
> The initialization failure above seems to be due to both drivers trying to
> register as the IPI provider. I don't think this justifies disabling SSWI.
> If the error messages need addressing, that should be handled on the
> driver side.
Thanks for the review, and for finding the firmware cause.
The error lines are only the symptom. The question is which device
Linux should use for IPIs on K3.
The IMSIC wins only because its node comes first in k3.dtsi: both
nodes have cpu0_intc as their first parent, and of_irq_init() then
takes them in tree order. With the two nodes swapped (same properties,
only the order changed), the SSWI registers first, the IMSIC fails to
initialize, and GPIO, I2C and the UART get no interrupt on my CoM260.
ACLINT SSWI was never ratified, and the IMSIC is the IPI device that
AIA defines, with IPI virtualization. On a SoC that has an IMSIC, I
think Linux should use it, and the DT should say so rather than leave
it to node order.
> [ ... ]
>
> I reproduced your issue with vendor firmware v4.0.6 (built on 2026-08-19).
>
> Looking at the vendor code, the ACLINT was also incorrectly described as a
> CLINT in the firmware's device tree. This caused OpenSBI to mark the SSWI
> register range as M-mode-only, preventing S-mode from accessing it.
>
> The vendor code removed this incorrect CLINT node on 2026-08-28. I tested
> vendor firmware v4.0.7 (built on 2026-09-07), and SSWI worked correctly.
>
> Could you please retest with vendor firmware v4.0.7 or later?
With v4.0.8 and irqchip.riscv_imsic_noipi the SSWI provides the IPIs
on my CoM260 and all 8 CPUs come up:
irq_aclint_sswi: providing IPIs using ACLINT SSWI
smp: Brought up 1 node, 8 CPUs
> [ ... ]
>
>> @@ -1495,6 +1495,7 @@ aclint_sswi: interrupt-controller@f181c000 {
>> <&cpu2_intc 1>, <&cpu3_intc 1>,
>> <&cpu4_intc 1>, <&cpu5_intc 1>,
>> <&cpu6_intc 1>, <&cpu7_intc 1>;
>> + status = "disabled";
>> };
>> };
>> };
>
> So, it seems this patch is not needed.
I still think it is needed, for the reason above. Relying on the order
in which the nodes appear in the DT is not a good design.
Anup, Yixun: what do you think?
Guodong
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-06 5:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-04 9:26 [PATCH RFC] riscv: dts: spacemit: k3: Disable the ACLINT SSWI node Guodong Xu
2026-12-05 15:50 ` Junhui Liu
2026-12-06 5:47 ` Guodong Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®