From: Saravana Kannan <saravanak@google.com>
To: Saravana Kannan <saravanak@google.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Ard Biesheuvel <ardb@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Len Brown <lenb@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: kernel-team@android.com, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-efi@vger.kernel.org,
linux-acpi@vger.kernel.org
Subject: [PATCH v2 4/4] of: property: fw_devlink: Add support for "post-init-supplier" property
Date: Mon, 12 Feb 2024 13:31:45 -0800 [thread overview]
Message-ID: <20240212213147.489377-5-saravanak@google.com> (raw)
In-Reply-To: <20240212213147.489377-1-saravanak@google.com>
Add support for this property so that dependency cycles can be broken and
fw_devlink can do better probe/suspend/resume ordering between devices in a
dependency cycle.
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
drivers/of/property.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 751c11a28f33..dce451161c99 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1066,7 +1066,8 @@ of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode,
}
static void of_link_to_phandle(struct device_node *con_np,
- struct device_node *sup_np)
+ struct device_node *sup_np,
+ u8 flags)
{
struct device_node *tmp_np = of_node_get(sup_np);
@@ -1085,7 +1086,8 @@ static void of_link_to_phandle(struct device_node *con_np,
tmp_np = of_get_next_parent(tmp_np);
}
- fwnode_link_add(of_fwnode_handle(con_np), of_fwnode_handle(sup_np), 0);
+ fwnode_link_add(of_fwnode_handle(con_np), of_fwnode_handle(sup_np),
+ flags);
}
/**
@@ -1198,6 +1200,8 @@ static struct device_node *parse_##fname(struct device_node *np, \
* to a struct device, implement this ops so fw_devlink can use it
* to find the true consumer.
* @optional: Describes whether a supplier is mandatory or not
+ * @fwlink_flags: Optional fwnode link flags to use when creating a fwnode link
+ * for this property.
*
* Returns:
* parse_prop() return values are
@@ -1210,6 +1214,7 @@ struct supplier_bindings {
const char *prop_name, int index);
struct device_node *(*get_con_dev)(struct device_node *np);
bool optional;
+ u8 fwlink_flags;
};
DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
@@ -1240,6 +1245,7 @@ DEFINE_SIMPLE_PROP(leds, "leds", NULL)
DEFINE_SIMPLE_PROP(backlight, "backlight", NULL)
DEFINE_SIMPLE_PROP(panel, "panel", NULL)
DEFINE_SIMPLE_PROP(msi_parent, "msi-parent", "#msi-cells")
+DEFINE_SIMPLE_PROP(post_init_supplier, "post-init-supplier", NULL)
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
@@ -1349,6 +1355,10 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_regulators, },
{ .parse_prop = parse_gpio, },
{ .parse_prop = parse_gpios, },
+ {
+ .parse_prop = parse_post_init_supplier,
+ .fwlink_flags = FWLINK_FLAG_IGNORE,
+ },
{}
};
@@ -1393,7 +1403,8 @@ static int of_link_property(struct device_node *con_np, const char *prop_name)
: of_node_get(con_np);
matched = true;
i++;
- of_link_to_phandle(con_dev_np, phandle);
+ of_link_to_phandle(con_dev_np, phandle,
+ s->fwlink_flags);
of_node_put(phandle);
of_node_put(con_dev_np);
}
--
2.43.0.687.g38aa6559b0-goog
prev parent reply other threads:[~2024-02-12 21:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 21:31 [PATCH v2 0/4] Add post-init-supplier binding to improve suspend/resume stability Saravana Kannan
2024-02-12 21:31 ` [PATCH v2 1/4] driver core: Adds flags param to fwnode_link_add() Saravana Kannan
2024-02-12 21:31 ` [PATCH v2 2/4] driver core: Add FWLINK_FLAG_IGNORE to completely ignore a fwnode link Saravana Kannan
2024-02-12 21:31 ` [PATCH v2 3/4] dt-bindings: Add post-init-supplier property Saravana Kannan
2024-02-12 22:17 ` Rob Herring
2024-02-14 18:48 ` Conor Dooley
2024-02-14 19:13 ` Conor Dooley
2024-02-14 23:32 ` Saravana Kannan
2024-02-15 12:14 ` Conor Dooley
2024-02-21 4:13 ` Saravana Kannan
2024-02-21 19:34 ` Conor Dooley
2024-02-21 22:47 ` Saravana Kannan
2024-02-17 10:27 ` Krzysztof Kozlowski
2024-02-21 4:07 ` Saravana Kannan
2024-02-21 7:21 ` Krzysztof Kozlowski
2024-02-21 14:32 ` Rob Herring
2024-02-12 21:31 ` Saravana Kannan [this message]
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=20240212213147.489377-5-saravanak@google.com \
--to=saravanak@google.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ardb@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=djrscally@gmail.com \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kernel-team@android.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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