From: "David E. Garcia Porras" <david.garcia@aheadcomputing.com>
To: opensbi@lists.infradead.org
Cc: "David E. Garcia Porras" <david.garcia@aheadcomputing.com>
Subject: [PATCH 3/4] lib: utils: irqchip: imsic: Dispatch non-IPI interrupts via irqchip framework
Date: Fri, 27 Mar 2026 23:43:46 -0600 [thread overview]
Message-ID: <20260328054347.3706029-4-david.garcia@aheadcomputing.com> (raw)
In-Reply-To: <20260328054347.3706029-1-david.garcia@aheadcomputing.com>
Currently imsic_process_hwirqs() only handles the IPI interrupt
(IMSIC_IPI_ID) and logs all other external interrupts as unhandled.
Platforms using IMSIC in MSI delivery mode (APLIC wired to IMSIC)
have no way to handle M-mode external interrupts through the
existing sbi_irqchip handler registration framework.
Route non-IPI interrupts through sbi_irqchip_process_hwirq() so
that handlers registered via sbi_irqchip_register_handler() are
invoked. Also implement hwirq_unmask and hwirq_mask callbacks
using the existing imsic_local_eix_update() helper, enabling
sbi_irqchip_register_handler() to automatically enable interrupt
identities when a handler is registered.
Signed-off-by: David E. Garcia Porras <david.garcia@aheadcomputing.com>
---
lib/utils/irqchip/imsic.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/lib/utils/irqchip/imsic.c b/lib/utils/irqchip/imsic.c
index 7559a069..6fd82688 100644
--- a/lib/utils/irqchip/imsic.c
+++ b/lib/utils/irqchip/imsic.c
@@ -159,8 +159,7 @@ static int imsic_process_hwirqs(struct sbi_irqchip_device *chip)
sbi_ipi_process();
break;
default:
- sbi_printf("%s: unhandled IRQ%d\n",
- __func__, (u32)mirq);
+ sbi_irqchip_process_hwirq(chip, mirq);
break;
}
}
@@ -353,10 +352,22 @@ static int imsic_hwirq_setup(struct sbi_irqchip_device *chip, u32 hwirq)
return 0;
}
+static void imsic_hwirq_unmask(struct sbi_irqchip_device *chip, u32 hwirq)
+{
+ imsic_local_eix_update(hwirq, 1, false, true);
+}
+
+static void imsic_hwirq_mask(struct sbi_irqchip_device *chip, u32 hwirq)
+{
+ imsic_local_eix_update(hwirq, 1, false, false);
+}
+
static struct sbi_irqchip_device imsic_device = {
.warm_init = imsic_warm_irqchip_init,
.process_hwirqs = imsic_process_hwirqs,
.hwirq_setup = imsic_hwirq_setup,
+ .hwirq_unmask = imsic_hwirq_unmask,
+ .hwirq_mask = imsic_hwirq_mask,
};
int imsic_cold_irqchip_init(struct imsic_data *imsic)
--
2.43.0
--
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
next prev parent reply other threads:[~2026-03-28 5:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-28 5:43 [PATCH 0/4] irqchip/rpmi: Expose APLIC/IMSIC interfaces for platform use David E. Garcia Porras
2026-03-28 5:43 ` [PATCH 1/4] lib: utils: irqchip: aplic: Move register defines to public header David E. Garcia Porras
2026-03-28 5:43 ` [PATCH 2/4] lib: utils: irqchip: aplic: Add aplic_get_list() accessor David E. Garcia Porras
2026-03-28 5:43 ` David E. Garcia Porras [this message]
2026-03-28 5:43 ` [PATCH 4/4] include: mailbox: rpmi_msgprot: Add RPMI performance domain flag defines David E. Garcia Porras
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=20260328054347.3706029-4-david.garcia@aheadcomputing.com \
--to=david.garcia@aheadcomputing.com \
--cc=opensbi@lists.infradead.org \
/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