public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP
@ 2026-03-09 14:38 Brian Masney
  2026-03-09 14:38 ` [PATCH v2 01/12] " Brian Masney
                   ` (13 more replies)
  0 siblings, 14 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Sudeep Holla, Abel Vesa,
	Andrea della Porta, Baolin Wang, Bjorn Andersson, Chanwoo Choi,
	Frank Li, Geert Uytterhoeven, Krzysztof Kozlowski, Orson Zhai,
	Sascha Hauer, Sylwester Nawrocki, Tudor Ambarus, Alim Akhtar,
	arm-scmi, Chunyan Zhang, Cristian Marussi, Fabio Estevam, imx,
	linux-arm-kernel, linux-arm-msm, linux-renesas-soc,
	linux-samsung-soc, Peng Fan, Pengutronix Kernel Team,
	Dmitry Baryshkov, Krzysztof Kozlowski

There are some clocks where the determine_rate clk op is just an empty
function that returns 0. This can be either because the rounding is
managed by the firmware, or the clock is capable of any rate. Add a
new flag for these type of clocks, and update the clk core so that the
determine_rate() clk op is not required when this flag is set.

Based on discussions with Stephen at Linux Plumbers Conference, he
suggested adding a flag for this particular case. So let's add a new
flag, and update the clk core so that the determine_rate() clk op is
not required when this flag is set.

This series adds the flag, some kunit tests, and updates all of the
relevant drivers under drivers/clk to use the new flag.

Once this is merged, and in Linus's tree, I can update the few remaining
clk drivers that are outside of drivers/clk via those subsystems at a
later time.

Merge Strategy
--------------
All of this needs to be directly merged by Stephen as one series into
his tree. Subsystem maintainers: please leave a Reviewed-by or Acked-by.
To reduce the noise, I am only CCing people on their respective drivers.

Note this series depends on 3 previously-posted patches in this git pull
to Stephen for v7.1.
https://lore.kernel.org/linux-clk/aZuK4-QJCXUeSxtL@redhat.com/

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
Changes in v2:
- Renamed CLK_ROUNDING_FW_MANAGED to CLK_ROUNDING_NOOP
- In clk.c, give an error on probe if the clk implements a
  determine_rate() op and has CLK_ROUNDING_NOOP set.
- Dropped renesas/rzg2l-cpg change since they plan to fill out this
  driver's determine_rate op.
- Link to v1: https://lore.kernel.org/r/20260226-clk-det-rate-fw-managed-v1-0-4421dd2f6dc6@redhat.com

---
Brian Masney (12):
      clk: add new flag CLK_ROUNDING_NOOP
      clk: test: add test suite for CLK_ROUNDING_NOOP flag
      clk: rp1: drop determine_rate op and use CLK_ROUNDING_NOOP flag
      clk: scpi: drop determine_rate op and use CLK_ROUNDING_NOOP flag
      clk: hisilicon: hi3660-stub: drop determine_rate op and use CLK_ROUNDING_NOOP flag
      clk: imx: scu: drop redundant init.ops variable assignment
      clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_NOOP flag
      clk: qcom: rpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
      clk: qcom: rpmh: drop determine_rate op and use CLK_ROUNDING_NOOP flag
      clk: qcom: smd-rpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
      clk: samsung: acpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
      clk: sprd: drop determine_rate op and use CLK_ROUNDING_NOOP flag

 drivers/clk/clk-rp1.c                   | 11 +----
 drivers/clk/clk-scpi.c                  | 14 +-----
 drivers/clk/clk.c                       | 31 ++++++++++--
 drivers/clk/clk_test.c                  | 85 +++++++++++++++++++++++++++++++++
 drivers/clk/hisilicon/clk-hi3660-stub.c | 14 +-----
 drivers/clk/imx/clk-scu.c               | 23 +--------
 drivers/clk/qcom/clk-rpm.c              | 16 ++-----
 drivers/clk/qcom/clk-rpmh.c             |  8 +---
 drivers/clk/qcom/clk-smd-rpm.c          | 15 +-----
 drivers/clk/samsung/clk-acpm.c          | 14 +-----
 drivers/clk/sprd/pll.c                  |  7 ---
 drivers/clk/sprd/pll.h                  |  2 +-
 include/linux/clk-provider.h            |  2 +
 13 files changed, 129 insertions(+), 113 deletions(-)
---
base-commit: 7d6661873f6b54c75195780a40d66bad3d482d8f
change-id: 20260226-clk-det-rate-fw-managed-4b8d061f31be
prerequisite-patch-id: 59198edc95aca82a29327137ad2af82ec13295b6
prerequisite-patch-id: 8932e170649711d7a80c57784033a37faadd519b
prerequisite-patch-id: 91c7b1851c5d77e504c49ce6bf14b3f8b84e826a

Best regards,
-- 
Brian Masney <bmasney@redhat.com>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v2 01/12] clk: add new flag CLK_ROUNDING_NOOP
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-04-29  2:15   ` Stephen Boyd
  2026-03-09 14:38 ` [PATCH v2 02/12] clk: test: add test suite for CLK_ROUNDING_NOOP flag Brian Masney
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Sudeep Holla, Abel Vesa,
	Andrea della Porta, Baolin Wang, Bjorn Andersson, Chanwoo Choi,
	Frank Li, Geert Uytterhoeven, Krzysztof Kozlowski, Orson Zhai,
	Sascha Hauer, Sylwester Nawrocki, Tudor Ambarus, Alim Akhtar,
	arm-scmi, Chunyan Zhang, Cristian Marussi, Fabio Estevam, imx,
	linux-arm-kernel, linux-arm-msm, linux-renesas-soc,
	linux-samsung-soc, Peng Fan, Pengutronix Kernel Team

There are some clocks where the determine_rate clk op is just an empty
function that returns 0. This can be either because the rounding is
managed by the firmware, or the clock is capable of any rate. Add a
new flag for these type of clocks, and update the clk core so that the
determine_rate() clk op is not required when this flag is set.

Acked-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Abel Vesa <abelvesa@kernel.org>
To: Andrea della Porta <andrea.porta@suse.com>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Bjorn Andersson <andersson@kernel.org>
To: Chanwoo Choi <cw00.choi@samsung.com>
To: Frank Li <Frank.Li@nxp.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
To: Krzysztof Kozlowski <krzk@kernel.org>
To: Orson Zhai <orsonzhai@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
To: Sudeep Holla <sudeep.holla@kernel.org>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: arm-scmi@vger.kernel.org
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: Cristian Marussi <cristian.marussi@arm.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
---
 drivers/clk/clk.c            | 31 ++++++++++++++++++++++++++++---
 include/linux/clk-provider.h |  2 ++
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index fd418dc988b1c60c49e3ac9c0c44aa132dd5da28..1187e5b1dbc123d2d2c1f43690d7dcf75a7c4ac3 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1557,6 +1557,21 @@ static int __init clk_disable_unused(void)
 }
 late_initcall_sync(clk_disable_unused);
 
