[PATCH v4 2/2] mfd: loongson-se: Add multi-node support
From: Qunqin Zhao
Date: Mon Jun 29 2026 - 03:30:16 EST
On the Loongson platform, each node is equipped with a security engine
device. However, due to a hardware flaw, only the device on node 0 can
trigger interrupts. Therefore, interrupts from other nodes are forwarded
by node 0. We need to check in the interrupt handler of node 0 whether
this interrupt is intended for other nodes, this can be accomplished via
shared interrupt handling.
Signed-off-by: Qunqin Zhao <zhaoqunqin@xxxxxxxxxxx>
---
drivers/mfd/loongson-se.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/loongson-se.c b/drivers/mfd/loongson-se.c
index aa34e663c4..2f296faa97 100644
--- a/drivers/mfd/loongson-se.c
+++ b/drivers/mfd/loongson-se.c
@@ -142,6 +142,11 @@ static irqreturn_t se_irq_handler(int irq, void *dev_id)
int_status = readl(se->base + SE_S2LINT_STAT);
+ if (int_status == 0) {
+ spin_unlock(&se->dev_lock);
+ return IRQ_NONE;
+ }
+
/* For controller */
if (int_status & SE_INT_CONTROLLER) {
complete(&se->cmd_completion);
@@ -222,7 +227,7 @@ static int loongson_se_probe(struct platform_device *pdev)
for (i = 0; i < nr_irq; i++) {
irq = platform_get_irq(pdev, i);
- err = devm_request_irq(dev, irq, se_irq_handler, 0, "loongson-se", se);
+ err = devm_request_irq(dev, irq, se_irq_handler, IRQF_SHARED, "loongson-se", se);
if (err) {
dev_err(dev, "failed to request IRQ: %d\n", irq);
return err;
@@ -233,7 +238,7 @@ static int loongson_se_probe(struct platform_device *pdev)
if (err)
return err;
- return devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, engines,
+ return devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, engines,
ARRAY_SIZE(engines), NULL, 0, NULL);
}
--
2.47.2