[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220623080344.783549-2-saravanak@google.com>
Date: Thu, 23 Jun 2022 01:03:42 -0700
From: Saravana Kannan <saravanak@...gle.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Len Brown <lenb@...nel.org>,
Saravana Kannan <saravanak@...gle.com>
Cc: sascha hauer <sha@...gutronix.de>, peng fan <peng.fan@....com>,
kevin hilman <khilman@...nel.org>,
ulf hansson <ulf.hansson@...aro.org>,
len brown <len.brown@...el.com>, pavel machek <pavel@....cz>,
joerg roedel <joro@...tes.org>, will deacon <will@...nel.org>,
andrew lunn <andrew@...n.ch>,
heiner kallweit <hkallweit1@...il.com>,
russell king <linux@...linux.org.uk>,
"david s. miller" <davem@...emloft.net>,
eric dumazet <edumazet@...gle.com>,
jakub kicinski <kuba@...nel.org>,
paolo abeni <pabeni@...hat.com>,
linus walleij <linus.walleij@...aro.org>,
hideaki yoshifuji <yoshfuji@...ux-ipv6.org>,
david ahern <dsahern@...nel.org>, kernel-team@...roid.com,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
iommu@...ts.linux-foundation.org, netdev@...r.kernel.org,
linux-gpio@...r.kernel.org, kernel@...gutronix.de,
devicetree@...r.kernel.org, linux-acpi@...r.kernel.org
Subject: [PATCH v2 1/2] driver core: fw_devlink: Allow firmware to mark
devices as best effort
When firmware sets the FWNODE_FLAG_BEST_EFFORT flag for a fwnode,
fw_devlink will do a best effort ordering for that device where it'll
only enforce the probe/suspend/resume ordering of that device with
suppliers that have drivers. The driver of that device can then decide
if it wants to defer probe or probe without the suppliers.
This will be useful for avoid probe delays of the console device that
were caused by commit 71066545b48e ("driver core: Set
fw_devlink.strict=1 by default").
Fixes: 71066545b48e ("driver core: Set fw_devlink.strict=1 by default")
Reported-by: Sascha Hauer <sha@...gutronix.de>
Reported-by: Peng Fan <peng.fan@....com>
Signed-off-by: Saravana Kannan <saravanak@...gle.com>
Tested-by: Peng Fan <peng.fan@....com>
---
drivers/base/core.c | 3 ++-
include/linux/fwnode.h | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 839f64485a55..ccdd5b4295de 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -968,7 +968,8 @@ static void device_links_missing_supplier(struct device *dev)
static bool dev_is_best_effort(struct device *dev)
{
- return fw_devlink_best_effort && dev->can_match;
+ return (fw_devlink_best_effort && dev->can_match) ||
+ (dev->fwnode && (dev->fwnode->flags & FWNODE_FLAG_BEST_EFFORT));
}
/**
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 9a81c4410b9f..89b9bdfca925 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -27,11 +27,15 @@ struct device;
* driver needs its child devices to be bound with
* their respective drivers as soon as they are
* added.
+ * BEST_EFFORT: The fwnode/device needs to probe early and might be missing some
+ * suppliers. Only enforce ordering with suppliers that have
+ * drivers.
*/
#define FWNODE_FLAG_LINKS_ADDED BIT(0)
#define FWNODE_FLAG_NOT_DEVICE BIT(1)
#define FWNODE_FLAG_INITIALIZED BIT(2)
#define FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD BIT(3)
+#define FWNODE_FLAG_BEST_EFFORT BIT(4)
struct fwnode_handle {
struct fwnode_handle *secondary;
--
2.37.0.rc0.161.g10f37bed90-goog
Powered by blists - more mailing lists