+/**
+ * clk_is_rounding_noop - Check to see if noop clk rounding is used.
+ *
+ * @core: the clk to check
+ *
+ * Clks that have this flag enabled do not need to have a determine_rate() op
+ * set, and will always return success for any rounding operation. This can be
+ * either because the rounding is managed by the firmware, or the clock is
+ * capable of any rate.
+ */
+static inline bool clk_is_rounding_noop(struct clk_core *core)
+{
+	return core->flags & CLK_ROUNDING_NOOP;
+}
+
 static int clk_core_determine_round_nolock(struct clk_core *core,
 					   struct clk_rate_request *req)
 {
@@ -1589,6 +1604,8 @@ static int clk_core_determine_round_nolock(struct clk_core *core,
 		req->rate = core->rate;
 	} else if (core->ops->determine_rate) {
 		return core->ops->determine_rate(core->hw, req);
+	} else if (clk_is_rounding_noop(core)) {
+		return 0;
 	} else {
 		return -EINVAL;
 	}
@@ -1673,7 +1690,7 @@ EXPORT_SYMBOL_GPL(clk_hw_forward_rate_request);
 
 static bool clk_core_can_round(struct clk_core * const core)
 {
-	return core->ops->determine_rate;
+	return core->ops->determine_rate || clk_is_rounding_noop(core);
 }
 
 static int clk_core_round_rate_nolock(struct clk_core *core,
@@ -3528,6 +3545,7 @@ static const struct {
 	ENTRY(CLK_IS_CRITICAL),
 	ENTRY(CLK_OPS_PARENT_ENABLE),
 	ENTRY(CLK_DUTY_CYCLE_PARENT),
+	ENTRY(CLK_ROUNDING_NOOP),
 #undef ENTRY
 };
 
@@ -3906,13 +3924,19 @@ static int __clk_core_init(struct clk_core *core)
 
 	/* check that clk_ops are sane.  See Documentation/driver-api/clk.rst */
 	if (core->ops->set_rate && !core->ops->determine_rate &&
-	      core->ops->recalc_rate) {
+	      core->ops->recalc_rate && !clk_is_rounding_noop(core)) {
 		pr_err("%s: %s must implement .determine_rate in addition to .recalc_rate\n",
 		       __func__, core->name);
 		ret = -EINVAL;
 		goto out;
 	}
 
+	if (clk_is_rounding_noop(core) && core->ops->determine_rate) {
+		pr_err("%s: %s cannot implement both .determine_rate and CLK_ROUNDING_NOOP\n",
+		       __func__, core->name);
+		goto out;
+	}
+
 	if (core->ops->set_parent && !core->ops->get_parent) {
 		pr_err("%s: %s must implement .get_parent & .set_parent\n",
 		       __func__, core->name);
@@ -3920,7 +3944,8 @@ static int __clk_core_init(struct clk_core *core)
 		goto out;
 	}
 
-	if (core->ops->set_parent && !core->ops->determine_rate) {
+	if (core->ops->set_parent && !core->ops->determine_rate &&
+	    !clk_is_rounding_noop(core)) {
 		pr_err("%s: %s must implement .set_parent & .determine_rate\n",
 			__func__, core->name);
 		ret = -EINVAL;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 1cda2c78dffaff037f0f16b0f11106b63b3a746f..33afef9403b526976af80881461bbfe1e4b76c77 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -32,6 +32,8 @@
 #define CLK_OPS_PARENT_ENABLE	BIT(12)
 /* duty cycle call may be forwarded to the parent clock */
 #define CLK_DUTY_CYCLE_PARENT	BIT(13)
+/* clock rate rounding is managed by firmware, don't require determine_rate */
+#define CLK_ROUNDING_NOOP	BIT(14)
 
 struct clk;
 struct clk_hw;

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 02/12] clk: test: add test suite for CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
  2026-03-09 14:38 ` [PATCH v2 01/12] " Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-09 14:38 ` [PATCH v2 03/12] clk: rp1: drop determine_rate op and use " Brian Masney
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-clk, linux-kernel, Brian Masney

Add two new clk tests related to the CLK_ROUNDING_NOOP flag:

- Test that clk_hw_register() fails when determine_rate is not set.

- Test that clk_hw_register() succeeds when determine_rate is not set,
  and CLK_ROUNDING_NOOP is set. clk_set_rate() works, and
  clk_round_rate() returns the requested rate.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/clk_test.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/drivers/clk/clk_test.c b/drivers/clk/clk_test.c
index b1961daac5e22fb84f493f04feab1ff94a975d90..6745b63ee4e5188665825b56c5e0def51d68e10e 100644
--- a/drivers/clk/clk_test.c
+++ b/drivers/clk/clk_test.c
@@ -3541,9 +3541,94 @@ static struct kunit_suite clk_hw_get_dev_of_node_test_suite = {
 	.test_cases = clk_hw_get_dev_of_node_test_cases,
 };
 
+static const struct clk_ops clk_no_determine_rate_ops = {
+	.recalc_rate = clk_dummy_recalc_rate,
+	.set_rate = clk_dummy_set_rate,
+};
+
+/*
+ * Test that clk_hw_register() fails when determine_rate is not set.
+ */
+static void clk_test_no_determine_rate_fails(struct kunit *test)
+{
+	struct clk_init_data init = { };
+	struct clk_dummy_context *ctx;
+	int ret;
+
+	ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
+
+	ctx->rate = DUMMY_CLOCK_INIT_RATE;
+
+	init.name = "test_no_determine_rate";
+	init.ops = &clk_no_determine_rate_ops;
+	ctx->hw.init = &init;
+
+	ret = clk_hw_register(NULL, &ctx->hw);
+	KUNIT_EXPECT_EQ(test, ret, -EINVAL);
+}
+
+/*
+ * Test that clk_hw_register() succeeds when determine_rate is not set,
+ * and CLK_ROUNDING_NOOP is set. clk_set_rate() works, and
+ * clk_round_rate() returns the requested rate.
+ */
+static void clk_test_noop_round_rate(struct kunit *test)
+{
+	struct clk_init_data init = { };
+	struct clk_dummy_context *ctx;
+	long rate, rounded_rate;
+	struct clk *clk;
+	int ret;
+
+	ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
+
+	ctx->rate = DUMMY_CLOCK_INIT_RATE;
+
+	init.name = "test_noop";
+	init.ops = &clk_no_determine_rate_ops;
+	init.flags = CLK_ROUNDING_NOOP;
+	ctx->hw.init = &init;
+
+	ret = clk_hw_register(NULL, &ctx->hw);
+	KUNIT_ASSERT_EQ(test, ret, 0);
+
+	clk = clk_hw_get_clk(&ctx->hw, NULL);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, clk);
+
+	/* Test that clk_round_rate() returns the requested rate */
+	rounded_rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1);
+	KUNIT_EXPECT_EQ(test, rounded_rate, DUMMY_CLOCK_RATE_1);
+
+	/* Set a rate and verify it works */
+	ret = clk_set_rate(clk, DUMMY_CLOCK_RATE_1);
+	KUNIT_ASSERT_EQ(test, ret, 0);
+
+	rate = clk_get_rate(clk);
+	KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_RATE_1);
+
+	clk_put(clk);
+	clk_hw_unregister(&ctx->hw);
+}
+
+static struct kunit_case clk_noop_round_rate_test_cases[] = {
+	KUNIT_CASE(clk_test_no_determine_rate_fails),
+	KUNIT_CASE(clk_test_noop_round_rate),
+	{}
+};
+
+/*
+ * Test suite for CLK_ROUNDING_NOOP flag.
+ */
+static struct kunit_suite clk_noop_round_rate_test_suite = {
+	.name = "clk_noop_round_rate_test",
+	.test_cases = clk_noop_round_rate_test_cases,
+};
 
 kunit_test_suites(
 	&clk_assigned_rates_suite,
+	&clk_noop_round_rate_test_suite,
 	&clk_hw_get_dev_of_node_test_suite,
 	&clk_leaf_mux_set_rate_parent_test_suite,
 	&clk_test_suite,

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 03/12] clk: rp1: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
  2026-03-09 14:38 ` [PATCH v2 01/12] " Brian Masney
  2026-03-09 14:38 ` [PATCH v2 02/12] clk: test: add test suite for CLK_ROUNDING_NOOP flag Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-09 14:38 ` [PATCH v2 04/12] clk: scpi: " Brian Masney
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Andrea della Porta

This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_NOOP flag.

Reviewed-by: Andrea della Porta <andrea.porta@suse.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Andrea della Porta <andrea.porta@suse.com>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/clk-rp1.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/clk-rp1.c b/drivers/clk/clk-rp1.c
index fd144755b879862612ea5e22e913dbb44a140033..a4b2a10adbc47cd5a789d1c3c642a4437c7efef9 100644
--- a/drivers/clk/clk-rp1.c
+++ b/drivers/clk/clk-rp1.c
@@ -1174,12 +1174,6 @@ static unsigned long rp1_varsrc_recalc_rate(struct clk_hw *hw,
 	return clock->cached_rate;
 }
 
-static int rp1_varsrc_determine_rate(struct clk_hw *hw,
-				     struct clk_rate_request *req)
-{
-	return 0;
-}
-
 static const struct clk_ops rp1_pll_core_ops = {
 	.is_prepared = rp1_pll_core_is_on,
 	.prepare = rp1_pll_core_on,
@@ -1227,7 +1221,6 @@ static const struct clk_ops rp1_clk_ops = {
 static const struct clk_ops rp1_varsrc_ops = {
 	.set_rate = rp1_varsrc_set_rate,
 	.recalc_rate = rp1_varsrc_recalc_rate,
-	.determine_rate = rp1_varsrc_determine_rate,
 };
 
 static struct clk_hw *rp1_register_pll(struct rp1_clockman *clockman,
@@ -2000,7 +1993,7 @@ static struct rp1_clk_desc clksrc_mipi0_dsi_byteclk_desc = REGISTER_CLK(
 		"clksrc_mipi0_dsi_byteclk",
 		(const struct clk_parent_data[]) { { .index = 0 } },
 		&rp1_varsrc_ops,
-		0
+		CLK_ROUNDING_NOOP
 	),
 	CLK_DATA(rp1_clock_data,
 		 .num_std_parents = 1,
@@ -2013,7 +2006,7 @@ static struct rp1_clk_desc clksrc_mipi1_dsi_byteclk_desc = REGISTER_CLK(
 		"clksrc_mipi1_dsi_byteclk",
 		(const struct clk_parent_data[]) { { .index = 0 } },
 		&rp1_varsrc_ops,
-		0
+		CLK_ROUNDING_NOOP
 	),
 	CLK_DATA(rp1_clock_data,
 		 .num_std_parents = 1,

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 04/12] clk: scpi: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (2 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 03/12] clk: rp1: drop determine_rate op and use " Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-09 14:38 ` [PATCH v2 05/12] clk: hisilicon: hi3660-stub: " Brian Masney
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Sudeep Holla,
	Cristian Marussi, arm-scmi, linux-arm-kernel

