From: Lorenzo Pieralisi <lpieralisi@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Sunil V L <sunilvl@ventanamicro.com>,
Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
Huacai Chen <chenhuacai@kernel.org>,
Anup Patel <anup@brainfault.org>,
Hanjun Guo <guohanjun@huawei.com>,
Sudeep Holla <sudeep.holla@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Sunil V L <sunilvl@oss.qualcomm.com>
Subject: [PATCH v3 2/7] ACPI: RISC-V: Fix riscv_acpi_irq_get_dep() loop termination
Date: Wed, 01 Jul 2026 16:38:50 +0200 [thread overview]
Message-ID: <20260701-gic-v5-acpi-iwb-probe-deferral-v3-2-c5562cf0fe29@kernel.org> (raw)
In-Reply-To: <20260701-gic-v5-acpi-iwb-probe-deferral-v3-0-c5562cf0fe29@kernel.org>
In riscv_acpi_add_irq_dep() the main loop condition would currently stop
the loop if an interrupt descriptor contains an interrupt for which the
respective GSI handle is NULL, which is not correct because subsequent
interrupts in the interrupt descriptor might still have a GSI dependency
that must not be skipped.
Rework riscv_acpi_add_irq_dep() and the riscv_acpi_irq_get_dep() call chain
to fix it - by not forcing the loop to stop in order to guarantee
dependency detection for all the interrupt entries in the CRS descriptor.
Fixes: 1b173cc4bfcd ("ACPI: RISC-V: Implement function to add implicit dependencies")
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Tested-by: Sunil V L <sunilvl@oss.qualcomm.com>
Reviewed-by: Sunil V L <sunilvl@oss.qualcomm.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
drivers/acpi/riscv/irq.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/riscv/irq.c b/drivers/acpi/riscv/irq.c
index 9b88d0993e88..cd83c3035cf6 100644
--- a/drivers/acpi/riscv/irq.c
+++ b/drivers/acpi/riscv/irq.c
@@ -299,6 +299,7 @@ static acpi_status riscv_acpi_irq_get_parent(struct acpi_resource *ares, void *c
return AE_OK;
ctx->handle = riscv_acpi_get_gsi_handle(eirq->interrupts[ctx->index]);
+ ctx->rc = 0;
return AE_CTRL_TERMINATE;
}
@@ -314,10 +315,8 @@ static int riscv_acpi_irq_get_dep(acpi_handle handle, unsigned int index, acpi_h
acpi_walk_resources(handle, METHOD_NAME__CRS, riscv_acpi_irq_get_parent, &ctx);
*gsi_handle = ctx.handle;
- if (*gsi_handle)
- return 1;
- return 0;
+ return ctx.rc;
}
static u32 riscv_acpi_add_prt_dep(acpi_handle handle)
@@ -381,8 +380,11 @@ static u32 riscv_acpi_add_irq_dep(acpi_handle handle)
int i;
for (i = 0;
- riscv_acpi_irq_get_dep(handle, i, &gsi_handle);
+ !riscv_acpi_irq_get_dep(handle, i, &gsi_handle);
i++) {
+ if (!gsi_handle)
+ continue;
+
dep_devices.count = 1;
dep_devices.handles = kzalloc_objs(*dep_devices.handles, 1);
if (!dep_devices.handles) {
--
2.34.1
next prev parent reply other threads:[~2026-07-01 14:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 14:38 [PATCH v3 0/7] irqchip/ACPI: Arm GICv5 IWB ACPI IRQ probe deferral Lorenzo Pieralisi
2026-07-01 14:38 ` [PATCH v3 1/7] ACPI: Add acpi_device_clear_dep() helper function Lorenzo Pieralisi
2026-07-02 21:27 ` Marc Zyngier
2026-07-06 8:46 ` Lorenzo Pieralisi
2026-07-01 14:38 ` Lorenzo Pieralisi [this message]
2026-07-01 14:38 ` [PATCH v3 3/7] ACPI: RISC-V: Check acpi_get_handle() status in riscv_acpi_add_prt_dep() Lorenzo Pieralisi
2026-07-01 14:38 ` [PATCH v3 4/7] ACPI: RISC-V: Fix riscv_acpi_add_prt_dep() loop handling Lorenzo Pieralisi
2026-07-01 14:38 ` [PATCH v3 5/7] ACPI: irq: Move RISC-V interrupt controllers autodep to ACPI IRQ code Lorenzo Pieralisi
2026-07-01 14:38 ` [PATCH v3 6/7] ACPI/IORT: Implement ACPI infrastructure to enable GICv5 IWB probe deferral Lorenzo Pieralisi
2026-07-01 14:38 ` [PATCH v3 7/7] irqchip/gic-v5: Enable GICv5 IWB ACPI probe ordering detection Lorenzo Pieralisi
2026-07-02 21:49 ` Marc Zyngier
2026-07-02 21:55 ` Thomas Gleixner
2026-07-02 21:56 ` Thomas Gleixner
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=20260701-gic-v5-acpi-iwb-probe-deferral-v3-2-c5562cf0fe29@kernel.org \
--to=lpieralisi@kernel.org \
--cc=anup@brainfault.org \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=guohanjun@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=maz@kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=sudeep.holla@kernel.org \
--cc=sunilvl@oss.qualcomm.com \
--cc=sunilvl@ventanamicro.com \
--cc=tglx@kernel.org \
--cc=will@kernel.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