From: Sunil V L <sunilvl@oss.qualcomm.com>
To: linux-acpi@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Mayuresh Chitale <mchitale@gmail.com>,
Anup Patel <anup@brainfault.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Rob Herring <robh@kernel.org>,
Saravana Kannan <saravanak@kernel.org>,
Sunil V L <sunilvl@oss.qualcomm.com>
Subject: [RFC PATCH 2/5] ACPI: property: Add ports/in-ports/out-ports support to acpi_fwnode_get_parent()
Date: Tue, 29 Sep 2026 14:25:21 +0530 [thread overview]
Message-ID: <20260929085524.1554507-3-sunilvl@oss.qualcomm.com> (raw)
In-Reply-To: <20260929085524.1554507-1-sunilvl@oss.qualcomm.com>
From: Sunil V L <sunilvl@oss.qualcomm.com>
For collections of ports, the node name may be defined as "ports",
"in-ports", or "out-ports". Currently, acpi_fwnode_get_parent() does
not handle these container nodes, which can lead to incorrect parent
resolution when parsing remote-endpoints via common fwnode_* interfaces.
Extend acpi_fwnode_get_parent() to recognize "ports", "in-ports", and
"out-ports" as container nodes and ensure the correct parent node is
returned.
Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com>
---
drivers/acpi/property.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 8ee5a1f0eb48..78400620390b 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1422,7 +1422,7 @@ static struct fwnode_handle *
acpi_node_get_parent(const struct fwnode_handle *fwnode)
{
if (is_acpi_data_node(fwnode)) {
- /* All data nodes have parent pointer so just return that */
+ /* Keep the structural parent for generic fwnode iteration. */
return to_acpi_data_node(fwnode)->parent;
}
if (is_acpi_device_node(fwnode)) {
@@ -1703,7 +1703,19 @@ acpi_fwnode_get_name_prefix(const struct fwnode_handle *fwnode)
static struct fwnode_handle *
acpi_fwnode_get_parent(struct fwnode_handle *fwnode)
{
- return acpi_node_get_parent(fwnode);
+ struct fwnode_handle *parent;
+ const char *name;
+
+ parent = acpi_node_get_parent(fwnode);
+ if (!is_acpi_data_node(parent))
+ return parent;
+
+ name = to_acpi_data_node(parent)->name;
+ if (!strcmp(name, "ports") || !strcmp(name, "in-ports") ||
+ !strcmp(name, "out-ports"))
+ return acpi_node_get_parent(parent);
+
+ return parent;
}
static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
--
2.43.0
next prev parent reply other threads:[~2026-09-29 8:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 8:55 [RFC PATCH 0/5] hwtracing: rvtrace: Add ACPI support Sunil V L
2026-09-29 8:55 ` [RFC PATCH 1/5] of: property: Add in-ports/out-ports support to of_fwnode_graph_get_port_parent() Sunil V L
2026-09-29 8:55 ` Sunil V L [this message]
2026-09-29 8:55 ` [RFC PATCH 3/5] ACPI: property: Add device graph support Sunil V L
2026-09-29 8:55 ` [RFC PATCH 4/5] hwtracing: rvtrace: Move to fwnode_* APIs Sunil V L
2026-09-29 8:55 ` [RFC PATCH 5/5] hwtracing: rvtrace: Add ACPI support Sunil V L
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=20260929085524.1554507-3-sunilvl@oss.qualcomm.com \
--to=sunilvl@oss.qualcomm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=anup@brainfault.org \
--cc=devicetree@vger.kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mchitale@gmail.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@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
all inboxes | Powered by JetHome®