This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_NOOP flag.

Reviewed-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Sudeep Holla <sudeep.holla@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Cristian Marussi <cristian.marussi@arm.com>
Cc: arm-scmi@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/clk-scpi.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c
index 7806569cd0d5c4e32700edb10e4edf2185610a81..f5d0234ad4ad77e4333613139a8ee034b949d01f 100644
--- a/drivers/clk/clk-scpi.c
+++ b/drivers/clk/clk-scpi.c
@@ -32,18 +32,6 @@ static unsigned long scpi_clk_recalc_rate(struct clk_hw *hw,
 	return clk->scpi_ops->clk_get_val(clk->id);
 }
 
-static int scpi_clk_determine_rate(struct clk_hw *hw,
-				   struct clk_rate_request *req)
-{
-	/*
-	 * We can't figure out what rate it will be, so just return the
-	 * rate back to the caller. scpi_clk_recalc_rate() will be called
-	 * after the rate is set and we'll know what rate the clock is
-	 * running at then.
-	 */
-	return 0;
-}
-
 static int scpi_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 			     unsigned long parent_rate)
 {
@@ -54,7 +42,6 @@ static int scpi_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops scpi_clk_ops = {
 	.recalc_rate = scpi_clk_recalc_rate,
-	.determine_rate = scpi_clk_determine_rate,
 	.set_rate = scpi_clk_set_rate,
 };
 
@@ -156,6 +143,7 @@ scpi_clk_ops_init(struct device *dev, const struct of_device_id *match,
 		if (IS_ERR(sclk->info))
 			return PTR_ERR(sclk->info);
 	} else if (init.ops == &scpi_clk_ops) {
+		init.flags |= CLK_ROUNDING_NOOP;
 		if (sclk->scpi_ops->clk_get_range(sclk->id, &min, &max) || !max)
 			return -EINVAL;
 	} else {

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 05/12] clk: hisilicon: hi3660-stub: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (3 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 04/12] clk: scpi: " Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-09 14:38 ` [PATCH v2 06/12] clk: imx: scu: drop redundant init.ops variable assignment Brian Masney
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-clk, linux-kernel, Brian Masney

This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_NOOP flag.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/hisilicon/clk-hi3660-stub.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/hisilicon/clk-hi3660-stub.c b/drivers/clk/hisilicon/clk-hi3660-stub.c
index 7c8b00ee60195e94f3b414bbf79ee5ec3cbf6c79..e47c7838f18503c3207ce6aa7789c2e78e8a4e2a 100644
--- a/drivers/clk/hisilicon/clk-hi3660-stub.c
+++ b/drivers/clk/hisilicon/clk-hi3660-stub.c
@@ -32,7 +32,8 @@
 			.name = #_name,				\
 			.ops = &hi3660_stub_clk_ops,		\
 			.num_parents = 0,			\
-			.flags = CLK_GET_RATE_NOCACHE,		\
+			.flags = CLK_GET_RATE_NOCACHE |		\
+				 CLK_ROUNDING_NOOP,		\
 		},						\
 	}
 
@@ -67,16 +68,6 @@ static unsigned long hi3660_stub_clk_recalc_rate(struct clk_hw *hw,
 	return stub_clk->rate;
 }
 
-static int hi3660_stub_clk_determine_rate(struct clk_hw *hw,
-					  struct clk_rate_request *req)
-{
-	/*
-	 * LPM3 handles rate rounding so just return whatever
-	 * rate is requested.
-	 */
-	return 0;
-}
-
 static int hi3660_stub_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 				    unsigned long parent_rate)
 {
@@ -97,7 +88,6 @@ static int hi3660_stub_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops hi3660_stub_clk_ops = {
 	.recalc_rate    = hi3660_stub_clk_recalc_rate,
-	.determine_rate = hi3660_stub_clk_determine_rate,
 	.set_rate       = hi3660_stub_clk_set_rate,
 };
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 06/12] clk: imx: scu: drop redundant init.ops variable assignment
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (4 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 05/12] clk: hisilicon: hi3660-stub: " Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-09 14:38 ` [PATCH v2 07/12] clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_NOOP flag Brian Masney
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Peng Fan, Abel Vesa,
	Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	imx, linux-arm-kernel

The init.ops is assigned a default value, however right below it is an
if, else if, and else where all of them also assign a value to init.ops.
Drop the redundant init.ops assignment at the top.

Fixes: 3b9ea606cda53 ("clk: imx: scu: add cpu frequency scaling support")
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Abel Vesa <abelvesa@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Frank Li <Frank.Li@nxp.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: linux-clk@vger.kernel.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/imx/clk-scu.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index a85ec48a798b58a12f893587c85709bbd8476310..a39c68d664655537e81df55c7e6d32304de9338a 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -475,7 +475,6 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name,
 	clk->clk_type = clk_type;
 
 	init.name = name;
