lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230301012506.1401883-1-saravanak@google.com>
Date:   Tue, 28 Feb 2023 17:25:06 -0800
From:   Saravana Kannan <saravanak@...gle.com>
To:     Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Saravana Kannan <saravanak@...gle.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>, kernel-team@...roid.com,
        linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v1] clk: Mark a fwnode as initialized when using
 CLK_OF_DECLARE* macros

The CLK_OF_DECLARE macros sometimes prevent the creation of struct
devices for the device node being handled. It does this by
setting/clearing OF_POPULATED flag. This can block the probing of some
devices because fw_devlink will block the consumers of this node till a
struct device is created and probed.

Set the appropriate fwnode flags when these device nodes are initialized
by the clock framework and when OF_POPULATED flag is set/cleared. This
will allow fw_devlink to handle the dependencies correctly.

Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Reported-by: Linus Walleij <linus.walleij@...aro.org>
Link: https://lore.kernel.org/lkml/CACRpkdamxDX6EBVjKX5=D3rkHp17f5pwGdBVhzFU90-0MHY6dQ@mail.gmail.com/
Fixes: 4a032827daa8 ("of: property: Simplify of_link_to_phandle()")
Signed-off-by: Saravana Kannan <saravanak@...gle.com>
---

This is fixing a patch that landed through driver core. So, should Greg
be pulling in this fix?

-Saravana

 drivers/clk/clk.c            | 4 ++++
 include/linux/clk-provider.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ae07685c7588..8bd5b9841993 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -5361,6 +5361,10 @@ void __init of_clk_init(const struct of_device_id *matches)
 				clk_provider->clk_init_cb(clk_provider->np);
 				of_clk_set_defaults(clk_provider->np, true);
 
+				fwnode_dev_initialized(
+					of_fwnode_handle(clk_provider->np),
+					true);
+
 				list_del(&clk_provider->node);
 				of_node_put(clk_provider->np);
 				kfree(clk_provider);
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 842e72a5348f..93c0b06a0f2b 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -1373,6 +1373,7 @@ struct clk_hw_onecell_data {
 	static void __init name##_of_clk_init_driver(struct device_node *np) \
 	{								\
 		of_node_clear_flag(np, OF_POPULATED);			\
+		fwnode_dev_initialized(of_fwnode_handle(np), false);	\
 		fn(np);							\
 	}								\
 	OF_DECLARE_1(clk, name, compat, name##_of_clk_init_driver)
-- 
2.39.2.722.g9855ee24e9-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