From: Lee Jones <lee@kernel.org>
To: Qunqin Zhao <zhaoqunqin@163.com>
Cc: zhaoqunqin@loongson.cn, chenhuacai@kernel.org,
linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
linux-crypto@vger.kernel.org, mfd@lists.linux.dev
Subject: Re: [PATCH v7 1/2] mfd: loongson-se: Add multi-node support
Date: Wed, 23 Sep 2026 16:56:49 +0100 [thread overview]
Message-ID: <20260923155649.GK3864833@google.com> (raw)
In-Reply-To: <20260911090256.7834-2-zhaoqunqin@163.com>
On Fri, 11 Sep 2026, Qunqin Zhao wrote:
> From: Qunqin Zhao <zhaoqunqin@loongson.cn>
>
> 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@loongson.cn>
> ---
> drivers/mfd/loongson-se.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mfd/loongson-se.c b/drivers/mfd/loongson-se.c
> index 3902ba377..7f552a8ee 100644
> --- a/drivers/mfd/loongson-se.c
> +++ b/drivers/mfd/loongson-se.c
> @@ -140,6 +140,11 @@ static irqreturn_t se_irq_handler(int irq, void *dev_id)
>
> int_status = readl(se->base + SE_S2LINT_STAT);
>
Nit: Checks should follow immediately from the call that allocated them.
Thus, remove this empty line please.
> + if (int_status == 0) {
> + spin_unlock(&se->dev_lock);
> + return IRQ_NONE;
> + }
> +
> /* For controller */
> if (int_status & SE_INT_CONTROLLER) {
> complete(&se->cmd_completion);
> @@ -211,24 +216,26 @@ static int loongson_se_probe(struct platform_device *pdev)
> if (IS_ERR(se->base))
> return PTR_ERR(se->base);
>
> - writel(SE_INT_ALL, se->base + SE_S2LINT_EN);
> -
> nr_irq = platform_irq_count(pdev);
> if (nr_irq <= 0)
> return -ENODEV;
>
> + writel(SE_INT_ALL, se->base + SE_S2LINT_CL);
> +
> 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);
> }
>
> + writel(SE_INT_ALL, se->base + SE_S2LINT_EN);
> +
> err = loongson_se_init(se, paddr, se->dmam_size);
> 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
>
--
Lee Jones
next prev parent reply other threads:[~2026-09-23 15:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 9:02 [PATCH v7 0/2] mfd: loongson-se: Add multi-node support and fix miscellaneous issues Qunqin Zhao
2026-09-11 9:02 ` [PATCH v7 1/2] mfd: loongson-se: Add multi-node support Qunqin Zhao
2026-09-23 15:56 ` Lee Jones [this message]
2026-09-11 9:02 ` [PATCH v7 2/2] mfd: loongson-se: Fix miscellaneous issues Qunqin Zhao
2026-09-14 7:36 ` Huacai Chen
2026-09-14 8:19 ` Qunqin Zhao
2026-09-19 12:32 ` Huacai Chen
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=20260923155649.GK3864833@google.com \
--to=lee@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=mfd@lists.linux.dev \
--cc=zhaoqunqin@163.com \
--cc=zhaoqunqin@loongson.cn \
/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
all inboxes | Powered by JetHome®