-	init.ops = &clk_scu_ops;
 	if (rsrc_id == IMX_SC_R_A35 || rsrc_id == IMX_SC_R_A53 || rsrc_id == IMX_SC_R_A72)
 		init.ops = &clk_scu_cpu_ops;
 	else if (rsrc_id == IMX_SC_R_PI_0_PLL)

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 07/12] clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (5 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 06/12] clk: imx: scu: drop redundant init.ops variable assignment Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-09 14:38 ` [PATCH v2 08/12] clk: qcom: rpm: " Brian Masney
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Peng Fan, Abel Vesa,
	Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	imx, linux-arm-kernel

This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_NOOP flag.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Abel Vesa <abelvesa@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Frank Li <Frank.Li@nxp.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: linux-clk@vger.kernel.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/imx/clk-scu.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index a39c68d664655537e81df55c7e6d32304de9338a..13fb77562b031bb82d6fa2d19f9092ed33966aa4 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -262,23 +262,6 @@ static unsigned long clk_scu_recalc_rate(struct clk_hw *hw,
 	return le32_to_cpu(msg.data.resp.rate);
 }
 
-/*
- * clk_scu_determine_rate - Returns the closest rate for a SCU clock
- * @hw: clock to round rate for
- * @req: clock rate request
- *
- * Returns 0 on success, a negative error on failure
- */
-static int clk_scu_determine_rate(struct clk_hw *hw,
-				  struct clk_rate_request *req)
-{
-	/*
-	 * Assume we support all the requested rate and let the SCU firmware
-	 * to handle the left work
-	 */
-	return 0;
-}
-
 static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate,
 				    unsigned long parent_rate)
 {
@@ -436,7 +419,6 @@ static void clk_scu_unprepare(struct clk_hw *hw)
 
 static const struct clk_ops clk_scu_ops = {
 	.recalc_rate = clk_scu_recalc_rate,
-	.determine_rate = clk_scu_determine_rate,
 	.set_rate = clk_scu_set_rate,
 	.get_parent = clk_scu_get_parent,
 	.set_parent = clk_scu_set_parent,
@@ -446,7 +428,6 @@ static const struct clk_ops clk_scu_ops = {
 
 static const struct clk_ops clk_scu_cpu_ops = {
 	.recalc_rate = clk_scu_recalc_rate,
-	.determine_rate = clk_scu_determine_rate,
 	.set_rate = clk_scu_atf_set_cpu_rate,
 	.prepare = clk_scu_prepare,
 	.unprepare = clk_scu_unprepare,
@@ -454,7 +435,6 @@ static const struct clk_ops clk_scu_cpu_ops = {
 
 static const struct clk_ops clk_scu_pi_ops = {
 	.recalc_rate = clk_scu_recalc_rate,
-	.determine_rate = clk_scu_determine_rate,
 	.set_rate    = clk_scu_set_rate,
 };
 
@@ -491,7 +471,7 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name,
 	 * clock status from HW instead of using the possible invalid
 	 * cached rate.
 	 */
-	init.flags = CLK_GET_RATE_NOCACHE;
+	init.flags = CLK_GET_RATE_NOCACHE | CLK_ROUNDING_NOOP;
 	clk->hw.init = &init;
 
 	hw = &clk->hw;

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 08/12] clk: qcom: rpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (6 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 07/12] clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_NOOP flag Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-09 14:38 ` [PATCH v2 09/12] clk: qcom: rpmh: " Brian Masney
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Dmitry Baryshkov,
	Bjorn Andersson, linux-arm-msm

This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_NOOP flag.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Bjorn Andersson <andersson@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/qcom/clk-rpm.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/qcom/clk-rpm.c b/drivers/clk/qcom/clk-rpm.c
index be0145631197bea65438f3bed10344f18d6de802..af2cd40107054cc6d25724497b5749a23f72a04a 100644
--- a/drivers/clk/qcom/clk-rpm.c
+++ b/drivers/clk/qcom/clk-rpm.c
@@ -42,6 +42,7 @@ static const struct clk_parent_data gcc_cxo[] = {
 			.name = #_name "_clk",				      \
 			.parent_data = gcc_pxo,				      \
 			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
+			.flags = CLK_ROUNDING_NOOP,			      \
 		},							      \
 	};								      \
 	static struct clk_rpm clk_rpm_##_name##_a_clk = {		      \
@@ -54,6 +55,7 @@ static const struct clk_parent_data gcc_cxo[] = {
 			.name = #_name "_a_clk",			      \
 			.parent_data = gcc_pxo,				      \
 			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
+			.flags = CLK_ROUNDING_NOOP,			      \
 		},							      \
 	}
 
@@ -78,6 +80,7 @@ static const struct clk_parent_data gcc_cxo[] = {
 			.name = #_name "_clk",				      \
 			.parent_data = gcc_pxo,				      \
 			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
+			.flags = CLK_ROUNDING_NOOP,			      \
 		},							      \
 	}
 
@@ -351,17 +354,6 @@ static int clk_rpm_set_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static int clk_rpm_determine_rate(struct clk_hw *hw,
-				  struct clk_rate_request *req)
-{
-	/*
-	 * RPM handles rate rounding and we don't have a way to
-	 * know what the rate will be, so just return whatever
-	 * rate is requested.
-	 */
-	return 0;
-}
-
 static unsigned long clk_rpm_recalc_rate(struct clk_hw *hw,
 					 unsigned long parent_rate)
 {
@@ -383,7 +375,6 @@ static const struct clk_ops clk_rpm_xo_ops = {
 static const struct clk_ops clk_rpm_fixed_ops = {
 	.prepare	= clk_rpm_fixed_prepare,
 	.unprepare	= clk_rpm_fixed_unprepare,
-	.determine_rate = clk_rpm_determine_rate,
 	.recalc_rate	= clk_rpm_recalc_rate,
 };
 
@@ -391,7 +382,6 @@ static const struct clk_ops clk_rpm_ops = {
 	.prepare	= clk_rpm_prepare,
 	.unprepare	= clk_rpm_unprepare,
 	.set_rate	= clk_rpm_set_rate,
-	.determine_rate = clk_rpm_determine_rate,
 	.recalc_rate	= clk_rpm_recalc_rate,
 };
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 09/12] clk: qcom: rpmh: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (7 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 08/12] clk: qcom: rpm: " Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-09 14:38 ` [PATCH v2 10/12] clk: qcom: smd-rpm: " Brian Masney
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Dmitry Baryshkov,
	Bjorn Andersson, linux-arm-msm

This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_NOOP flag.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Bjorn Andersson <andersson@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/qcom/clk-rpmh.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
index 547729b1a8ee01cf28c11ee8c4bd2f36d7536e6d..877574b952efffd1bf3ceab5d347ed4d5eb24049 100644
--- a/drivers/clk/qcom/clk-rpmh.c
+++ b/drivers/clk/qcom/clk-rpmh.c
@@ -129,6 +129,7 @@ static DEFINE_MUTEX(rpmh_clk_lock);
 		.hw.init = &(struct clk_init_data){			\
 			.ops = &clk_rpmh_bcm_ops,			\
 			.name = #_name,					\
+			.flags = CLK_ROUNDING_NOOP,			\
 		},							\
 	}
 
@@ -321,12 +322,6 @@ static int clk_rpmh_bcm_set_rate(struct clk_hw *hw, unsigned long rate,
 	return 0;
 }
 
