Re: [PATCH 1/3] irqchip/aclint-sswi: Use generic probe for the XuanTie C9XX variant
From: Inochi Amaoto
Date: Sat Nov 28 2026 - 23:04:37 EST
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@xxxxxxxxxx/ [1]
> Signed-off-by: GUO Ren (XuanTie) <guoren@xxxxxxxxxx>
> ---
> 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@xxxxxxxxx>