* [PATCH v6] ACPI: AGDI: Add interrupt signaling mode support
@ 2026-01-08 7:56 Kazuhiro Abe
2026-01-08 9:46 ` Hanjun Guo
2026-01-08 22:29 ` Will Deacon
0 siblings, 2 replies; 4+ messages in thread
From: Kazuhiro Abe @ 2026-01-08 7:56 UTC (permalink / raw)
To: Lorenzo Pieralisi, Hanjun Guo, Will Deacon, Sudeep Holla,
Rafael J. Wysocki, Len Brown, Ilkka Koskinen, Catalin Marinas,
linux-acpi, linux-arm-kernel, linux-kernel, Kazuhiro Abe,
Koichi Okuno
AGDI has two types of signaling modes: SDEI and interrupt.
Currently, the AGDI driver only supports SDEI.
Therefore, add support for interrupt signaling mode.
The interrupt vector is retrieved from the AGDI table, and call panic
function when an interrupt occurs.
Acked-by: Hanjun Guo <guohanjun@huawei.com>
Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Signed-off-by: Kazuhiro Abe <fj1078ii@aa.jp.fujitsu.com>
---
This patch (v6) has been rebased to align with the 6.19-rc4 release.
There are no functional changes since v4.
It has been tested and confirmed to work without issues.
Please let us know if you have any questions or concerns.
Thank you, Will, for taking care of the mistake in v5.
v5->v6
- Rebase to 6.19-rc4.
- Correct the mistake in v5.
v5(withdrawn due to mistake): https://lore.kernel.org/all/20251222065359.27330-1-fj1078ii@aa.jp.fujitsu.com/
v4->v5
- Rebase to 6.19-rc1.
- Add acked-by from Hanjun Guo.
v4: https://lore.kernel.org/all/20251017073935.1746365-1-fj1078ii@aa.jp.fujitsu.com/
v3->v4
- Add a comment to the flags member.
- Fix agdi_interrupt_probe.
- Fix agdi_interrupt_remove.
- Add space in struct initializsation.
- Delete curly braces.
v3: https://lore.kernel.org/all/20250905042751.945616-1-fj1078ii@aa.jp.fujitsu.com/
v2->v3
- Fix bug in the return value of agdi_probe function.
- Remove unnecessary curly braces in the agdi_remove function.
v2: https://lore.kernel.org/all/20250829101154.2377800-1-fj1078ii@aa.jp.fujitsu.com/
v1->v2
- Remove acpica update since there is no need to update define value
for this patch.
---
drivers/acpi/arm64/agdi.c | 101 ++++++++++++++++++++++++++++++++++----
1 file changed, 92 insertions(+), 9 deletions(-)
diff --git a/drivers/acpi/arm64/agdi.c b/drivers/acpi/arm64/agdi.c
index e0df3daa4abf..feb4b2cb4618 100644
--- a/drivers/acpi/arm64/agdi.c
+++ b/drivers/acpi/arm64/agdi.c
@@ -16,7 +16,11 @@
#include "init.h"
struct agdi_data {
+ unsigned char flags; /* AGDI Signaling Mode */
int sdei_event;
+ unsigned int gsiv;
+ bool use_nmi;
+ int irq;
};
static int agdi_sdei_handler(u32 sdei_event, struct pt_regs *regs, void *arg)
@@ -48,6 +52,57 @@ static int agdi_sdei_probe(struct platform_device *pdev,
return 0;
}
+static irqreturn_t agdi_interrupt_handler_nmi(int irq, void *dev_id)
+{
+ nmi_panic(NULL, "Arm Generic Diagnostic Dump and Reset NMI Interrupt event issued\n");
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t agdi_interrupt_handler_irq(int irq, void *dev_id)
+{
+ panic("Arm Generic Diagnostic Dump and Reset Interrupt event issued\n");
+ return IRQ_HANDLED;
+}
+
+static int agdi_interrupt_probe(struct platform_device *pdev,
+ struct agdi_data *adata)
+{
+ unsigned long irq_flags;
+ int ret;
+ int irq;
+
+ irq = acpi_register_gsi(NULL, adata->gsiv, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH);
+ if (irq < 0) {
+ dev_err(&pdev->dev, "cannot register GSI#%d (%d)\n", adata->gsiv, irq);
+ return irq;
+ }
+
+ irq_flags = IRQF_PERCPU | IRQF_NOBALANCING | IRQF_NO_AUTOEN |
+ IRQF_NO_THREAD;
+ /* try NMI first */
+ ret = request_nmi(irq, &agdi_interrupt_handler_nmi, irq_flags,
+ "agdi_interrupt_nmi", NULL);
+ if (!ret) {
+ enable_nmi(irq);
+ adata->irq = irq;
+ adata->use_nmi = true;
+ return 0;
+ }
+
+ /* Then try normal interrupt */
+ ret = request_irq(irq, &agdi_interrupt_handler_irq,
+ irq_flags, "agdi_interrupt_irq", NULL);
+ if (ret) {
+ dev_err(&pdev->dev, "cannot register IRQ %d\n", ret);
+ acpi_unregister_gsi(adata->gsiv);
+ return ret;
+ }
+ enable_irq(irq);
+ adata->irq = irq;
+
+ return 0;
+}
+
static int agdi_probe(struct platform_device *pdev)
{
struct agdi_data *adata = dev_get_platdata(&pdev->dev);
@@ -55,12 +110,15 @@ static int agdi_probe(struct platform_device *pdev)
if (!adata)
return -EINVAL;
- return agdi_sdei_probe(pdev, adata);
+ if (adata->flags & ACPI_AGDI_SIGNALING_MODE)
+ return agdi_interrupt_probe(pdev, adata);
+ else
+ return agdi_sdei_probe(pdev, adata);
}
-static void agdi_remove(struct platform_device *pdev)
+static void agdi_sdei_remove(struct platform_device *pdev,
+ struct agdi_data *adata)
{
- struct agdi_data *adata = dev_get_platdata(&pdev->dev);
int err, i;
err = sdei_event_disable(adata->sdei_event);
@@ -83,6 +141,30 @@ static void agdi_remove(struct platform_device *pdev)
adata->sdei_event, ERR_PTR(err));
}
+static void agdi_interrupt_remove(struct platform_device *pdev,
+ struct agdi_data *adata)
+{
+ if (adata->irq == -1)
+ return;
+
+ if (adata->use_nmi)
+ free_nmi(adata->irq, NULL);
+ else
+ free_irq(adata->irq, NULL);
+
+ acpi_unregister_gsi(adata->gsiv);
+}
+
+static void agdi_remove(struct platform_device *pdev)
+{
+ struct agdi_data *adata = dev_get_platdata(&pdev->dev);
+
+ if (adata->flags & ACPI_AGDI_SIGNALING_MODE)
+ agdi_interrupt_remove(pdev, adata);
+ else
+ agdi_sdei_remove(pdev, adata);
+}
+
static struct platform_driver agdi_driver = {
.driver = {
.name = "agdi",
@@ -94,7 +176,7 @@ static struct platform_driver agdi_driver = {
void __init acpi_agdi_init(void)
{
struct acpi_table_agdi *agdi_table;
- struct agdi_data pdata;
+ struct agdi_data pdata = { 0 };
struct platform_device *pdev;
acpi_status status;
@@ -103,12 +185,13 @@ void __init acpi_agdi_init(void)
if (ACPI_FAILURE(status))
return;
- if (agdi_table->flags & ACPI_AGDI_SIGNALING_MODE) {
- pr_warn("Interrupt signaling is not supported");
- goto err_put_table;
- }
+ if (agdi_table->flags & ACPI_AGDI_SIGNALING_MODE)
+ pdata.gsiv = agdi_table->gsiv;
+ else
+ pdata.sdei_event = agdi_table->sdei_event;
- pdata.sdei_event = agdi_table->sdei_event;
+ pdata.irq = -1;
+ pdata.flags = agdi_table->flags;
pdev = platform_device_register_data(NULL, "agdi", 0, &pdata, sizeof(pdata));
if (IS_ERR(pdev))
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v6] ACPI: AGDI: Add interrupt signaling mode support
2026-01-08 7:56 [PATCH v6] ACPI: AGDI: Add interrupt signaling mode support Kazuhiro Abe
@ 2026-01-08 9:46 ` Hanjun Guo
2026-01-08 22:29 ` Will Deacon
1 sibling, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2026-01-08 9:46 UTC (permalink / raw)
To: Kazuhiro Abe, Lorenzo Pieralisi, Will Deacon, Sudeep Holla,
Rafael J. Wysocki, Len Brown, Ilkka Koskinen, Catalin Marinas,
linux-acpi, linux-arm-kernel, linux-kernel, Koichi Okuno
On 2026/1/8 15:56, Kazuhiro Abe wrote:
> AGDI has two types of signaling modes: SDEI and interrupt.
> Currently, the AGDI driver only supports SDEI.
> Therefore, add support for interrupt signaling mode.
> The interrupt vector is retrieved from the AGDI table, and call panic
> function when an interrupt occurs.
>
> Acked-by: Hanjun Guo <guohanjun@huawei.com>
> Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
> Signed-off-by: Kazuhiro Abe <fj1078ii@aa.jp.fujitsu.com>
>
> ---
> This patch (v6) has been rebased to align with the 6.19-rc4 release.
> There are no functional changes since v4.
> It has been tested and confirmed to work without issues.
> Please let us know if you have any questions or concerns.
> Thank you, Will, for taking care of the mistake in v5.
>
> v5->v6
> - Rebase to 6.19-rc4.
> - Correct the mistake in v5.
Take a review again, and the mistake is gone.
Thanks
Hanjun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v6] ACPI: AGDI: Add interrupt signaling mode support
2026-01-08 7:56 [PATCH v6] ACPI: AGDI: Add interrupt signaling mode support Kazuhiro Abe
2026-01-08 9:46 ` Hanjun Guo
@ 2026-01-08 22:29 ` Will Deacon
2026-01-09 2:15 ` Kazuhiro Abe (Fujitsu)
1 sibling, 1 reply; 4+ messages in thread
From: Will Deacon @ 2026-01-08 22:29 UTC (permalink / raw)
To: Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Rafael J. Wysocki,
Len Brown, Ilkka Koskinen, Catalin Marinas, linux-acpi,
linux-arm-kernel, linux-kernel, Koichi Okuno, Kazuhiro Abe
Cc: kernel-team, Will Deacon
On Thu, 08 Jan 2026 16:56:09 +0900, Kazuhiro Abe wrote:
> AGDI has two types of signaling modes: SDEI and interrupt.
> Currently, the AGDI driver only supports SDEI.
> Therefore, add support for interrupt signaling mode.
> The interrupt vector is retrieved from the AGDI table, and call panic
> function when an interrupt occurs.
>
>
> [...]
Applied to arm64 (for-next/acpi), thanks!
[1/1] ACPI: AGDI: Add interrupt signaling mode support
https://git.kernel.org/arm64/c/f7d5e9e70302
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v6] ACPI: AGDI: Add interrupt signaling mode support
2026-01-08 22:29 ` Will Deacon
@ 2026-01-09 2:15 ` Kazuhiro Abe (Fujitsu)
0 siblings, 0 replies; 4+ messages in thread
From: Kazuhiro Abe (Fujitsu) @ 2026-01-09 2:15 UTC (permalink / raw)
To: 'Will Deacon',
Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Rafael J. Wysocki,
Len Brown, Ilkka Koskinen, Catalin Marinas, linux-acpi,
linux-arm-kernel, linux-kernel, Koichi Okuno (Fujitsu)
Cc: kernel-team
Hi Will and Hanjun,
> On Thu, 08 Jan 2026 16:56:09 +0900, Kazuhiro Abe wrote:
> > AGDI has two types of signaling modes: SDEI and interrupt.
> > Currently, the AGDI driver only supports SDEI.
> > Therefore, add support for interrupt signaling mode.
> > The interrupt vector is retrieved from the AGDI table, and call panic
> > function when an interrupt occurs.
> >
> >
> > [...]
>
> Applied to arm64 (for-next/acpi), thanks!
>
> [1/1] ACPI: AGDI: Add interrupt signaling mode support
> https://git.kernel.org/arm64/c/f7d5e9e70302
>
Thank you, Will and Hanjun!
Best Regards,
Kazuhiro Abe
> Cheers,
> --
> Will
>
> https://fixes.arm64.dev
> https://next.arm64.dev
> https://will.arm64.dev
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-01-09 2:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-08 7:56 [PATCH v6] ACPI: AGDI: Add interrupt signaling mode support Kazuhiro Abe
2026-01-08 9:46 ` Hanjun Guo
2026-01-08 22:29 ` Will Deacon
2026-01-09 2:15 ` Kazuhiro Abe (Fujitsu)
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®