mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Junhui Liu" <junhui.liu@pigmoral.tech>
To: "Guodong Xu" <guodong.xu@oss.qualcomm.com>,
	"Yixun Lan" <dlan@kernel.org>,
	"Junhui Liu" <junhui.liu@pigmoral.tech>
Cc: "Troy Mitchell" <troy.mitchell@linux.spacemit.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	"Anup Patel" <anup@brainfault.org>, <devicetree@vger.kernel.org>,
	<linux-riscv@lists.infradead.org>, <spacemit@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>,
	"Guodong Xu" <guodong.xu@linux.dev>
Subject: Re: [PATCH RFC] riscv: dts: spacemit: k3: Disable the ACLINT SSWI node
Date: Sat, 05 Dec 2026 23:50:48 +0800	[thread overview]
Message-ID: <DNCX31CXPHLC.37WA7PGMYW1Q4@pigmoral.tech> (raw)
In-Reply-To: <20261204-k3-dts-sswi-disable-v1-1-a852d915128f@oss.qualcomm.com>

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


  reply	other threads:[~2026-12-05 15:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  9:26 Guodong Xu
2026-12-05 15:50 ` Junhui Liu [this message]
2026-12-06  5:47   ` Guodong Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DNCX31CXPHLC.37WA7PGMYW1Q4@pigmoral.tech \
    --to=junhui.liu@pigmoral.tech \
    --cc=alex@ghiti.fr \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@kernel.org \
    --cc=guodong.xu@linux.dev \
    --cc=guodong.xu@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    --cc=troy.mitchell@linux.spacemit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®