-static int clk_rpmh_determine_rate(struct clk_hw *hw,
-				   struct clk_rate_request *req)
-{
-	return 0;
-}
-
 static unsigned long clk_rpmh_bcm_recalc_rate(struct clk_hw *hw,
 					unsigned long prate)
 {
@@ -339,7 +334,6 @@ static const struct clk_ops clk_rpmh_bcm_ops = {
 	.prepare	= clk_rpmh_bcm_prepare,
 	.unprepare	= clk_rpmh_bcm_unprepare,
 	.set_rate	= clk_rpmh_bcm_set_rate,
-	.determine_rate = clk_rpmh_determine_rate,
 	.recalc_rate	= clk_rpmh_bcm_recalc_rate,
 };
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 10/12] clk: qcom: smd-rpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (8 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 09/12] clk: qcom: rpmh: " Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-10 10:17   ` Konrad Dybcio
  2026-03-09 14:38 ` [PATCH v2 11/12] clk: samsung: acpm: " Brian Masney
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Dmitry Baryshkov,
	Bjorn Andersson, linux-arm-msm

This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_NOOP flag.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Bjorn Andersson <andersson@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/qcom/clk-smd-rpm.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c
index 103db984a40b950bd33fba668a292be46af6326e..8c6fc5adf5f50537a4f8d43872bf2f9065e5d6d4 100644
--- a/drivers/clk/qcom/clk-smd-rpm.c
+++ b/drivers/clk/qcom/clk-smd-rpm.c
@@ -35,6 +35,7 @@
 					.name = "xo_board",		      \
 			},						      \
 			.num_parents = 1,				      \
+			.flags = CLK_ROUNDING_NOOP,		      \
 		},							      \
 	};								      \
 	static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active = {	      \
@@ -52,7 +53,7 @@
 					.name = "xo_board",		      \
 			},						      \
 			.num_parents = 1,				      \
-			.flags = (ao_flags),				      \
+			.flags = (CLK_ROUNDING_NOOP | (ao_flags)),	      \
 		},							      \
 	}
 
@@ -370,17 +371,6 @@ static int clk_smd_rpm_set_rate(struct clk_hw *hw, unsigned long rate,
 	return 0;
 }
 
-static int clk_smd_rpm_determine_rate(struct clk_hw *hw,
-				      struct clk_rate_request *req)
-{
-	/*
-	 * RPM handles rate rounding and we don't have a way to
-	 * know what the rate will be, so just return whatever
-	 * rate is requested.
-	 */
-	return 0;
-}
-
 static unsigned long clk_smd_rpm_recalc_rate(struct clk_hw *hw,
 					     unsigned long parent_rate)
 {
@@ -427,7 +417,6 @@ static const struct clk_ops clk_smd_rpm_ops = {
 	.prepare	= clk_smd_rpm_prepare,
 	.unprepare	= clk_smd_rpm_unprepare,
 	.set_rate	= clk_smd_rpm_set_rate,
-	.determine_rate = clk_smd_rpm_determine_rate,
 	.recalc_rate	= clk_smd_rpm_recalc_rate,
 };
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 11/12] clk: samsung: acpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (9 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 10/12] clk: qcom: smd-rpm: " Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-11 11:52   ` Tudor Ambarus
  2026-03-09 14:38 ` [PATCH v2 12/12] clk: sprd: " Brian Masney
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Krzysztof Kozlowski,
	Tudor Ambarus, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, linux-samsung-soc

This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_NOOP flag.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Tudor Ambarus <tudor.ambarus@linaro.org>
To: Krzysztof Kozlowski <krzk@kernel.org>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Chanwoo Choi <cw00.choi@samsung.com>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-clk@vger.kernel.org
---
 drivers/clk/samsung/clk-acpm.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
index b90809ce3f882c489114c9d7299417d7fe373749..b79d973eaa0c275c508a51926ecde5349f00feba 100644
--- a/drivers/clk/samsung/clk-acpm.c
+++ b/drivers/clk/samsung/clk-acpm.c
@@ -72,18 +72,6 @@ static unsigned long acpm_clk_recalc_rate(struct clk_hw *hw,
 					clk->mbox_chan_id, clk->id);
 }
 
-static int acpm_clk_determine_rate(struct clk_hw *hw,
-				   struct clk_rate_request *req)
-{
-	/*
-	 * We can't figure out what rate it will be, so just return the
-	 * rate back to the caller. acpm_clk_recalc_rate() will be called
-	 * after the rate is set and we'll know what rate the clock is
-	 * running at then.
-	 */
-	return 0;
-}
-
 static int acpm_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 			     unsigned long parent_rate)
 {
@@ -95,7 +83,6 @@ static int acpm_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops acpm_clk_ops = {
 	.recalc_rate = acpm_clk_recalc_rate,
-	.determine_rate = acpm_clk_determine_rate,
 	.set_rate = acpm_clk_set_rate,
 };
 
@@ -106,6 +93,7 @@ static int acpm_clk_register(struct device *dev, struct acpm_clk *aclk,
 
 	init.name = name;
 	init.ops = &acpm_clk_ops;
+	init.flags = CLK_ROUNDING_NOOP;
 	aclk->hw.init = &init;
 
 	return devm_clk_hw_register(dev, &aclk->hw);

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 12/12] clk: sprd: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (10 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 11/12] clk: samsung: acpm: " Brian Masney
@ 2026-03-09 14:38 ` Brian Masney
  2026-03-11 11:50 ` [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Tudor Ambarus
  2026-04-28 20:38 ` Brian Masney
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-09 14:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Brian Masney, Orson Zhai, Baolin Wang,
	Chunyan Zhang

This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_NOOP flag.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Orson Zhai <orsonzhai@gmail.com>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/sprd/pll.c | 7 -------
 drivers/clk/sprd/pll.h | 2 +-
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/clk/sprd/pll.c b/drivers/clk/sprd/pll.c
index bc2db19aec0e9d64bac039260b2fbeacaa61d660..31f016030da371c9fe842eab01f6a1b7043b82f1 100644
--- a/drivers/clk/sprd/pll.c
+++ b/drivers/clk/sprd/pll.c
@@ -254,16 +254,9 @@ static int sprd_pll_clk_prepare(struct clk_hw *hw)
 	return 0;
 }
 
-static int sprd_pll_determine_rate(struct clk_hw *hw,
-				   struct clk_rate_request *req)
-{
-	return 0;
-}
-
 const struct clk_ops sprd_pll_ops = {
 	.prepare = sprd_pll_clk_prepare,
 	.recalc_rate = sprd_pll_recalc_rate,
-	.determine_rate = sprd_pll_determine_rate,
 	.set_rate = sprd_pll_set_rate,
 };
 EXPORT_SYMBOL_GPL(sprd_pll_ops);
diff --git a/drivers/clk/sprd/pll.h b/drivers/clk/sprd/pll.h
index 6558f50d0296bc2acd43b031e3927c288434fc08..91b20c1f4dda8e64b4ca795caab128036c11a4fa 100644
--- a/drivers/clk/sprd/pll.h
+++ b/drivers/clk/sprd/pll.h
@@ -78,7 +78,7 @@ struct sprd_pll {
 			.regmap		= NULL,			\
 			.reg		= _reg,			\
 			.hw.init	= _fn(_name, _parent,	\
-					      &sprd_pll_ops, 0),\
+					      &sprd_pll_ops, CLK_ROUNDING_NOOP), \
 		},						\
 	}
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 10/12] clk: qcom: smd-rpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 ` [PATCH v2 10/12] clk: qcom: smd-rpm: " Brian Masney
@ 2026-03-10 10:17   ` Konrad Dybcio
  2026-03-10 10:36     ` Brian Masney
  0 siblings, 1 reply; 22+ messages in thread
From: Konrad Dybcio @ 2026-03-10 10:17 UTC (permalink / raw)
  To: Brian Masney, Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Dmitry Baryshkov, Bjorn Andersson,
	linux-arm-msm

On 3/9/26 3:38 PM, Brian Masney wrote:
> This clk driver has a noop determine_rate clk op. Drop this empty
> function, and enable the CLK_ROUNDING_NOOP flag.
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
> To: Bjorn Andersson <andersson@kernel.org>
> To: Michael Turquette <mturquette@baylibre.com>
> To: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-arm-msm@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  drivers/clk/qcom/clk-smd-rpm.c | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c
> index 103db984a40b950bd33fba668a292be46af6326e..8c6fc5adf5f50537a4f8d43872bf2f9065e5d6d4 100644
> --- a/drivers/clk/qcom/clk-smd-rpm.c
> +++ b/drivers/clk/qcom/clk-smd-rpm.c
> @@ -35,6 +35,7 @@
>  					.name = "xo_board",		      \
>  			},						      \
>  			.num_parents = 1,				      \
> +			.flags = CLK_ROUNDING_NOOP,		      \
>  		},							      \
>  	};								      \
>  	static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active = {	      \
> @@ -52,7 +53,7 @@
>  					.name = "xo_board",		      \
>  			},						      \
>  			.num_parents = 1,				      \
> -			.flags = (ao_flags),				      \
> +			.flags = (CLK_ROUNDING_NOOP | (ao_flags)),	      \
>  		},							      \

The other two definitions (using clk_smd_rpm_branch_ops) also need this

Konrad

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 10/12] clk: qcom: smd-rpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-10 10:17   ` Konrad Dybcio
@ 2026-03-10 10:36     ` Brian Masney
  2026-03-10 10:51       ` Konrad Dybcio
  0 siblings, 1 reply; 22+ messages in thread
