From: Brian Masney <bmasney@redhat.com>
To: Saravana Kannan <saravanak@kernel.org>,
Abel Vesa <abelvesa@kernel.org>,
Maxime Ripard <mripard@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Bjorn Andersson <andersson@kernel.org>,
Hans de Goede <johannes.goede@oss.qualcomm.com>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, Brian Masney <bmasney@redhat.com>
Subject: [PATCH 1/4] clk: introduce stub clk_sync_state()
Date: Wed, 03 Jun 2026 10:21:46 -0400 [thread overview]
Message-ID: <20260603-clk-sync-state-v1-1-457120eed200@redhat.com> (raw)
In-Reply-To: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com>
Add a stub clk_sync_state() since this will be needed for some clk
drivers that already have a sync_state callback. This allows introducing
all of the necessary changes into the drivers before actually adding the
real clk_sync_state() implementation. Doing it this way ensures that the
tree stays bisectable, and the individual changes are small patches.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/clk.c | 6 ++++++
include/linux/clk.h | 14 ++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 048adfa86a5d..9cb2b42d1be4 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1557,6 +1557,12 @@ static int __init clk_disable_unused(void)
}
late_initcall_sync(clk_disable_unused);
+void clk_sync_state(struct device *dev)
+{
+ /* Will fill in */
+}
+EXPORT_SYMBOL_GPL(clk_sync_state);
+
static int clk_core_determine_round_nolock(struct clk_core *core,
struct clk_rate_request *req)
{
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 998ba3f261da..31a0c9224c46 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -846,6 +846,20 @@ void devm_clk_put(struct device *dev, struct clk *clk);
*/
+/*
+ * clk_sync_state - sync_state callback to disable unused clocks
+ * @dev: the clock provider device whose unused clocks should be disabled
+ *
+ * It is called by the driver core once all consumers of @dev have probed,
+ * and disables any clocks belonging to @dev that are unused at that point.
+ *
+ * If a clock provider doesn't have a sync_state callback, then the framework
+ * will set up clk_sync_state() on your drivers behalf. If your driver needs
+ * a sync_state callback, then that callback also needs to call
+ * clk_sync_state().
+ */
+void clk_sync_state(struct device *dev);
+
/**
* clk_round_rate - adjust a rate to the exact rate a clock can provide
* @clk: clock source
--
2.54.0
next prev parent reply other threads:[~2026-06-03 14:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 14:21 [PATCH 0/4] clk: implement sync_state support Brian Masney
2026-06-03 14:21 ` Brian Masney [this message]
2026-06-03 14:21 ` [PATCH 2/4] clk: qcom: common: introduce qcom_cc_sync_state() Brian Masney
2026-06-06 11:15 ` Dmitry Baryshkov
2026-06-07 4:43 ` Val Packett
2026-06-07 10:30 ` Dmitry Baryshkov
2026-06-15 14:24 ` Brian Masney
2026-06-15 14:33 ` Konrad Dybcio
2026-06-15 14:48 ` Brian Masney
2026-06-15 14:51 ` Konrad Dybcio
2026-06-15 15:04 ` Brian Masney
2026-06-16 21:14 ` Brian Masney
2026-06-08 8:47 ` Konrad Dybcio
2026-06-03 14:21 ` [PATCH 3/4] clk: qcom: convert from icc_sync_state() to qcom_cc_sync_state() Brian Masney
2026-06-06 6:25 ` Jens Glathe
2026-06-15 14:22 ` Brian Masney
2026-06-15 14:50 ` Jens Glathe
2026-06-06 11:17 ` Dmitry Baryshkov
2026-06-03 14:21 ` [PATCH 4/4] clk: implement sync_state support Brian Masney
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=20260603-clk-sync-state-v1-1-457120eed200@redhat.com \
--to=bmasney@redhat.com \
--cc=abelvesa@kernel.org \
--cc=andersson@kernel.org \
--cc=johannes.goede@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=saravanak@kernel.org \
--cc=sboyd@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®