Devicetree
 help / color / mirror / Atom feed
From: Inochi Amaoto <inochiama@gmail.com>
To: "GUO Ren (XuanTie)" <guoren@kernel.org>,
	 Thomas Gleixner <tglx@kernel.org>, Radu Rendec <radu@rendec.net>,
	Paul Walmsley <pjw@kernel.org>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Alexandre Ghiti <alex@ghiti.fr>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 Inochi Amaoto <inochiama@outlook.com>,
	Inochi Amaoto <inochiama@gmail.com>,
	 Samuel Holland <samuel.holland@sifive.com>,
	Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>,
	 Chen Wang <chen.wang@linux.dev>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	 devicetree@vger.kernel.org, linux-csky@vger.kernel.org
Subject: Re: [PATCH 1/3] irqchip/aclint-sswi: Use generic probe for the XuanTie C9XX variant
Date: Sun, 29 Nov 2026 12:04:13 +0800	[thread overview]
Message-ID: <awukB0R9MwUFXZOy@inochi.infowork> (raw)
In-Reply-To: <20261129-sswi-v1-1-003d9b8b9588@kernel.org>

On Sun, Nov 29, 2026 at 03:25:20AM +0000, GUO Ren (XuanTie) wrote:
> The XuanTie C9XX specific probe refuses to register the SSWI device
> unless the sxstatus.CLINTEE bit is set. The check was added because
> the XuanTie C9XX CLINT S-mode extension requires the M-mode firmware
> to set mxstatus.CLINTEE, otherwise writes to the SSWI registers do
> not generate supervisor software interrupts [1].
> 
> In practice, the firmware (OpenSBI/zsbl) always sets CLINTEE before
> exposing the SSWI device in the device tree, so the presence of a
> "thead,c900-aclint-sswi" node already implies that SSWI is usable and
> the kernel-side check is redundant. The MIPS P8700, Nuclei UX900 and
> SpacemiT K3 variants have no such vendor checks and use the generic
> probe directly.
> 
> Drop the XuanTie C9XX specific probe and point "thead,c900-aclint-sswi"
> at generic_aclint_sswi_early_probe() to align with the other vendors.
> 
> Link: https://lore.kernel.org/all/35d288d3-56dd-4018-8b98-78311c29a25d@sifive.com/ [1]
> Signed-off-by: GUO Ren (XuanTie) <guoren@kernel.org>
> ---
>  drivers/irqchip/irq-aclint-sswi.c | 31 +------------------------------
>  1 file changed, 1 insertion(+), 30 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-aclint-sswi.c b/drivers/irqchip/irq-aclint-sswi.c
> index 34572db94f3d..f48f042dccdf 100644
> --- a/drivers/irqchip/irq-aclint-sswi.c
> +++ b/drivers/irqchip/irq-aclint-sswi.c
> @@ -180,33 +180,4 @@ static int __init generic_aclint_sswi_early_probe(struct device_node *node,
>  IRQCHIP_DECLARE(mips_p8700_sswi, "mips,p8700-aclint-sswi", generic_aclint_sswi_early_probe);
>  IRQCHIP_DECLARE(nuclei_ux900_sswi, "nuclei,ux900-aclint-sswi", generic_aclint_sswi_early_probe);
>  IRQCHIP_DECLARE(spacemit_k3_sswi, "spacemit,k3-aclint-sswi", generic_aclint_sswi_early_probe);
> -
> -/* THEAD variant */
> -#define THEAD_C9XX_CSR_SXSTATUS			0x5c0
> -#define THEAD_C9XX_SXSTATUS_CLINTEE		BIT(17)
> -
> -static int __init thead_aclint_sswi_probe(struct fwnode_handle *fwnode)
> -{
> -	int rc;
> -
> -	/* If it is T-HEAD CPU, check whether SSWI is enabled */
> -	if (riscv_cached_mvendorid(0) == THEAD_VENDOR_ID &&
> -	    !(csr_read(THEAD_C9XX_CSR_SXSTATUS) & THEAD_C9XX_SXSTATUS_CLINTEE))
> -		return -ENOTSUPP;
> -
> -	rc = aclint_sswi_probe(fwnode);
> -	if (rc)
> -		return rc;
> -
> -	/* Announce that SSWI is providing IPIs */
> -	pr_info("providing IPIs using THEAD ACLINT SSWI\n");
> -
> -	return 0;
> -}
> -
> -static int __init thead_aclint_sswi_early_probe(struct device_node *node,
> -						struct device_node *parent)
> -{
> -	return thead_aclint_sswi_probe(&node->fwnode);
> -}
> -IRQCHIP_DECLARE(thead_aclint_sswi, "thead,c900-aclint-sswi", thead_aclint_sswi_early_probe);
> +IRQCHIP_DECLARE(thead_aclint_sswi, "thead,c900-aclint-sswi", generic_aclint_sswi_early_probe);
> 
> -- 
> 2.43.0
> 

Thanks, LGTM.

Reviewed-by: Inochi Amaoto <inochiama@gmail.com>

  reply	other threads:[~2026-11-29  4:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  3:25 [PATCH 0/3] irqchip/aclint-sswi: XuanTie C9XX generic probe and csky compatible GUO Ren (XuanTie)
2026-11-29  3:25 ` [PATCH 1/3] irqchip/aclint-sswi: Use generic probe for the XuanTie C9XX variant GUO Ren (XuanTie)
2026-11-29  4:04   ` Inochi Amaoto [this message]
2026-11-29  3:25 ` [PATCH 2/3] dt-bindings: interrupt-controller: Add csky,c900-aclint-sswi compatible GUO Ren (XuanTie)
2026-11-29  3:36   ` sashiko-bot
2026-11-29  4:03   ` Inochi Amaoto
2026-11-29  3:25 ` [PATCH 3/3] irqchip/aclint-sswi: Add csky,c900-aclint-sswi support GUO Ren (XuanTie)
2026-11-29  4:05   ` Inochi Amaoto

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=awukB0R9MwUFXZOy@inochi.infowork \
    --to=inochiama@gmail.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=chen.wang@linux.dev \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=guoren@kernel.org \
    --cc=inochiama@outlook.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=radu@rendec.net \
    --cc=robh@kernel.org \
    --cc=samuel.holland@sifive.com \
    --cc=tglx@kernel.org \
    --cc=vladimir.kondratiev@mobileye.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