Message ID | 20230710094321.1378351-3-apatel@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4907559vqx; Mon, 10 Jul 2023 02:58:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlHflRBD+z4b9tEC1j+vFCrL6dLqwh5NDydXLrEAZG+pX7HVHXX5GQlZT6A32qkLt16xxDHJ X-Received: by 2002:a05:6a00:1a88:b0:678:5d3c:33e8 with SMTP id e8-20020a056a001a8800b006785d3c33e8mr15199613pfv.18.1688983119454; Mon, 10 Jul 2023 02:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688983119; cv=none; d=google.com; s=arc-20160816; b=b8b9B+ier0Wm9c6g0/ZbfxL7+WgzjC7qn1raFrKYLPn3HAHhAyrcf/rn1V8DnWtPx+ wnVv3VsuSOCcaSVLoW1E/0q5KQRlkeHCIHS8VFHfzb+Q5BkkjLF5QTEHO/91Gr5IMzBT AJukOSGTNPBz9VJPJxnKXvZnki/zZZytJudrJa2cXpQp3iMZDNHS9r8wHF0YooF1j68V SzjsXjO2MDkvODc5dU9d81FvODM6W2KkD9F63+fuzFburyoPIgDjJ5c6MgjfdoS6RYsH ARBFBqA90vhFj8bZ2HEzNmcoRI4QUrnqCCoz/PNU1UMzZZASOT3axgYNXQpo9y9tGtQT 5rRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XXSsvlQ/R6yHM0Hz/nbqBTRJ+migXFNIKunDjIZh+EE=; fh=siuReS9O1bGemQ4LZytRoS7QthZ4+BtPZKlxlnFc5fg=; b=y9f4zgg0+GQh7yakrwg9uorCyM3JE8NsZBtCCh1NhVpAU4RpcIb/SC5YwXXoSQHIc0 0k/uB4c84VsIbAcs5crrItj61z7lcj7sDsl5H1T0AppkRGQNUS1oV+MA2k0e6nCuetlB DL+QDUiQt+VytpM8Hy0uz2dfqN4qdiZr1FbJ/vz9pOrwuv437LWKB+0Y1H5ADL5Nyw+B hbFFOac1wcmR8+2/HQOJer5t+Q1yLV/6BMtdHN65XaK0X3HTCTBu8odabM33OcaY9OZ/ LiahhBV4JwQKTa8YwNZ3N8rBg3GOT3zv+CRb/9KUDm9uY74CR2iqJjFXCg4rpYYM9uwn HoOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="W/of7M62"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fj10-20020a056a003a0a00b0067a39a4c158si9016626pfb.2.2023.07.10.02.58.26; Mon, 10 Jul 2023 02:58:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="W/of7M62"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232181AbjGJJt2 (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Mon, 10 Jul 2023 05:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233362AbjGJJsX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 10 Jul 2023 05:48:23 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09E2449E0 for <linux-kernel@vger.kernel.org>; Mon, 10 Jul 2023 02:43:53 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-78360f61ba0so213589539f.1 for <linux-kernel@vger.kernel.org>; Mon, 10 Jul 2023 02:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1688982232; x=1691574232; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XXSsvlQ/R6yHM0Hz/nbqBTRJ+migXFNIKunDjIZh+EE=; b=W/of7M624lty1wnoYq2AEd8m6M/KJ2u+uFQsUmtTpS50lkX1mksFm1FF5vcO1pWyZj xyZSuo6XsQozWpsz8wvW2dGylYfwwi6Xxx/2iqxH+rhf3Na64EivLBq50b6jQmgOsEcW PpSKzmM3OKO+rcyZHvfD4RlVGPHN94F59v5oBbcRv381JFtmEyzQ5Xij4MBPhGIuMDjW tReZsODNXa3NudsL5yhXPFj9NjjOyJcql86MO0x13wu/D/Z//ItyNqxqhqPMlr2O7t/M XBnWb9YMUym97gSAJFEzaU8PVfVSRHbXzlDk9spe5Gk604RvBZUToV/TtMQrRSROw0M7 FFUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688982232; x=1691574232; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XXSsvlQ/R6yHM0Hz/nbqBTRJ+migXFNIKunDjIZh+EE=; b=DMKGFJwtcQBaEk0olNcwAvO8wrmn2kx8kHlHIS2TpgZxROOBTC63h4uWYgVpLlCrKP DP2/GnquKIrPiXfFPW4ld+MZaMGG5cGIgT1xQSRT6ucwfDfZ5PiyvmvuW7qtLCnxbb1u Sp8QBwXu860jpl1PGww7gYBSSPdwzhDfw3GHxyPhA/ky+1+0lvoOgipxo5f0GK5bDqao kCSZq/xuNw4gznRjvldV1bLoOh966I/lfT7106F3gWLTT8FsovaJbFhvxSoQkA4eKtfn Sbl2+CZCnVPnN/rs4wc9DHVjmwc7pn3DoyR0ab+gy861NITF8WZ5nzuvrERQgjwbA7Td ctIQ== X-Gm-Message-State: ABy/qLYAukUk67rFNkv+ssZJp8QqE2XQwqb6B0Q/Qn2qkYXRf81haWJ6 reBjhE16e6tclScsOfmgFfTB3Q== X-Received: by 2002:a6b:7904:0:b0:786:cc36:360c with SMTP id i4-20020a6b7904000000b00786cc36360cmr10770193iop.8.1688982232246; Mon, 10 Jul 2023 02:43:52 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id k1-20020a6b7a41000000b007870c56387dsm936938iop.49.2023.07.10.02.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:43:51 -0700 (PDT) From: Anup Patel <apatel@ventanamicro.com> To: Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <maz@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Cc: Atish Patra <atishp@atishpatra.org>, Andrew Jones <ajones@ventanamicro.com>, Sunil V L <sunilvl@ventanamicro.com>, Conor Dooley <conor@kernel.org>, Saravana Kannan <saravanak@google.com>, Anup Patel <anup@brainfault.org>, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel <apatel@ventanamicro.com> Subject: [PATCH v5 2/9] irqchip/riscv-intc: Add support for RISC-V AIA Date: Mon, 10 Jul 2023 15:13:14 +0530 Message-Id: <20230710094321.1378351-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710094321.1378351-1-apatel@ventanamicro.com> References: <20230710094321.1378351-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771027163557869603 X-GMAIL-MSGID: 1771027163557869603 |
Series |
Linux RISC-V AIA Support
|
|
Commit Message
Anup Patel
July 10, 2023, 9:43 a.m. UTC
The RISC-V advanced interrupt architecture (AIA) extends the per-HART
local interrupts in following ways:
1. Minimum 64 local interrupts for both RV32 and RV64
2. Ability to process multiple pending local interrupts in same
interrupt handler
3. Priority configuration for each local interrupts
4. Special CSRs to configure/access the per-HART MSI controller
This patch adds support for RISC-V AIA in the RISC-V intc driver.
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
---
drivers/irqchip/irq-riscv-intc.c | 36 ++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)
Comments
On Mon, Jul 10, 2023 at 03:13:14PM +0530, Anup Patel wrote: > The RISC-V advanced interrupt architecture (AIA) extends the per-HART > local interrupts in following ways: > 1. Minimum 64 local interrupts for both RV32 and RV64 > 2. Ability to process multiple pending local interrupts in same > interrupt handler > 3. Priority configuration for each local interrupts > 4. Special CSRs to configure/access the per-HART MSI controller afaict, we're only doing (1) and (2) from this list in this patch. > > This patch adds support for RISC-V AIA in the RISC-V intc driver. > > Signed-off-by: Anup Patel <apatel@ventanamicro.com> > --- > drivers/irqchip/irq-riscv-intc.c | 36 ++++++++++++++++++++++++++------ > 1 file changed, 30 insertions(+), 6 deletions(-) > > diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c > index 4adeee1bc391..e235bf1708a4 100644 > --- a/drivers/irqchip/irq-riscv-intc.c > +++ b/drivers/irqchip/irq-riscv-intc.c > @@ -17,6 +17,7 @@ > #include <linux/module.h> > #include <linux/of.h> > #include <linux/smp.h> > +#include <asm/hwcap.h> > > static struct irq_domain *intc_domain; > > @@ -30,6 +31,15 @@ static asmlinkage void riscv_intc_irq(struct pt_regs *regs) > generic_handle_domain_irq(intc_domain, cause); > } > > +static asmlinkage void riscv_intc_aia_irq(struct pt_regs *regs) > +{ > + unsigned long topi; > + > + while ((topi = csr_read(CSR_TOPI))) > + generic_handle_domain_irq(intc_domain, > + topi >> TOPI_IID_SHIFT); > +} > + > /* > * On RISC-V systems local interrupts are masked or unmasked by writing > * the SIE (Supervisor Interrupt Enable) CSR. As CSRs can only be written > @@ -39,12 +49,18 @@ static asmlinkage void riscv_intc_irq(struct pt_regs *regs) > > static void riscv_intc_irq_mask(struct irq_data *d) > { > - csr_clear(CSR_IE, BIT(d->hwirq)); > + if (d->hwirq < BITS_PER_LONG) > + csr_clear(CSR_IE, BIT(d->hwirq)); > + else > + csr_clear(CSR_IEH, BIT(d->hwirq - BITS_PER_LONG)); We can optimize rv64 by allowing the compiler to remove the branch if (IS_ENABLED(CONFIG_32BIT) && d->hwirq >= 32) csr_clear(CSR_IEH, BIT(d->hwirq - 32)); else csr_clear(CSR_IE, BIT(d->hwirq)); > } > > static void riscv_intc_irq_unmask(struct irq_data *d) > { > - csr_set(CSR_IE, BIT(d->hwirq)); > + if (d->hwirq < BITS_PER_LONG) > + csr_set(CSR_IE, BIT(d->hwirq)); > + else > + csr_set(CSR_IEH, BIT(d->hwirq - BITS_PER_LONG)); Same comment as above. > } > > static void riscv_intc_irq_eoi(struct irq_data *d) > @@ -115,16 +131,22 @@ static struct fwnode_handle *riscv_intc_hwnode(void) > > static int __init riscv_intc_init_common(struct fwnode_handle *fn) > { > - int rc; > + int rc, nr_irqs = BITS_PER_LONG; > + > + if (riscv_isa_extension_available(NULL, SxAIA) && BITS_PER_LONG == 32) > + nr_irqs = nr_irqs * 2; The AIA spec states sie and sip are explicitly 64, so how about writing this as int rc, nr_irqs = BITS_PER_LONG; if (riscv_isa_extension_available(NULL, SxAIA)) nr_irqs = 64; > > - intc_domain = irq_domain_create_linear(fn, BITS_PER_LONG, > + intc_domain = irq_domain_create_linear(fn, nr_irqs, > &riscv_intc_domain_ops, NULL); > if (!intc_domain) { > pr_err("unable to add IRQ domain\n"); > return -ENXIO; > } > > - rc = set_handle_irq(&riscv_intc_irq); > + if (riscv_isa_extension_available(NULL, SxAIA)) > + rc = set_handle_irq(&riscv_intc_aia_irq); > + else > + rc = set_handle_irq(&riscv_intc_irq); nit: blank line here > if (rc) { > pr_err("failed to set irq handler\n"); > return rc; > @@ -132,7 +154,9 @@ static int __init riscv_intc_init_common(struct fwnode_handle *fn) > > riscv_set_intc_hwnode_fn(riscv_intc_hwnode); > > - pr_info("%d local interrupts mapped\n", BITS_PER_LONG); > + pr_info("%d local interrupts mapped%s\n", > + nr_irqs, (riscv_isa_extension_available(NULL, SxAIA)) ? nit: unnecessary () > + " using AIA" : ""); > > return 0; > } > -- > 2.34.1 > Thanks, drew
On Tue, Jul 11, 2023 at 7:42 PM Andrew Jones <ajones@ventanamicro.com> wrote: > > On Mon, Jul 10, 2023 at 03:13:14PM +0530, Anup Patel wrote: > > The RISC-V advanced interrupt architecture (AIA) extends the per-HART > > local interrupts in following ways: > > 1. Minimum 64 local interrupts for both RV32 and RV64 > > 2. Ability to process multiple pending local interrupts in same > > interrupt handler > > 3. Priority configuration for each local interrupts > > 4. Special CSRs to configure/access the per-HART MSI controller > > afaict, we're only doing (1) and (2) from this list in this patch. Okay, I will update the commit description. > > > > > This patch adds support for RISC-V AIA in the RISC-V intc driver. > > > > Signed-off-by: Anup Patel <apatel@ventanamicro.com> > > --- > > drivers/irqchip/irq-riscv-intc.c | 36 ++++++++++++++++++++++++++------ > > 1 file changed, 30 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c > > index 4adeee1bc391..e235bf1708a4 100644 > > --- a/drivers/irqchip/irq-riscv-intc.c > > +++ b/drivers/irqchip/irq-riscv-intc.c > > @@ -17,6 +17,7 @@ > > #include <linux/module.h> > > #include <linux/of.h> > > #include <linux/smp.h> > > +#include <asm/hwcap.h> > > > > static struct irq_domain *intc_domain; > > > > @@ -30,6 +31,15 @@ static asmlinkage void riscv_intc_irq(struct pt_regs *regs) > > generic_handle_domain_irq(intc_domain, cause); > > } > > > > +static asmlinkage void riscv_intc_aia_irq(struct pt_regs *regs) > > +{ > > + unsigned long topi; > > + > > + while ((topi = csr_read(CSR_TOPI))) > > + generic_handle_domain_irq(intc_domain, > > + topi >> TOPI_IID_SHIFT); > > +} > > + > > /* > > * On RISC-V systems local interrupts are masked or unmasked by writing > > * the SIE (Supervisor Interrupt Enable) CSR. As CSRs can only be written > > @@ -39,12 +49,18 @@ static asmlinkage void riscv_intc_irq(struct pt_regs *regs) > > > > static void riscv_intc_irq_mask(struct irq_data *d) > > { > > - csr_clear(CSR_IE, BIT(d->hwirq)); > > + if (d->hwirq < BITS_PER_LONG) > > + csr_clear(CSR_IE, BIT(d->hwirq)); > > + else > > + csr_clear(CSR_IEH, BIT(d->hwirq - BITS_PER_LONG)); > > We can optimize rv64 by allowing the compiler to remove the branch > > if (IS_ENABLED(CONFIG_32BIT) && d->hwirq >= 32) > csr_clear(CSR_IEH, BIT(d->hwirq - 32)); > else > csr_clear(CSR_IE, BIT(d->hwirq)); > Makes sense, I will update. > > > } > > > > static void riscv_intc_irq_unmask(struct irq_data *d) > > { > > - csr_set(CSR_IE, BIT(d->hwirq)); > > + if (d->hwirq < BITS_PER_LONG) > > + csr_set(CSR_IE, BIT(d->hwirq)); > > + else > > + csr_set(CSR_IEH, BIT(d->hwirq - BITS_PER_LONG)); > > Same comment as above. Okay, I will update. > > > } > > > > static void riscv_intc_irq_eoi(struct irq_data *d) > > @@ -115,16 +131,22 @@ static struct fwnode_handle *riscv_intc_hwnode(void) > > > > static int __init riscv_intc_init_common(struct fwnode_handle *fn) > > { > > - int rc; > > + int rc, nr_irqs = BITS_PER_LONG; > > + > > + if (riscv_isa_extension_available(NULL, SxAIA) && BITS_PER_LONG == 32) > > + nr_irqs = nr_irqs * 2; > > The AIA spec states sie and sip are explicitly 64, so how about writing > this as > > int rc, nr_irqs = BITS_PER_LONG; > > if (riscv_isa_extension_available(NULL, SxAIA)) > nr_irqs = 64; Okay, I will update. > > > > > - intc_domain = irq_domain_create_linear(fn, BITS_PER_LONG, > > + intc_domain = irq_domain_create_linear(fn, nr_irqs, > > &riscv_intc_domain_ops, NULL); > > if (!intc_domain) { > > pr_err("unable to add IRQ domain\n"); > > return -ENXIO; > > } > > > > - rc = set_handle_irq(&riscv_intc_irq); > > + if (riscv_isa_extension_available(NULL, SxAIA)) > > + rc = set_handle_irq(&riscv_intc_aia_irq); > > + else > > + rc = set_handle_irq(&riscv_intc_irq); > > nit: blank line here I prefer no blank line here because the "if (rc)" below checks for errors for the above calls. > > > if (rc) { > > pr_err("failed to set irq handler\n"); > > return rc; > > @@ -132,7 +154,9 @@ static int __init riscv_intc_init_common(struct fwnode_handle *fn) > > > > riscv_set_intc_hwnode_fn(riscv_intc_hwnode); > > > > - pr_info("%d local interrupts mapped\n", BITS_PER_LONG); > > + pr_info("%d local interrupts mapped%s\n", > > + nr_irqs, (riscv_isa_extension_available(NULL, SxAIA)) ? > > nit: unnecessary () Okay, I will update. > > > + " using AIA" : ""); > > > > return 0; > > } > > -- > > 2.34.1 > > > > Thanks, > drew Regards, Anup
diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c index 4adeee1bc391..e235bf1708a4 100644 --- a/drivers/irqchip/irq-riscv-intc.c +++ b/drivers/irqchip/irq-riscv-intc.c @@ -17,6 +17,7 @@ #include <linux/module.h> #include <linux/of.h> #include <linux/smp.h> +#include <asm/hwcap.h> static struct irq_domain *intc_domain; @@ -30,6 +31,15 @@ static asmlinkage void riscv_intc_irq(struct pt_regs *regs) generic_handle_domain_irq(intc_domain, cause); } +static asmlinkage void riscv_intc_aia_irq(struct pt_regs *regs) +{ + unsigned long topi; + + while ((topi = csr_read(CSR_TOPI))) + generic_handle_domain_irq(intc_domain, + topi >> TOPI_IID_SHIFT); +} + /* * On RISC-V systems local interrupts are masked or unmasked by writing * the SIE (Supervisor Interrupt Enable) CSR. As CSRs can only be written @@ -39,12 +49,18 @@ static asmlinkage void riscv_intc_irq(struct pt_regs *regs) static void riscv_intc_irq_mask(struct irq_data *d) { - csr_clear(CSR_IE, BIT(d->hwirq)); + if (d->hwirq < BITS_PER_LONG) + csr_clear(CSR_IE, BIT(d->hwirq)); + else + csr_clear(CSR_IEH, BIT(d->hwirq - BITS_PER_LONG)); } static void riscv_intc_irq_unmask(struct irq_data *d) { - csr_set(CSR_IE, BIT(d->hwirq)); + if (d->hwirq < BITS_PER_LONG) + csr_set(CSR_IE, BIT(d->hwirq)); + else + csr_set(CSR_IEH, BIT(d->hwirq - BITS_PER_LONG)); } static void riscv_intc_irq_eoi(struct irq_data *d) @@ -115,16 +131,22 @@ static struct fwnode_handle *riscv_intc_hwnode(void) static int __init riscv_intc_init_common(struct fwnode_handle *fn) { - int rc; + int rc, nr_irqs = BITS_PER_LONG; + + if (riscv_isa_extension_available(NULL, SxAIA) && BITS_PER_LONG == 32) + nr_irqs = nr_irqs * 2; - intc_domain = irq_domain_create_linear(fn, BITS_PER_LONG, + intc_domain = irq_domain_create_linear(fn, nr_irqs, &riscv_intc_domain_ops, NULL); if (!intc_domain) { pr_err("unable to add IRQ domain\n"); return -ENXIO; } - rc = set_handle_irq(&riscv_intc_irq); + if (riscv_isa_extension_available(NULL, SxAIA)) + rc = set_handle_irq(&riscv_intc_aia_irq); + else + rc = set_handle_irq(&riscv_intc_irq); if (rc) { pr_err("failed to set irq handler\n"); return rc; @@ -132,7 +154,9 @@ static int __init riscv_intc_init_common(struct fwnode_handle *fn) riscv_set_intc_hwnode_fn(riscv_intc_hwnode); - pr_info("%d local interrupts mapped\n", BITS_PER_LONG); + pr_info("%d local interrupts mapped%s\n", + nr_irqs, (riscv_isa_extension_available(NULL, SxAIA)) ? + " using AIA" : ""); return 0; }