From: Brian Masney @ 2026-03-10 10:36 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
	Dmitry Baryshkov, Bjorn Andersson, linux-arm-msm

On Tue, Mar 10, 2026 at 6:17 AM Konrad Dybcio
<konrad.dybcio@oss.qualcomm.com> wrote:
> On 3/9/26 3:38 PM, Brian Masney wrote:
> > This clk driver has a noop determine_rate clk op. Drop this empty
> > function, and enable the CLK_ROUNDING_NOOP flag.
> >
> > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > ---
> > To: Bjorn Andersson <andersson@kernel.org>
> > To: Michael Turquette <mturquette@baylibre.com>
> > To: Stephen Boyd <sboyd@kernel.org>
> > Cc: linux-arm-msm@vger.kernel.org
> > Cc: linux-clk@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > ---
> >  drivers/clk/qcom/clk-smd-rpm.c | 15 ++-------------
> >  1 file changed, 2 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c
> > index 103db984a40b950bd33fba668a292be46af6326e..8c6fc5adf5f50537a4f8d43872bf2f9065e5d6d4 100644
> > --- a/drivers/clk/qcom/clk-smd-rpm.c
> > +++ b/drivers/clk/qcom/clk-smd-rpm.c
> > @@ -35,6 +35,7 @@
> >                                       .name = "xo_board",                   \
> >                       },                                                    \
> >                       .num_parents = 1,                                     \
> > +                     .flags = CLK_ROUNDING_NOOP,                   \
> >               },                                                            \
> >       };                                                                    \
> >       static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active = {          \
> > @@ -52,7 +53,7 @@
> >                                       .name = "xo_board",                   \
> >                       },                                                    \
> >                       .num_parents = 1,                                     \
> > -                     .flags = (ao_flags),                                  \
> > +                     .flags = (CLK_ROUNDING_NOOP | (ao_flags)),            \
> >               },                                                            \
>
> The other two definitions (using clk_smd_rpm_branch_ops) also need this

Are you sure? clk_smd_rpm_branch_ops doesn't have a set_rate() op, and
it's been like this for years. If I add NOOP flag to this ops
structure, then clk_core_can_round() will return true with this
series, and it'll change the behavior of this driver.

Brian

Brian


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 10/12] clk: qcom: smd-rpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-10 10:36     ` Brian Masney
@ 2026-03-10 10:51       ` Konrad Dybcio
  0 siblings, 0 replies; 22+ messages in thread
From: Konrad Dybcio @ 2026-03-10 10:51 UTC (permalink / raw)
  To: Brian Masney
  Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
	Dmitry Baryshkov, Bjorn Andersson, linux-arm-msm

On 3/10/26 11:36 AM, Brian Masney wrote:
> On Tue, Mar 10, 2026 at 6:17 AM Konrad Dybcio
> <konrad.dybcio@oss.qualcomm.com> wrote:
>> On 3/9/26 3:38 PM, Brian Masney wrote:
>>> This clk driver has a noop determine_rate clk op. Drop this empty
>>> function, and enable the CLK_ROUNDING_NOOP flag.
>>>
>>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>> Signed-off-by: Brian Masney <bmasney@redhat.com>
>>> ---
>>> To: Bjorn Andersson <andersson@kernel.org>
>>> To: Michael Turquette <mturquette@baylibre.com>
>>> To: Stephen Boyd <sboyd@kernel.org>
>>> Cc: linux-arm-msm@vger.kernel.org
>>> Cc: linux-clk@vger.kernel.org
>>> Cc: linux-kernel@vger.kernel.org
>>> ---
>>>  drivers/clk/qcom/clk-smd-rpm.c | 15 ++-------------
>>>  1 file changed, 2 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c
>>> index 103db984a40b950bd33fba668a292be46af6326e..8c6fc5adf5f50537a4f8d43872bf2f9065e5d6d4 100644
>>> --- a/drivers/clk/qcom/clk-smd-rpm.c
>>> +++ b/drivers/clk/qcom/clk-smd-rpm.c
>>> @@ -35,6 +35,7 @@
>>>                                       .name = "xo_board",                   \
>>>                       },                                                    \
>>>                       .num_parents = 1,                                     \
>>> +                     .flags = CLK_ROUNDING_NOOP,                   \
>>>               },                                                            \
>>>       };                                                                    \
>>>       static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active = {          \
>>> @@ -52,7 +53,7 @@
>>>                                       .name = "xo_board",                   \
>>>                       },                                                    \
>>>                       .num_parents = 1,                                     \
>>> -                     .flags = (ao_flags),                                  \
>>> +                     .flags = (CLK_ROUNDING_NOOP | (ao_flags)),            \
>>>               },                                                            \
>>
>> The other two definitions (using clk_smd_rpm_branch_ops) also need this
> 
> Are you sure? clk_smd_rpm_branch_ops doesn't have a set_rate() op, and
> it's been like this for years. If I add NOOP flag to this ops
> structure, then clk_core_can_round() will return true with this
> series, and it'll change the behavior of this driver.

Right, I mistook .recalc_rate for .determine_rate

Konrad

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (11 preceding siblings ...)
  2026-03-09 14:38 ` [PATCH v2 12/12] clk: sprd: " Brian Masney
@ 2026-03-11 11:50 ` Tudor Ambarus
  2026-03-11 13:01   ` Brian Masney
  2026-04-28 20:38 ` Brian Masney
  13 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2026-03-11 11:50 UTC (permalink / raw)
  To: Brian Masney, Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Sudeep Holla, Abel Vesa,
	Andrea della Porta, Baolin Wang, Bjorn Andersson, Chanwoo Choi,
	Frank Li, Geert Uytterhoeven, Krzysztof Kozlowski, Orson Zhai,
	Sascha Hauer, Sylwester Nawrocki, Alim Akhtar, arm-scmi,
	Chunyan Zhang, Cristian Marussi, Fabio Estevam, imx,
	linux-arm-kernel, linux-arm-msm, linux-renesas-soc,
	linux-samsung-soc, Peng Fan, Pengutronix Kernel Team,
	Dmitry Baryshkov, Krzysztof Kozlowski

Hi!

On 3/9/26 4:38 PM, Brian Masney wrote:
> Note this series depends on 3 previously-posted patches in this git pull
> to Stephen for v7.1.
> https://lore.kernel.org/linux-clk/aZuK4-QJCXUeSxtL@redhat.com/

There's no tags/clk-remove-deprecated-apis-v7.1 on
https://github.com/masneyb/linux

Cheers,
ta

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 11/12] clk: samsung: acpm: drop determine_rate op and use CLK_ROUNDING_NOOP flag
  2026-03-09 14:38 ` [PATCH v2 11/12] clk: samsung: acpm: " Brian Masney
@ 2026-03-11 11:52   ` Tudor Ambarus
  0 siblings, 0 replies; 22+ messages in thread
From: Tudor Ambarus @ 2026-03-11 11:52 UTC (permalink / raw)
  To: Brian Masney, Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Krzysztof Kozlowski, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, linux-samsung-soc



On 3/9/26 4:38 PM, Brian Masney wrote:
> This clk driver has a noop determine_rate clk op. Drop this empty
> function, and enable the CLK_ROUNDING_NOOP flag.
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>

> ---
> To: Tudor Ambarus <tudor.ambarus@linaro.org>
> To: Krzysztof Kozlowski <krzk@kernel.org>
> To: Sylwester Nawrocki <s.nawrocki@samsung.com>
> To: Chanwoo Choi <cw00.choi@samsung.com>
> To: Michael Turquette <mturquette@baylibre.com>
> To: Stephen Boyd <sboyd@kernel.org>
> Cc: Alim Akhtar <alim.akhtar@samsung.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-samsung-soc@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> ---
>  drivers/clk/samsung/clk-acpm.c | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
> index b90809ce3f882c489114c9d7299417d7fe373749..b79d973eaa0c275c508a51926ecde5349f00feba 100644
> --- a/drivers/clk/samsung/clk-acpm.c
> +++ b/drivers/clk/samsung/clk-acpm.c
> @@ -72,18 +72,6 @@ static unsigned long acpm_clk_recalc_rate(struct clk_hw *hw,
>  					clk->mbox_chan_id, clk->id);
>  }
>  
> -static int acpm_clk_determine_rate(struct clk_hw *hw,
> -				   struct clk_rate_request *req)
> -{
> -	/*
> -	 * We can't figure out what rate it will be, so just return the
> -	 * rate back to the caller. acpm_clk_recalc_rate() will be called
> -	 * after the rate is set and we'll know what rate the clock is
> -	 * running at then.
> -	 */
> -	return 0;
> -}
> -
>  static int acpm_clk_set_rate(struct clk_hw *hw, unsigned long rate,
>  			     unsigned long parent_rate)
>  {
> @@ -95,7 +83,6 @@ static int acpm_clk_set_rate(struct clk_hw *hw, unsigned long rate,
>  
>  static const struct clk_ops acpm_clk_ops = {
>  	.recalc_rate = acpm_clk_recalc_rate,
> -	.determine_rate = acpm_clk_determine_rate,
>  	.set_rate = acpm_clk_set_rate,
>  };
>  
> @@ -106,6 +93,7 @@ static int acpm_clk_register(struct device *dev, struct acpm_clk *aclk,
>  
>  	init.name = name;
>  	init.ops = &acpm_clk_ops;
> +	init.flags = CLK_ROUNDING_NOOP;
>  	aclk->hw.init = &init;
>  
>  	return devm_clk_hw_register(dev, &aclk->hw);
> 


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP
  2026-03-11 11:50 ` [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Tudor Ambarus
@ 2026-03-11 13:01   ` Brian Masney
  0 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-03-11 13:01 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
	Sudeep Holla, Abel Vesa, Andrea della Porta, Baolin Wang,
	Bjorn Andersson, Chanwoo Choi, Frank Li, Geert Uytterhoeven,
	Krzysztof Kozlowski, Orson Zhai, Sascha Hauer, Sylwester Nawrocki,
	Alim Akhtar, arm-scmi, Chunyan Zhang, Cristian Marussi,
	Fabio Estevam, imx, linux-arm-kernel, linux-arm-msm,
	linux-renesas-soc, linux-samsung-soc, Peng Fan,
	Pengutronix Kernel Team, Dmitry Baryshkov, Krzysztof Kozlowski

On Wed, Mar 11, 2026 at 7:51 AM Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
> On 3/9/26 4:38 PM, Brian Masney wrote:
> > Note this series depends on 3 previously-posted patches in this git pull
> > to Stephen for v7.1.
> > https://lore.kernel.org/linux-clk/aZuK4-QJCXUeSxtL@redhat.com/
>
> There's no tags/clk-remove-deprecated-apis-v7.1 on
> https://github.com/masneyb/linux

It is here, unless I am missing something?

https://github.com/masneyb/linux/releases/tag/clk-remove-deprecated-apis-v7.1

Brian


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP
  2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
                   ` (12 preceding siblings ...)
  2026-03-11 11:50 ` [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Tudor Ambarus
@ 2026-04-28 20:38 ` Brian Masney
  13 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-04-28 20:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, Sudeep Holla, Abel Vesa,
	Andrea della Porta, Baolin Wang, Bjorn Andersson, Chanwoo Choi,
	Frank Li, Geert Uytterhoeven, Krzysztof Kozlowski, Orson Zhai,
	Sascha Hauer, Sylwester Nawrocki, Tudor Ambarus, Alim Akhtar,
	arm-scmi, Chunyan Zhang, Cristian Marussi, Fabio Estevam, imx,
	linux-arm-kernel, linux-arm-msm, linux-renesas-soc,
	linux-samsung-soc, Peng Fan, Pengutronix Kernel Team,
	Dmitry Baryshkov, Krzysztof Kozlowski

Hi Stephen,

On Mon, Mar 09, 2026 at 10:38:39AM -0400, Brian Masney wrote:
> There are some clocks where the determine_rate clk op is just an empty
> function that returns 0. This can be either because the rounding is
> managed by the firmware, or the clock is capable of any rate. Add a
> new flag for these type of clocks, and update the clk core so that the
> determine_rate() clk op is not required when this flag is set.
> 
> Based on discussions with Stephen at Linux Plumbers Conference, he
> suggested adding a flag for this particular case. So let's add a new
> flag, and update the clk core so that the determine_rate() clk op is
> not required when this flag is set.
> 
> This series adds the flag, some kunit tests, and updates all of the
> relevant drivers under drivers/clk to use the new flag.
> 
> Once this is merged, and in Linus's tree, I can update the few remaining
> clk drivers that are outside of drivers/clk via those subsystems at a
> later time.
> 
> Merge Strategy
> --------------
> All of this needs to be directly merged by Stephen as one series into
> his tree. Subsystem maintainers: please leave a Reviewed-by or Acked-by.
> To reduce the noise, I am only CCing people on their respective drivers.
> 
> Note this series depends on 3 previously-posted patches in this git pull
> to Stephen for v7.1.
> https://lore.kernel.org/linux-clk/aZuK4-QJCXUeSxtL@redhat.com/
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

We talked about this change at LPC in Tokyo, and you were the one that
suggested adding a new flag. I initially wanted to add a new shared noop
function to drivers/clk/clk.c. This series implements everything we
talked about in person. The only thing that we didn't talk about in
person was the name of this new flag.

Anyways, let me know if you are interested in this change, and if you
want any changes. If there's no changes then would it be possible to
pick this up?

Thanks,
Brian


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 01/12] clk: add new flag CLK_ROUNDING_NOOP
  2026-03-09 14:38 ` [PATCH v2 01/12] " Brian Masney
@ 2026-04-29  2:15   ` Stephen Boyd
  2026-04-29 13:55     ` Brian Masney
  0 siblings, 1 reply; 22+ messages in thread
From: Stephen Boyd @ 2026-04-29  2:15 UTC (permalink / raw)
  To: Brian Masney, Michael Turquette
  Cc: linux-clk, linux-kernel, Brian Masney, Sudeep Holla, Abel Vesa,
	Andrea della Porta, Baolin Wang, Bjorn Andersson, Chanwoo Choi,
	Frank Li, Geert Uytterhoeven, Krzysztof Kozlowski, Orson Zhai,
	Sascha Hauer, Sylwester Nawrocki, Tudor Ambarus, Alim Akhtar,
	arm-scmi, Chunyan Zhang, Cristian Marussi, Fabio Estevam, imx,
	linux-arm-kernel, linux-arm-msm, linux-renesas-soc,
	linux-samsung-soc, Peng Fan, Pengutronix Kernel Team

Quoting Brian Masney (2026-03-09 07:38:40)
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index fd418dc988b1c60c49e3ac9c0c44aa132dd5da28..1187e5b1dbc123d2d2c1f43690d7dcf75a7c4ac3 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1673,7 +1690,7 @@ EXPORT_SYMBOL_GPL(clk_hw_forward_rate_request);
>  
>  static bool clk_core_can_round(struct clk_core * const core)
>  {
> -       return core->ops->determine_rate;
> +       return core->ops->determine_rate || clk_is_rounding_noop(core);
>  }
>  
>  static int clk_core_round_rate_nolock(struct clk_core *core,
> @@ -3528,6 +3545,7 @@ static const struct {
>         ENTRY(CLK_IS_CRITICAL),
>         ENTRY(CLK_OPS_PARENT_ENABLE),
>         ENTRY(CLK_DUTY_CYCLE_PARENT),
> +       ENTRY(CLK_ROUNDING_NOOP),
>  #undef ENTRY
>  };
>  
> @@ -3906,13 +3924,19 @@ static int __clk_core_init(struct clk_core *core)
>  
>         /* check that clk_ops are sane.  See Documentation/driver-api/clk.rst */
>         if (core->ops->set_rate && !core->ops->determine_rate &&
> -             core->ops->recalc_rate) {
> +             core->ops->recalc_rate && !clk_is_rounding_noop(core)) {
>                 pr_err("%s: %s must implement .determine_rate in addition to .recalc_rate\n",
>                        __func__, core->name);
>                 ret = -EINVAL;
>                 goto out;
>         }
>  
> +       if (clk_is_rounding_noop(core) && core->ops->determine_rate) {
> +               pr_err("%s: %s cannot implement both .determine_rate and CLK_ROUNDING_NOOP\n",
> +                      __func__, core->name);
> +               goto out;
> +       }
> +

This hunk has me irked. I'd rather we export some function like
clk_determine_rate_noop() that just returns 0 instead of adding another
flag. The chance that someone can get it wrong goes down and you can
naturally grep for any clks that are using determine_rate() without
having to also include this flag in the grep. It makes it easier to
reason about as well because we can have code that just checks for
determine_rate presence instead of both (i.e. clk_core_can_round() isn't
changed). Plus a clk_ops structure is more self-contained because it
doesn't rely on the clk flags to go with it.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 01/12] clk: add new flag CLK_ROUNDING_NOOP
  2026-04-29  2:15   ` Stephen Boyd
@ 2026-04-29 13:55     ` Brian Masney
  0 siblings, 0 replies; 22+ messages in thread
From: Brian Masney @ 2026-04-29 13:55 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Michael Turquette, linux-clk, linux-kernel, Sudeep Holla,
	Abel Vesa, Andrea della Porta, Baolin Wang, Bjorn Andersson,
	Chanwoo Choi, Frank Li, Geert Uytterhoeven, Krzysztof Kozlowski,
	Orson Zhai, Sascha Hauer, Sylwester Nawrocki, Tudor Ambarus,
	Alim Akhtar, arm-scmi, Chunyan Zhang, Cristian Marussi,
	Fabio Estevam, imx, linux-arm-kernel, linux-arm-msm,
	linux-renesas-soc, linux-samsung-soc, Peng Fan,
	Pengutronix Kernel Team

On Tue, Apr 28, 2026 at 07:15:36PM -0700, Stephen Boyd wrote:
> Quoting Brian Masney (2026-03-09 07:38:40)
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> > index fd418dc988b1c60c49e3ac9c0c44aa132dd5da28..1187e5b1dbc123d2d2c1f43690d7dcf75a7c4ac3 100644
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -1673,7 +1690,7 @@ EXPORT_SYMBOL_GPL(clk_hw_forward_rate_request);
> >  
> >  static bool clk_core_can_round(struct clk_core * const core)
> >  {
> > -       return core->ops->determine_rate;
> > +       return core->ops->determine_rate || clk_is_rounding_noop(core);
> >  }
> >  
> >  static int clk_core_round_rate_nolock(struct clk_core *core,
> > @@ -3528,6 +3545,7 @@ static const struct {
> >         ENTRY(CLK_IS_CRITICAL),
> >         ENTRY(CLK_OPS_PARENT_ENABLE),
> >         ENTRY(CLK_DUTY_CYCLE_PARENT),
> > +       ENTRY(CLK_ROUNDING_NOOP),
> >  #undef ENTRY
> >  };
> >  
> > @@ -3906,13 +3924,19 @@ static int __clk_core_init(struct clk_core *core)
> >  
> >         /* check that clk_ops are sane.  See Documentation/driver-api/clk.rst */
> >         if (core->ops->set_rate && !core->ops->determine_rate &&
> > -             core->ops->recalc_rate) {
> > +             core->ops->recalc_rate && !clk_is_rounding_noop(core)) {
> >                 pr_err("%s: %s must implement .determine_rate in addition to .recalc_rate\n",
> >                        __func__, core->name);
> >                 ret = -EINVAL;
> >                 goto out;
> >         }
> >  
> > +       if (clk_is_rounding_noop(core) && core->ops->determine_rate) {
> > +               pr_err("%s: %s cannot implement both .determine_rate and CLK_ROUNDING_NOOP\n",
> > +                      __func__, core->name);
> > +               goto out;
> > +       }
> > +
> 
> This hunk has me irked. I'd rather we export some function like
> clk_determine_rate_noop() that just returns 0 instead of adding another
> flag. The chance that someone can get it wrong goes down and you can
> naturally grep for any clks that are using determine_rate() without
> having to also include this flag in the grep. It makes it easier to
> reason about as well because we can have code that just checks for
> determine_rate presence instead of both (i.e. clk_core_can_round() isn't
> changed). Plus a clk_ops structure is more self-contained because it
> doesn't rely on the clk flags to go with it.

I also like the clk_determine_rate_noop() approach much better as well.
I'll send a new version.

Thanks,
Brian


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2026-04-29 13:55 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 14:38 [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Brian Masney
2026-03-09 14:38 ` [PATCH v2 01/12] " Brian Masney
2026-04-29  2:15   ` Stephen Boyd
2026-04-29 13:55     ` Brian Masney
2026-03-09 14:38 ` [PATCH v2 02/12] clk: test: add test suite for CLK_ROUNDING_NOOP flag Brian Masney
2026-03-09 14:38 ` [PATCH v2 03/12] clk: rp1: drop determine_rate op and use " Brian Masney
2026-03-09 14:38 ` [PATCH v2 04/12] clk: scpi: " Brian Masney
2026-03-09 14:38 ` [PATCH v2 05/12] clk: hisilicon: hi3660-stub: " Brian Masney
2026-03-09 14:38 ` [PATCH v2 06/12] clk: imx: scu: drop redundant init.ops variable assignment Brian Masney
2026-03-09 14:38 ` [PATCH v2 07/12] clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_NOOP flag Brian Masney
2026-03-09 14:38 ` [PATCH v2 08/12] clk: qcom: rpm: " Brian Masney
2026-03-09 14:38 ` [PATCH v2 09/12] clk: qcom: rpmh: " Brian Masney
2026-03-09 14:38 ` [PATCH v2 10/12] clk: qcom: smd-rpm: " Brian Masney
2026-03-10 10:17   ` Konrad Dybcio
2026-03-10 10:36     ` Brian Masney
2026-03-10 10:51       ` Konrad Dybcio
2026-03-09 14:38 ` [PATCH v2 11/12] clk: samsung: acpm: " Brian Masney
2026-03-11 11:52   ` Tudor Ambarus
2026-03-09 14:38 ` [PATCH v2 12/12] clk: sprd: " Brian Masney
2026-03-11 11:50 ` [PATCH v2 00/12] clk: add new flag CLK_ROUNDING_NOOP Tudor Ambarus
2026-03-11 13:01   ` Brian Masney
2026-04-28 20:38 ` Brian Masney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox