* [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-27 8:16 ` Geert Uytterhoeven
` (3 more replies)
2026-02-26 18:16 ` [PATCH 02/13] clk: test: add test suite for CLK_ROUNDING_FW_MANAGED flag Brian Masney
` (11 subsequent siblings)
12 siblings, 4 replies; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Brian Masney, Abel Vesa,
Andrea della Porta, Baolin Wang, Bjorn Andersson, Chanwoo Choi,
Frank Li, Geert Uytterhoeven, Krzysztof Kozlowski, Orson Zhai,
Sascha Hauer, Sudeep Holla, 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 rounding is managed by the hardware, and
the determine_rate() clk ops is just a noop that simply returns 0. 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.
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 | 24 +++++++++++++++++++++---
include/linux/clk-provider.h | 2 ++
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index fd418dc988b1c60c49e3ac9c0c44aa132dd5da28..0a522a0817411c7f7c6e9cffd6f024e672a331a8 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1557,6 +1557,20 @@ static int __init clk_disable_unused(void)
}
late_initcall_sync(clk_disable_unused);
+/**
+ * clk_is_rounding_fw_managed - Check to see if clk rounding is handled by the
+ * firmware.
+ * @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 since the
+ * firmware will deal with the rounding.
+ */
+static inline bool clk_is_rounding_fw_managed(struct clk_core *core)
+{
+ return core->flags & CLK_ROUNDING_FW_MANAGED;
+}
+
static int clk_core_determine_round_nolock(struct clk_core *core,
struct clk_rate_request *req)
{
@@ -1589,6 +1603,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_fw_managed(core)) {
+ return 0;
} else {
return -EINVAL;
}
@@ -1673,7 +1689,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_fw_managed(core);
}
static int clk_core_round_rate_nolock(struct clk_core *core,
@@ -3528,6 +3544,7 @@ static const struct {
ENTRY(CLK_IS_CRITICAL),
ENTRY(CLK_OPS_PARENT_ENABLE),
ENTRY(CLK_DUTY_CYCLE_PARENT),
+ ENTRY(CLK_ROUNDING_FW_MANAGED),
#undef ENTRY
};
@@ -3906,7 +3923,7 @@ 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_fw_managed(core)) {
pr_err("%s: %s must implement .determine_rate in addition to .recalc_rate\n",
__func__, core->name);
ret = -EINVAL;
@@ -3920,7 +3937,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_fw_managed(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..187f8248a9c840c701cbbba99bb7cdeef7b654ee 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_FW_MANAGED BIT(14)
struct clk;
struct clk_hw;
--
2.53.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
2026-02-26 18:16 ` [PATCH 01/13] " Brian Masney
@ 2026-02-27 8:16 ` Geert Uytterhoeven
2026-02-27 8:57 ` Biju Das
2026-02-27 12:00 ` Biju Das
` (2 subsequent siblings)
3 siblings, 1 reply; 38+ messages in thread
From: Geert Uytterhoeven @ 2026-02-27 8:16 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
Abel Vesa, Andrea della Porta, Baolin Wang, Bjorn Andersson,
Chanwoo Choi, Frank Li, Geert Uytterhoeven, Krzysztof Kozlowski,
Orson Zhai, Sascha Hauer, Sudeep Holla, 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
Hi Brian,
Thanks for your patch!
On Thu, 26 Feb 2026 at 19:17, Brian Masney <bmasney@redhat.com> wrote:
> There are some clocks where the rounding is managed by the hardware, and
s/hardware/firmware/
You got me totally confused, also/especially in the cover letter! ;-)
> the determine_rate() clk ops is just a noop that simply returns 0. 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.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 38+ messages in thread* RE: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
2026-02-27 8:16 ` Geert Uytterhoeven
@ 2026-02-27 8:57 ` Biju Das
0 siblings, 0 replies; 38+ messages in thread
From: Biju Das @ 2026-02-27 8:57 UTC (permalink / raw)
To: geert, Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, Abel Vesa, Andrea della Porta,
Baolin Wang, Bjorn Andersson, Chanwoo Choi, Frank Li,
Geert Uytterhoeven, Krzysztof Kozlowski, Orson Zhai, Sascha Hauer,
Sudeep Holla, Sylwester Nawrocki, Tudor Ambarus, Alim Akhtar,
arm-scmi@vger.kernel.org, Chunyan Zhang, Cristian Marussi,
Fabio Estevam, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-samsung-soc@vger.kernel.org, Peng Fan,
Pengutronix Kernel Team
Thanks, I will test and provide the feedback.
Cheers,
Biju
> -----Original Message-----
> From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On Behalf Of Geert Uytterhoeven
> Sent: 27 February 2026 08:17
> Subject: Re: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
>
> Hi Brian,
>
> Thanks for your patch!
>
> On Thu, 26 Feb 2026 at 19:17, Brian Masney <bmasney@redhat.com> wrote:
> > There are some clocks where the rounding is managed by the hardware,
> > and
>
> s/hardware/firmware/
>
> You got me totally confused, also/especially in the cover letter! ;-)
>
> > the determine_rate() clk ops is just a noop that simply returns 0. 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.
> >
> > Signed-off-by: Brian Masney <bmasney@redhat.com>
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But when I'm talking to
> journalists I just say "programmer" or something like that.
> -- Linus Torvalds
^ permalink raw reply [flat|nested] 38+ messages in thread
* RE: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
2026-02-26 18:16 ` [PATCH 01/13] " Brian Masney
2026-02-27 8:16 ` Geert Uytterhoeven
@ 2026-02-27 12:00 ` Biju Das
2026-02-27 14:44 ` Brian Masney
2026-02-27 16:38 ` Brian Masney
2026-03-02 11:27 ` Sudeep Holla
3 siblings, 1 reply; 38+ messages in thread
From: Biju Das @ 2026-02-27 12:00 UTC (permalink / raw)
To: Brian Masney, Michael Turquette, Stephen Boyd
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Abel Vesa, Andrea della Porta, Baolin Wang, Bjorn Andersson,
Chanwoo Choi, Frank Li, Geert Uytterhoeven, Krzysztof Kozlowski,
Orson Zhai, Sascha Hauer, Sudeep Holla, Sylwester Nawrocki,
Tudor Ambarus, Alim Akhtar, arm-scmi@vger.kernel.org,
Chunyan Zhang, Cristian Marussi, Fabio Estevam,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-samsung-soc@vger.kernel.org, Peng Fan,
Pengutronix Kernel Team
Hi Brain,
Thanks for the patch
> -----Original Message-----
> From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On Behalf Of Brian Masney
> Sent: 26 February 2026 18:17
> Subject: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
>
> There are some clocks where the rounding is managed by the hardware, and the determine_rate() clk ops
> is just a noop that simply returns 0. 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.
>
> 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 | 24 +++++++++++++++++++++---
> include/linux/clk-provider.h | 2 ++
> 2 files changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index
> fd418dc988b1c60c49e3ac9c0c44aa132dd5da28..0a522a0817411c7f7c6e9cffd6f024e672a331a8 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1557,6 +1557,20 @@ static int __init clk_disable_unused(void) }
> late_initcall_sync(clk_disable_unused);
>
> +/**
> + * clk_is_rounding_fw_managed - Check to see if clk rounding is handled
> +by the
> + * firmware.
> + * @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 since
> +the
> + * firmware will deal with the rounding.
> + */
> +static inline bool clk_is_rounding_fw_managed(struct clk_core *core) {
> + return core->flags & CLK_ROUNDING_FW_MANAGED; }
> +
> static int clk_core_determine_round_nolock(struct clk_core *core,
> struct clk_rate_request *req)
> {
> @@ -1589,6 +1603,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_fw_managed(core)) {
> + return 0;
> } else {
> return -EINVAL;
> }
> @@ -1673,7 +1689,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_fw_managed(core);
> }
>
> static int clk_core_round_rate_nolock(struct clk_core *core, @@ -3528,6 +3544,7 @@ static const
> struct {
> ENTRY(CLK_IS_CRITICAL),
> ENTRY(CLK_OPS_PARENT_ENABLE),
> ENTRY(CLK_DUTY_CYCLE_PARENT),
> + ENTRY(CLK_ROUNDING_FW_MANAGED),
> #undef ENTRY
> };
>
> @@ -3906,7 +3923,7 @@ 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_fw_managed(core)) {
> pr_err("%s: %s must implement .determine_rate in addition to .recalc_rate\n",
> __func__, core->name);
> ret = -EINVAL;
> @@ -3920,7 +3937,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_fw_managed(core)) {
> pr_err("%s: %s must implement .set_parent & .determine_rate\n",
> __func__, core->name);
> ret = -EINVAL;
After applying patch#11, I get a message as you removed .determine_rate, Also it breaks display.
[ 0.096414] __clk_core_init: .pll5_foutpostdiv must implement .round_rate or .determine_rate in addition to .recalc_rate
Cheers,
Biju
^ permalink raw reply [flat|nested] 38+ messages in thread* Re: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
2026-02-27 12:00 ` Biju Das
@ 2026-02-27 14:44 ` Brian Masney
0 siblings, 0 replies; 38+ messages in thread
From: Brian Masney @ 2026-02-27 14:44 UTC (permalink / raw)
To: Biju Das
Cc: Michael Turquette, Stephen Boyd, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, Abel Vesa, Andrea della Porta,
Baolin Wang, Bjorn Andersson, Chanwoo Choi, Frank Li,
Geert Uytterhoeven, Krzysztof Kozlowski, Orson Zhai, Sascha Hauer,
Sudeep Holla, Sylwester Nawrocki, Tudor Ambarus, Alim Akhtar,
arm-scmi@vger.kernel.org, Chunyan Zhang, Cristian Marussi,
Fabio Estevam, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-samsung-soc@vger.kernel.org, Peng Fan,
Pengutronix Kernel Team
On Fri, Feb 27, 2026 at 12:00:55PM +0000, Biju Das wrote:
> > -----Original Message-----
> > From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On Behalf Of Brian Masney
> > Sent: 26 February 2026 18:17
> > Subject: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
> >
> > There are some clocks where the rounding is managed by the hardware, and the determine_rate() clk ops
> > is just a noop that simply returns 0. 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.
> >
> > Signed-off-by: Brian Masney <bmasney@redhat.com>
> >
[snip]
> > drivers/clk/clk.c | 24 +++++++++++++++++++++---
> > include/linux/clk-provider.h | 2 ++
> > 2 files changed, 23 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index
> > fd418dc988b1c60c49e3ac9c0c44aa132dd5da28..0a522a0817411c7f7c6e9cffd6f024e672a331a8 100644
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -1557,6 +1557,20 @@ static int __init clk_disable_unused(void) }
> > late_initcall_sync(clk_disable_unused);
> >
> > +/**
> > + * clk_is_rounding_fw_managed - Check to see if clk rounding is handled
> > +by the
> > + * firmware.
> > + * @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 since
> > +the
> > + * firmware will deal with the rounding.
> > + */
> > +static inline bool clk_is_rounding_fw_managed(struct clk_core *core) {
> > + return core->flags & CLK_ROUNDING_FW_MANAGED; }
> > +
> > static int clk_core_determine_round_nolock(struct clk_core *core,
> > struct clk_rate_request *req)
> > {
> > @@ -1589,6 +1603,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_fw_managed(core)) {
> > + return 0;
> > } else {
> > return -EINVAL;
> > }
> > @@ -1673,7 +1689,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_fw_managed(core);
> > }
> >
> > static int clk_core_round_rate_nolock(struct clk_core *core, @@ -3528,6 +3544,7 @@ static const
> > struct {
> > ENTRY(CLK_IS_CRITICAL),
> > ENTRY(CLK_OPS_PARENT_ENABLE),
> > ENTRY(CLK_DUTY_CYCLE_PARENT),
> > + ENTRY(CLK_ROUNDING_FW_MANAGED),
> > #undef ENTRY
> > };
> >
> > @@ -3906,7 +3923,7 @@ 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_fw_managed(core)) {
> > pr_err("%s: %s must implement .determine_rate in addition to .recalc_rate\n",
> > __func__, core->name);
> > ret = -EINVAL;
> > @@ -3920,7 +3937,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_fw_managed(core)) {
>
> > pr_err("%s: %s must implement .set_parent & .determine_rate\n",
> > __func__, core->name);
> > ret = -EINVAL;
>
>
> After applying patch#11, I get a message as you removed .determine_rate, Also it breaks display.
>
> [ 0.096414] __clk_core_init: .pll5_foutpostdiv must implement .round_rate or .determine_rate in addition to .recalc_rate
Thanks for testing. This happens because rzg2l_cpg_pll_clk_register()
doesn't have the new flag set. I'll fix this, and go through all of the
others again just to make sure I don't miss any others.
Brian
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
2026-02-26 18:16 ` [PATCH 01/13] " Brian Masney
2026-02-27 8:16 ` Geert Uytterhoeven
2026-02-27 12:00 ` Biju Das
@ 2026-02-27 16:38 ` Brian Masney
2026-03-02 11:27 ` Sudeep Holla
3 siblings, 0 replies; 38+ messages in thread
From: Brian Masney @ 2026-02-27 16:38 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Abel Vesa, Andrea della Porta,
Baolin Wang, Bjorn Andersson, Chanwoo Choi, Frank Li,
Geert Uytterhoeven, Krzysztof Kozlowski, Orson Zhai, Sascha Hauer,
Sudeep Holla, 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, Biju Das
On Thu, Feb 26, 2026 at 01:16:45PM -0500, Brian Masney wrote:
> There are some clocks where the rounding is managed by the hardware, and
> the determine_rate() clk ops is just a noop that simply returns 0. 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.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
>
...
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 1cda2c78dffaff037f0f16b0f11106b63b3a746f..187f8248a9c840c701cbbba99bb7cdeef7b654ee 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_FW_MANAGED BIT(14)
Based on a conversation in the Renesas driver change, I think we should
rename this flag to CLK_ROUNDING_NOOP. Let me know if there are any
objections, or suggestions for a better name. I'll let let this sit out
there for about a week or so before sending a v2.
Brian
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
2026-02-26 18:16 ` [PATCH 01/13] " Brian Masney
` (2 preceding siblings ...)
2026-02-27 16:38 ` Brian Masney
@ 2026-03-02 11:27 ` Sudeep Holla
3 siblings, 0 replies; 38+ messages in thread
From: Sudeep Holla @ 2026-03-02 11:27 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, Sudeep Holla,
linux-kernel, 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 Thu, Feb 26, 2026 at 01:16:45PM -0500, Brian Masney wrote:
> There are some clocks where the rounding is managed by the hardware, and
> the determine_rate() clk ops is just a noop that simply returns 0. 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.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
>
Acked-by: Sudeep Holla <sudeep.holla@kernel.org>
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 02/13] clk: test: add test suite for CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
2026-02-26 18:16 ` [PATCH 01/13] " Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-26 18:16 ` [PATCH 03/13] clk: rp1: drop determine_rate op and use " Brian Masney
` (10 subsequent siblings)
12 siblings, 0 replies; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 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_FW_MANAGED 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_FW_MANAGED 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..d7037eadc0a0ddf7559151068775a9d11429c02e 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_FW_MANAGED is set. clk_set_rate() works, and
+ * clk_round_rate() returns the requested rate.
+ */
+static void clk_test_fw_managed_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_fw_managed";
+ init.ops = &clk_no_determine_rate_ops;
+ init.flags = CLK_ROUNDING_FW_MANAGED;
+ 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_fw_managed_test_cases[] = {
+ KUNIT_CASE(clk_test_no_determine_rate_fails),
+ KUNIT_CASE(clk_test_fw_managed_round_rate),
+ {}
+};
+
+/*
+ * Test suite for CLK_ROUNDING_FW_MANAGED flag.
+ */
+static struct kunit_suite clk_fw_managed_test_suite = {
+ .name = "clk_fw_managed_test",
+ .test_cases = clk_fw_managed_test_cases,
+};
kunit_test_suites(
&clk_assigned_rates_suite,
+ &clk_fw_managed_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] 38+ messages in thread* [PATCH 03/13] clk: rp1: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
2026-02-26 18:16 ` [PATCH 01/13] " Brian Masney
2026-02-26 18:16 ` [PATCH 02/13] clk: test: add test suite for CLK_ROUNDING_FW_MANAGED flag Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-03-07 0:06 ` Andrea della Porta
2026-02-26 18:16 ` [PATCH 04/13] clk: scpi: " Brian Masney
` (9 subsequent siblings)
12 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 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_FW_MANAGED flag.
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..acc50e5a7edd409c5f4b99c6f62af9ce06b5a4ee 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_FW_MANAGED
),
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_FW_MANAGED
),
CLK_DATA(rp1_clock_data,
.num_std_parents = 1,
--
2.53.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 04/13] clk: scpi: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (2 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 03/13] clk: rp1: drop determine_rate op and use " Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-03-02 11:26 ` Sudeep Holla
2026-02-26 18:16 ` [PATCH 05/13] clk: hisilicon: hi3660-stub: " Brian Masney
` (8 subsequent siblings)
12 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 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_FW_MANAGED flag.
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..e13f09cfadc70551c3c7955538e5a212fb0601a3 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_FW_MANAGED;
if (sclk->scpi_ops->clk_get_range(sclk->id, &min, &max) || !max)
return -EINVAL;
} else {
--
2.53.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 04/13] clk: scpi: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 ` [PATCH 04/13] clk: scpi: " Brian Masney
@ 2026-03-02 11:26 ` Sudeep Holla
0 siblings, 0 replies; 38+ messages in thread
From: Sudeep Holla @ 2026-03-02 11:26 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Sudeep Holla, Stephen Boyd, linux-clk,
linux-kernel, Cristian Marussi, arm-scmi, linux-arm-kernel
On Thu, Feb 26, 2026 at 01:16:48PM -0500, Brian Masney wrote:
> This clk driver has a noop determine_rate clk op. Drop this empty
> function, and enable the CLK_ROUNDING_FW_MANAGED flag.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
>
Reviewed-by: Sudeep Holla <sudeep.holla@kernel.org>
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 05/13] clk: hisilicon: hi3660-stub: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (3 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 04/13] clk: scpi: " Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-26 18:16 ` [PATCH 06/13] clk: imx: scu: drop redundant init.ops variable assignment Brian Masney
` (7 subsequent siblings)
12 siblings, 0 replies; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 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_FW_MANAGED 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..839660d26b08b6301ac909ebcaab56f569cdaff2 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_FW_MANAGED, \
}, \
}
@@ -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] 38+ messages in thread* [PATCH 06/13] clk: imx: scu: drop redundant init.ops variable assignment
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (4 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 05/13] clk: hisilicon: hi3660-stub: " Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-27 2:02 ` Peng Fan
2026-02-26 18:16 ` [PATCH 07/13] clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag Brian Masney
` (6 subsequent siblings)
12 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Brian Masney, Abel Vesa, Frank Li,
Sascha Hauer, Peng Fan, 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")
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] 38+ messages in thread* Re: [PATCH 06/13] clk: imx: scu: drop redundant init.ops variable assignment
2026-02-26 18:16 ` [PATCH 06/13] clk: imx: scu: drop redundant init.ops variable assignment Brian Masney
@ 2026-02-27 2:02 ` Peng Fan
0 siblings, 0 replies; 38+ messages in thread
From: Peng Fan @ 2026-02-27 2:02 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
Abel Vesa, Frank Li, Sascha Hauer, Peng Fan,
Pengutronix Kernel Team, Fabio Estevam, imx, linux-arm-kernel
On Thu, Feb 26, 2026 at 01:16:50PM -0500, Brian Masney wrote:
>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")
>Signed-off-by: Brian Masney <bmasney@redhat.com>
>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 07/13] clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (5 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 06/13] clk: imx: scu: drop redundant init.ops variable assignment Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-27 2:04 ` Peng Fan
2026-02-26 18:16 ` [PATCH 08/13] clk: qcom: rpm: " Brian Masney
` (5 subsequent siblings)
12 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Brian Masney, Abel Vesa, Frank Li,
Sascha Hauer, Peng Fan, 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_FW_MANAGED flag.
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..db8e5773140a7f5fcb3b36f372e22f43675ee6ad 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_FW_MANAGED;
clk->hw.init = &init;
hw = &clk->hw;
--
2.53.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 07/13] clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 ` [PATCH 07/13] clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag Brian Masney
@ 2026-02-27 2:04 ` Peng Fan
0 siblings, 0 replies; 38+ messages in thread
From: Peng Fan @ 2026-02-27 2:04 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
Abel Vesa, Frank Li, Sascha Hauer, Peng Fan,
Pengutronix Kernel Team, Fabio Estevam, imx, linux-arm-kernel
On Thu, Feb 26, 2026 at 01:16:51PM -0500, Brian Masney wrote:
>This clk driver has a noop determine_rate clk op. Drop this empty
>function, and enable the CLK_ROUNDING_FW_MANAGED flag.
>
>Signed-off-by: Brian Masney <bmasney@redhat.com>
>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 08/13] clk: qcom: rpm: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (6 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 07/13] clk: imx: scu: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-27 0:07 ` Dmitry Baryshkov
2026-02-26 18:16 ` [PATCH 09/13] clk: qcom: rpmh: " Brian Masney
` (4 subsequent siblings)
12 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Brian Masney, Bjorn Andersson,
linux-arm-msm
This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_FW_MANAGED flag.
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..7875cd1815f524572f630242e3b71ff0810cdeda 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_FW_MANAGED, \
}, \
}; \
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_FW_MANAGED, \
}, \
}
@@ -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_FW_MANAGED, \
}, \
}
@@ -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] 38+ messages in thread* Re: [PATCH 08/13] clk: qcom: rpm: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 ` [PATCH 08/13] clk: qcom: rpm: " Brian Masney
@ 2026-02-27 0:07 ` Dmitry Baryshkov
0 siblings, 0 replies; 38+ messages in thread
From: Dmitry Baryshkov @ 2026-02-27 0:07 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
Bjorn Andersson, linux-arm-msm
On Thu, Feb 26, 2026 at 01:16:52PM -0500, Brian Masney wrote:
> This clk driver has a noop determine_rate clk op. Drop this empty
> function, and enable the CLK_ROUNDING_FW_MANAGED flag.
>
> 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(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 09/13] clk: qcom: rpmh: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (7 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 08/13] clk: qcom: rpm: " Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-27 0:12 ` Dmitry Baryshkov
2026-02-26 18:16 ` [PATCH 10/13] clk: qcom: smd-rpm: " Brian Masney
` (3 subsequent siblings)
12 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Brian Masney, Bjorn Andersson,
linux-arm-msm
This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_FW_MANAGED flag.
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..18fc94e6b98713e6aaf20a6d6144234f435d07a4 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_FW_MANAGED, \
}, \
}
@@ -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] 38+ messages in thread* Re: [PATCH 09/13] clk: qcom: rpmh: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 ` [PATCH 09/13] clk: qcom: rpmh: " Brian Masney
@ 2026-02-27 0:12 ` Dmitry Baryshkov
0 siblings, 0 replies; 38+ messages in thread
From: Dmitry Baryshkov @ 2026-02-27 0:12 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
Bjorn Andersson, linux-arm-msm
On Thu, Feb 26, 2026 at 01:16:53PM -0500, Brian Masney wrote:
> This clk driver has a noop determine_rate clk op. Drop this empty
> function, and enable the CLK_ROUNDING_FW_MANAGED flag.
>
> 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(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 10/13] clk: qcom: smd-rpm: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (8 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 09/13] clk: qcom: rpmh: " Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-27 0:13 ` Dmitry Baryshkov
2026-02-26 18:16 ` [PATCH 11/13] clk: renesas: rzg2l-cpg: " Brian Masney
` (2 subsequent siblings)
12 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Brian Masney, Bjorn Andersson,
linux-arm-msm
This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_FW_MANAGED flag.
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..96af781195a23d8b56e2b977811a3304a452e1cb 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_FW_MANAGED, \
}, \
}; \
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_FW_MANAGED | (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] 38+ messages in thread* Re: [PATCH 10/13] clk: qcom: smd-rpm: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 ` [PATCH 10/13] clk: qcom: smd-rpm: " Brian Masney
@ 2026-02-27 0:13 ` Dmitry Baryshkov
0 siblings, 0 replies; 38+ messages in thread
From: Dmitry Baryshkov @ 2026-02-27 0:13 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
Bjorn Andersson, linux-arm-msm
On Thu, Feb 26, 2026 at 01:16:54PM -0500, Brian Masney wrote:
> This clk driver has a noop determine_rate clk op. Drop this empty
> function, and enable the CLK_ROUNDING_FW_MANAGED flag.
>
> 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(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (9 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 10/13] clk: qcom: smd-rpm: " Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-27 8:20 ` Geert Uytterhoeven
2026-02-26 18:16 ` [PATCH 12/13] clk: samsung: acpm: " Brian Masney
2026-02-26 18:16 ` [PATCH 13/13] clk: sprd: " Brian Masney
12 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Brian Masney, Geert Uytterhoeven,
linux-renesas-soc
This clk driver has a noop determine_rate clk op. Drop this empty
function, and enable the CLK_ROUNDING_FW_MANAGED flag.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Geert Uytterhoeven <geert+renesas@glider.be>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/clk/renesas/rzg2l-cpg.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
index c0584bab58a3ba8a637e77662191f89a57bf1390..126398267e60d1f0fa7ababcb22a5c540884e810 100644
--- a/drivers/clk/renesas/rzg2l-cpg.c
+++ b/drivers/clk/renesas/rzg2l-cpg.c
@@ -938,12 +938,6 @@ static unsigned long rzg2l_cpg_sipll5_recalc_rate(struct clk_hw *hw,
return pll5_rate;
}
-static int rzg2l_cpg_sipll5_determine_rate(struct clk_hw *hw,
- struct clk_rate_request *req)
-{
- return 0;
-}
-
static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
unsigned long rate,
unsigned long parent_rate)
@@ -1015,7 +1009,6 @@ static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
static const struct clk_ops rzg2l_cpg_sipll5_ops = {
.recalc_rate = rzg2l_cpg_sipll5_recalc_rate,
- .determine_rate = rzg2l_cpg_sipll5_determine_rate,
.set_rate = rzg2l_cpg_sipll5_set_rate,
};
@@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
init.name = core->name;
parent_name = __clk_get_name(parent);
init.ops = &rzg2l_cpg_sipll5_ops;
- init.flags = 0;
+ init.flags = CLK_ROUNDING_FW_MANAGED;
init.parent_names = &parent_name;
init.num_parents = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 ` [PATCH 11/13] clk: renesas: rzg2l-cpg: " Brian Masney
@ 2026-02-27 8:20 ` Geert Uytterhoeven
2026-02-27 14:46 ` Brian Masney
2026-02-27 15:01 ` Brian Masney
0 siblings, 2 replies; 38+ messages in thread
From: Geert Uytterhoeven @ 2026-02-27 8:20 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
linux-renesas-soc, Biju Das
Hi Brian,
C Biju
On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> This clk driver has a noop determine_rate clk op. Drop this empty
> function, and enable the CLK_ROUNDING_FW_MANAGED flag.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
Thanks for your patch!
> --- a/drivers/clk/renesas/rzg2l-cpg.c
> +++ b/drivers/clk/renesas/rzg2l-cpg.c
> @@ -938,12 +938,6 @@ static unsigned long rzg2l_cpg_sipll5_recalc_rate(struct clk_hw *hw,
> return pll5_rate;
> }
>
> -static int rzg2l_cpg_sipll5_determine_rate(struct clk_hw *hw,
> - struct clk_rate_request *req)
> -{
> - return 0;
> -}
> -
> static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
> unsigned long rate,
> unsigned long parent_rate)
> @@ -1015,7 +1009,6 @@ static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
>
> static const struct clk_ops rzg2l_cpg_sipll5_ops = {
> .recalc_rate = rzg2l_cpg_sipll5_recalc_rate,
> - .determine_rate = rzg2l_cpg_sipll5_determine_rate,
> .set_rate = rzg2l_cpg_sipll5_set_rate,
> };
>
> @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> init.name = core->name;
> parent_name = __clk_get_name(parent);
> init.ops = &rzg2l_cpg_sipll5_ops;
> - init.flags = 0;
> + init.flags = CLK_ROUNDING_FW_MANAGED;
Iff this is the Right Thing To Do (TM), it needs a comment, as this
clock is not managed by firmware.
> init.parent_names = &parent_name;
> init.num_parents = 1;
>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 38+ messages in thread* Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-27 8:20 ` Geert Uytterhoeven
@ 2026-02-27 14:46 ` Brian Masney
2026-02-27 15:01 ` Brian Masney
1 sibling, 0 replies; 38+ messages in thread
From: Brian Masney @ 2026-02-27 14:46 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
linux-renesas-soc, Biju Das
On Fri, Feb 27, 2026 at 09:20:09AM +0100, Geert Uytterhoeven wrote:
> On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> > This clk driver has a noop determine_rate clk op. Drop this empty
> > function, and enable the CLK_ROUNDING_FW_MANAGED flag.
> >
> > Signed-off-by: Brian Masney <bmasney@redhat.com>
>
> Thanks for your patch!
>
> > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > @@ -938,12 +938,6 @@ static unsigned long rzg2l_cpg_sipll5_recalc_rate(struct clk_hw *hw,
> > return pll5_rate;
> > }
> >
> > -static int rzg2l_cpg_sipll5_determine_rate(struct clk_hw *hw,
> > - struct clk_rate_request *req)
> > -{
> > - return 0;
> > -}
> > -
> > static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
> > unsigned long rate,
> > unsigned long parent_rate)
> > @@ -1015,7 +1009,6 @@ static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
> >
> > static const struct clk_ops rzg2l_cpg_sipll5_ops = {
> > .recalc_rate = rzg2l_cpg_sipll5_recalc_rate,
> > - .determine_rate = rzg2l_cpg_sipll5_determine_rate,
> > .set_rate = rzg2l_cpg_sipll5_set_rate,
> > };
> >
> > @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> > init.name = core->name;
> > parent_name = __clk_get_name(parent);
> > init.ops = &rzg2l_cpg_sipll5_ops;
> > - init.flags = 0;
> > + init.flags = CLK_ROUNDING_FW_MANAGED;
>
> Iff this is the Right Thing To Do (TM), it needs a comment, as this
> clock is not managed by firmware.
It needs a better name for the flag. I'll reply on patch 1 where more
people are CCed to see if we can come up with a better idea.
Brian
^ permalink raw reply [flat|nested] 38+ messages in thread* Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-27 8:20 ` Geert Uytterhoeven
2026-02-27 14:46 ` Brian Masney
@ 2026-02-27 15:01 ` Brian Masney
2026-02-27 15:09 ` Geert Uytterhoeven
1 sibling, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-27 15:01 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
linux-renesas-soc, Biju Das
Hi Geert,
On Fri, Feb 27, 2026 at 09:20:09AM +0100, Geert Uytterhoeven wrote:
> On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> > This clk driver has a noop determine_rate clk op. Drop this empty
> > function, and enable the CLK_ROUNDING_FW_MANAGED flag.
> >
> > Signed-off-by: Brian Masney <bmasney@redhat.com>
>
> Thanks for your patch!
>
> > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > @@ -938,12 +938,6 @@ static unsigned long rzg2l_cpg_sipll5_recalc_rate(struct clk_hw *hw,
> > return pll5_rate;
> > }
> >
> > -static int rzg2l_cpg_sipll5_determine_rate(struct clk_hw *hw,
> > - struct clk_rate_request *req)
> > -{
> > - return 0;
> > -}
> > -
> > static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
> > unsigned long rate,
> > unsigned long parent_rate)
> > @@ -1015,7 +1009,6 @@ static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
> >
> > static const struct clk_ops rzg2l_cpg_sipll5_ops = {
> > .recalc_rate = rzg2l_cpg_sipll5_recalc_rate,
> > - .determine_rate = rzg2l_cpg_sipll5_determine_rate,
> > .set_rate = rzg2l_cpg_sipll5_set_rate,
> > };
> >
> > @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> > init.name = core->name;
> > parent_name = __clk_get_name(parent);
> > init.ops = &rzg2l_cpg_sipll5_ops;
> > - init.flags = 0;
> > + init.flags = CLK_ROUNDING_FW_MANAGED;
>
> Iff this is the Right Thing To Do (TM), it needs a comment, as this
> clock is not managed by firmware.
Before I start a larger discussion on patch 1 with more people about a
name for this flag, help me understand why this provider has a noop
determine rate. Is the hardware eventually programmed with a rate
that's close enough to what was passed in? Or it doesn't really matter
what the clock rate is, just as long as it is running? Or should the
determine_rate function be filled out in this particular case?
Thanks,
Brian
^ permalink raw reply [flat|nested] 38+ messages in thread* Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-27 15:01 ` Brian Masney
@ 2026-02-27 15:09 ` Geert Uytterhoeven
2026-02-27 15:23 ` Biju Das
0 siblings, 1 reply; 38+ messages in thread
From: Geert Uytterhoeven @ 2026-02-27 15:09 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
linux-renesas-soc, Biju Das
Hi Brian,
On Fri, 27 Feb 2026 at 16:01, Brian Masney <bmasney@redhat.com> wrote:
> On Fri, Feb 27, 2026 at 09:20:09AM +0100, Geert Uytterhoeven wrote:
> > On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> > > This clk driver has a noop determine_rate clk op. Drop this empty
> > > function, and enable the CLK_ROUNDING_FW_MANAGED flag.
> > >
> > > Signed-off-by: Brian Masney <bmasney@redhat.com>
> >
> > Thanks for your patch!
> >
> > > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > > @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> > > init.name = core->name;
> > > parent_name = __clk_get_name(parent);
> > > init.ops = &rzg2l_cpg_sipll5_ops;
> > > - init.flags = 0;
> > > + init.flags = CLK_ROUNDING_FW_MANAGED;
> >
> > Iff this is the Right Thing To Do (TM), it needs a comment, as this
> > clock is not managed by firmware.
>
> Before I start a larger discussion on patch 1 with more people about a
> name for this flag, help me understand why this provider has a noop
> determine rate. Is the hardware eventually programmed with a rate
> that's close enough to what was passed in? Or it doesn't really matter
> what the clock rate is, just as long as it is running? Or should the
> determine_rate function be filled out in this particular case?
I'd like to defer to Biju, who added the empty round^Wdetermine rate
function.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 38+ messages in thread* RE: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-27 15:09 ` Geert Uytterhoeven
@ 2026-02-27 15:23 ` Biju Das
2026-02-27 15:48 ` Brian Masney
0 siblings, 1 reply; 38+ messages in thread
From: Biju Das @ 2026-02-27 15:23 UTC (permalink / raw)
To: geert, Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Hi Brian/Geert,
> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 27 February 2026 15:09
> Subject: Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use
> CLK_ROUNDING_FW_MANAGED flag
>
> Hi Brian,
>
> On Fri, 27 Feb 2026 at 16:01, Brian Masney <bmasney@redhat.com> wrote:
> > On Fri, Feb 27, 2026 at 09:20:09AM +0100, Geert Uytterhoeven wrote:
> > > On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> > > > This clk driver has a noop determine_rate clk op. Drop this empty
> > > > function, and enable the CLK_ROUNDING_FW_MANAGED flag.
> > > >
> > > > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > >
> > > Thanks for your patch!
> > >
> > > > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > > > +++ b/drivers/clk/renesas/rzg2l-cpg.c
>
> > > > @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> > > > init.name = core->name;
> > > > parent_name = __clk_get_name(parent);
> > > > init.ops = &rzg2l_cpg_sipll5_ops;
> > > > - init.flags = 0;
> > > > + init.flags = CLK_ROUNDING_FW_MANAGED;
> > >
> > > Iff this is the Right Thing To Do (TM), it needs a comment, as this
> > > clock is not managed by firmware.
> >
> > Before I start a larger discussion on patch 1 with more people about a
> > name for this flag, help me understand why this provider has a noop
> > determine rate. Is the hardware eventually programmed with a rate
> > that's close enough to what was passed in? Or it doesn't really matter
> > what the clock rate is, just as long as it is running? Or should the
> > determine_rate function be filled out in this particular case?
>
> I'd like to defer to Biju, who added the empty round^Wdetermine rate function.
PLL is capable of generating any frequency. that is the reason.
But we could, call rzg2l_cpg_get_foutpostdiv_rate() from determine_rate()
as modified rzg2l_cpg_get_foutpostdiv_rate()[1] can return errors
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/clk/renesas/rzg2l-cpg.c?h=next-20260227#n590
Cheers,
Biju
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-27 15:23 ` Biju Das
@ 2026-02-27 15:48 ` Brian Masney
2026-02-27 15:57 ` Biju Das
0 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-27 15:48 UTC (permalink / raw)
To: Biju Das
Cc: geert, Michael Turquette, Stephen Boyd, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Hi Biju,
On Fri, Feb 27, 2026 at 03:23:19PM +0000, Biju Das wrote:
> > -----Original Message-----
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > Sent: 27 February 2026 15:09
> > Subject: Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use
> > CLK_ROUNDING_FW_MANAGED flag
> >
> > On Fri, 27 Feb 2026 at 16:01, Brian Masney <bmasney@redhat.com> wrote:
> > > On Fri, Feb 27, 2026 at 09:20:09AM +0100, Geert Uytterhoeven wrote:
> > > > On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> > > > > This clk driver has a noop determine_rate clk op. Drop this empty
> > > > > function, and enable the CLK_ROUNDING_FW_MANAGED flag.
> > > > >
> > > > > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > > >
> > > > Thanks for your patch!
> > > >
> > > > > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > > > > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> >
> > > > > @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> > > > > init.name = core->name;
> > > > > parent_name = __clk_get_name(parent);
> > > > > init.ops = &rzg2l_cpg_sipll5_ops;
> > > > > - init.flags = 0;
> > > > > + init.flags = CLK_ROUNDING_FW_MANAGED;
> > > >
> > > > Iff this is the Right Thing To Do (TM), it needs a comment, as this
> > > > clock is not managed by firmware.
> > >
> > > Before I start a larger discussion on patch 1 with more people about a
> > > name for this flag, help me understand why this provider has a noop
> > > determine rate. Is the hardware eventually programmed with a rate
> > > that's close enough to what was passed in? Or it doesn't really matter
> > > what the clock rate is, just as long as it is running? Or should the
> > > determine_rate function be filled out in this particular case?
> >
> > I'd like to defer to Biju, who added the empty round^Wdetermine rate function.
>
> PLL is capable of generating any frequency. that is the reason.
>
> But we could, call rzg2l_cpg_get_foutpostdiv_rate() from determine_rate()
> as modified rzg2l_cpg_get_foutpostdiv_rate()[1] can return errors
>
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/clk/renesas/rzg2l-cpg.c?h=next-20260227#n590
OK. So how do you all want to proceed here?
Do you want to fill out the determine rate in this driver? If so, we can
just drop this particular patch from this series.
Since the PLL is capable of any frequency, do you want to keep the empty
determine rate functionality? If so, we could use a different name for
this flag. Maybe CLK_ROUNDING_NOOP?
Brian
^ permalink raw reply [flat|nested] 38+ messages in thread
* RE: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-27 15:48 ` Brian Masney
@ 2026-02-27 15:57 ` Biju Das
2026-02-27 16:01 ` Brian Masney
2026-02-27 16:01 ` Geert Uytterhoeven
0 siblings, 2 replies; 38+ messages in thread
From: Biju Das @ 2026-02-27 15:57 UTC (permalink / raw)
To: Brian Masney, Chris Brandt
Cc: geert, Michael Turquette, Stephen Boyd, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Hi Brian,
> -----Original Message-----
> From: Brian Masney <bmasney@redhat.com>
> Sent: 27 February 2026 15:48
> Subject: Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use
> CLK_ROUNDING_FW_MANAGED flag
>
> Hi Biju,
>
> On Fri, Feb 27, 2026 at 03:23:19PM +0000, Biju Das wrote:
> > > -----Original Message-----
> > > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > > Sent: 27 February 2026 15:09
> > > Subject: Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop
> > > determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
> > >
> > > On Fri, 27 Feb 2026 at 16:01, Brian Masney <bmasney@redhat.com> wrote:
> > > > On Fri, Feb 27, 2026 at 09:20:09AM +0100, Geert Uytterhoeven wrote:
> > > > > On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> > > > > > This clk driver has a noop determine_rate clk op. Drop this
> > > > > > empty function, and enable the CLK_ROUNDING_FW_MANAGED flag.
> > > > > >
> > > > > > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > > > >
> > > > > Thanks for your patch!
> > > > >
> > > > > > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > > > > > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > >
> > > > > > @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> > > > > > init.name = core->name;
> > > > > > parent_name = __clk_get_name(parent);
> > > > > > init.ops = &rzg2l_cpg_sipll5_ops;
> > > > > > - init.flags = 0;
> > > > > > + init.flags = CLK_ROUNDING_FW_MANAGED;
> > > > >
> > > > > Iff this is the Right Thing To Do (TM), it needs a comment, as
> > > > > this clock is not managed by firmware.
> > > >
> > > > Before I start a larger discussion on patch 1 with more people
> > > > about a name for this flag, help me understand why this provider
> > > > has a noop determine rate. Is the hardware eventually programmed
> > > > with a rate that's close enough to what was passed in? Or it
> > > > doesn't really matter what the clock rate is, just as long as it
> > > > is running? Or should the determine_rate function be filled out in this particular case?
> > >
> > > I'd like to defer to Biju, who added the empty round^Wdetermine rate function.
> >
> > PLL is capable of generating any frequency. that is the reason.
> >
> > But we could, call rzg2l_cpg_get_foutpostdiv_rate() from
> > determine_rate() as modified rzg2l_cpg_get_foutpostdiv_rate()[1] can
> > return errors
> >
> > [1]
> > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tr
> > ee/drivers/clk/renesas/rzg2l-cpg.c?h=next-20260227#n590
>
> OK. So how do you all want to proceed here?
>
> Do you want to fill out the determine rate in this driver? If so, we can just drop this particular
> patch from this series.
We plan to fill out the determine rate later, as it can return error.
>
> Since the PLL is capable of any frequency, do you want to keep the empty determine rate functionality?
> If so, we could use a different name for this flag. Maybe CLK_ROUNDING_NOOP?
I guess, maybe we could use CLK_ROUNDING_NOOP, till we have proper .determine_rate() for this driver???
Cheers,
Biju
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-27 15:57 ` Biju Das
@ 2026-02-27 16:01 ` Brian Masney
2026-02-27 16:01 ` Geert Uytterhoeven
1 sibling, 0 replies; 38+ messages in thread
From: Brian Masney @ 2026-02-27 16:01 UTC (permalink / raw)
To: Biju Das
Cc: Chris Brandt, geert, Michael Turquette, Stephen Boyd,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org
On Fri, Feb 27, 2026 at 03:57:28PM +0000, Biju Das wrote:
> > -----Original Message-----
> > From: Brian Masney <bmasney@redhat.com>
> > Sent: 27 February 2026 15:48
> > Subject: Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use
> > CLK_ROUNDING_FW_MANAGED flag
> >
> > Hi Biju,
> >
> > On Fri, Feb 27, 2026 at 03:23:19PM +0000, Biju Das wrote:
> > > > -----Original Message-----
> > > > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > > > Sent: 27 February 2026 15:09
> > > > Subject: Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop
> > > > determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
> > > >
> > > > On Fri, 27 Feb 2026 at 16:01, Brian Masney <bmasney@redhat.com> wrote:
> > > > > On Fri, Feb 27, 2026 at 09:20:09AM +0100, Geert Uytterhoeven wrote:
> > > > > > On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> > > > > > > This clk driver has a noop determine_rate clk op. Drop this
> > > > > > > empty function, and enable the CLK_ROUNDING_FW_MANAGED flag.
> > > > > > >
> > > > > > > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > > > > >
> > > > > > Thanks for your patch!
> > > > > >
> > > > > > > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > > > > > > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > > >
> > > > > > > @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> > > > > > > init.name = core->name;
> > > > > > > parent_name = __clk_get_name(parent);
> > > > > > > init.ops = &rzg2l_cpg_sipll5_ops;
> > > > > > > - init.flags = 0;
> > > > > > > + init.flags = CLK_ROUNDING_FW_MANAGED;
> > > > > >
> > > > > > Iff this is the Right Thing To Do (TM), it needs a comment, as
> > > > > > this clock is not managed by firmware.
> > > > >
> > > > > Before I start a larger discussion on patch 1 with more people
> > > > > about a name for this flag, help me understand why this provider
> > > > > has a noop determine rate. Is the hardware eventually programmed
> > > > > with a rate that's close enough to what was passed in? Or it
> > > > > doesn't really matter what the clock rate is, just as long as it
> > > > > is running? Or should the determine_rate function be filled out in this particular case?
> > > >
> > > > I'd like to defer to Biju, who added the empty round^Wdetermine rate function.
> > >
> > > PLL is capable of generating any frequency. that is the reason.
> > >
> > > But we could, call rzg2l_cpg_get_foutpostdiv_rate() from
> > > determine_rate() as modified rzg2l_cpg_get_foutpostdiv_rate()[1] can
> > > return errors
> > >
> > > [1]
> > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tr
> > > ee/drivers/clk/renesas/rzg2l-cpg.c?h=next-20260227#n590
> >
> > OK. So how do you all want to proceed here?
> >
> > Do you want to fill out the determine rate in this driver? If so, we can just drop this particular
> > patch from this series.
>
> We plan to fill out the determine rate later, as it can return error.
OK, if you are planning to fill out the determine rate, then I'll just
skip over this driver to avoid the code churn.
Brian
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-27 15:57 ` Biju Das
2026-02-27 16:01 ` Brian Masney
@ 2026-02-27 16:01 ` Geert Uytterhoeven
2026-02-27 16:04 ` Biju Das
1 sibling, 1 reply; 38+ messages in thread
From: Geert Uytterhoeven @ 2026-02-27 16:01 UTC (permalink / raw)
To: Biju Das
Cc: Brian Masney, Chris Brandt, Michael Turquette, Stephen Boyd,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org
Hi Biju,
On Fri, 27 Feb 2026 at 16:57, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > From: Brian Masney <bmasney@redhat.com>
> > On Fri, Feb 27, 2026 at 03:23:19PM +0000, Biju Das wrote:
> > > > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > > > On Fri, 27 Feb 2026 at 16:01, Brian Masney <bmasney@redhat.com> wrote:
> > > > > On Fri, Feb 27, 2026 at 09:20:09AM +0100, Geert Uytterhoeven wrote:
> > > > > > On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> > > > > > > This clk driver has a noop determine_rate clk op. Drop this
> > > > > > > empty function, and enable the CLK_ROUNDING_FW_MANAGED flag.
> > > > > > >
> > > > > > > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > > > > >
> > > > > > Thanks for your patch!
> > > > > >
> > > > > > > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > > > > > > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > > >
> > > > > > > @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> > > > > > > init.name = core->name;
> > > > > > > parent_name = __clk_get_name(parent);
> > > > > > > init.ops = &rzg2l_cpg_sipll5_ops;
> > > > > > > - init.flags = 0;
> > > > > > > + init.flags = CLK_ROUNDING_FW_MANAGED;
> > > > > >
> > > > > > Iff this is the Right Thing To Do (TM), it needs a comment, as
> > > > > > this clock is not managed by firmware.
> > > > >
> > > > > Before I start a larger discussion on patch 1 with more people
> > > > > about a name for this flag, help me understand why this provider
> > > > > has a noop determine rate. Is the hardware eventually programmed
> > > > > with a rate that's close enough to what was passed in? Or it
> > > > > doesn't really matter what the clock rate is, just as long as it
> > > > > is running? Or should the determine_rate function be filled out in this particular case?
> > > >
> > > > I'd like to defer to Biju, who added the empty round^Wdetermine rate function.
> > >
> > > PLL is capable of generating any frequency. that is the reason.
> > >
> > > But we could, call rzg2l_cpg_get_foutpostdiv_rate() from
> > > determine_rate() as modified rzg2l_cpg_get_foutpostdiv_rate()[1] can
> > > return errors
> > >
> > > [1]
> > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tr
> > > ee/drivers/clk/renesas/rzg2l-cpg.c?h=next-20260227#n590
> >
> > OK. So how do you all want to proceed here?
> >
> > Do you want to fill out the determine rate in this driver? If so, we can just drop this particular
> > patch from this series.
>
> We plan to fill out the determine rate later, as it can return error.
>
> >
> > Since the PLL is capable of any frequency, do you want to keep the empty determine rate functionality?
> > If so, we could use a different name for this flag. Maybe CLK_ROUNDING_NOOP?
>
> I guess, maybe we could use CLK_ROUNDING_NOOP, till we have proper .determine_rate() for this driver???
Just keeping the empty function should work, too, right?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 38+ messages in thread* RE: [PATCH 11/13] clk: renesas: rzg2l-cpg: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-27 16:01 ` Geert Uytterhoeven
@ 2026-02-27 16:04 ` Biju Das
0 siblings, 0 replies; 38+ messages in thread
From: Biju Das @ 2026-02-27 16:04 UTC (permalink / raw)
To: geert
Cc: Brian Masney, Chris Brandt, Michael Turquette, Stephen Boyd,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org
Hi Geert,
> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 27 February 2026 16:01
>
> Hi Biju,
>
> On Fri, 27 Feb 2026 at 16:57, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > From: Brian Masney <bmasney@redhat.com> On Fri, Feb 27, 2026 at
> > > 03:23:19PM +0000, Biju Das wrote:
> > > > > From: Geert Uytterhoeven <geert@linux-m68k.org> On Fri, 27 Feb
> > > > > 2026 at 16:01, Brian Masney <bmasney@redhat.com> wrote:
> > > > > > On Fri, Feb 27, 2026 at 09:20:09AM +0100, Geert Uytterhoeven wrote:
> > > > > > > On Thu, 26 Feb 2026 at 19:18, Brian Masney <bmasney@redhat.com> wrote:
> > > > > > > > This clk driver has a noop determine_rate clk op. Drop
> > > > > > > > this empty function, and enable the CLK_ROUNDING_FW_MANAGED flag.
> > > > > > > >
> > > > > > > > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > > > > > >
> > > > > > > Thanks for your patch!
> > > > > > >
> > > > > > > > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > > > > > > > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > > > >
> > > > > > > > @@ -1041,7 +1034,7 @@ rzg2l_cpg_sipll5_register(const struct cpg_core_clk *core,
> > > > > > > > init.name = core->name;
> > > > > > > > parent_name = __clk_get_name(parent);
> > > > > > > > init.ops = &rzg2l_cpg_sipll5_ops;
> > > > > > > > - init.flags = 0;
> > > > > > > > + init.flags = CLK_ROUNDING_FW_MANAGED;
> > > > > > >
> > > > > > > Iff this is the Right Thing To Do (TM), it needs a comment,
> > > > > > > as this clock is not managed by firmware.
> > > > > >
> > > > > > Before I start a larger discussion on patch 1 with more people
> > > > > > about a name for this flag, help me understand why this
> > > > > > provider has a noop determine rate. Is the hardware eventually
> > > > > > programmed with a rate that's close enough to what was passed
> > > > > > in? Or it doesn't really matter what the clock rate is, just
> > > > > > as long as it is running? Or should the determine_rate function be filled out in this
> particular case?
> > > > >
> > > > > I'd like to defer to Biju, who added the empty round^Wdetermine rate function.
> > > >
> > > > PLL is capable of generating any frequency. that is the reason.
> > > >
> > > > But we could, call rzg2l_cpg_get_foutpostdiv_rate() from
> > > > determine_rate() as modified rzg2l_cpg_get_foutpostdiv_rate()[1]
> > > > can return errors
> > > >
> > > > [1]
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gi
> > > > t/tr
> > > > ee/drivers/clk/renesas/rzg2l-cpg.c?h=next-20260227#n590
> > >
> > > OK. So how do you all want to proceed here?
> > >
> > > Do you want to fill out the determine rate in this driver? If so, we
> > > can just drop this particular patch from this series.
> >
> > We plan to fill out the determine rate later, as it can return error.
> >
> > >
> > > Since the PLL is capable of any frequency, do you want to keep the empty determine rate
> functionality?
> > > If so, we could use a different name for this flag. Maybe CLK_ROUNDING_NOOP?
> >
> > I guess, maybe we could use CLK_ROUNDING_NOOP, till we have proper .determine_rate() for this
> driver???
>
> Just keeping the empty function should work, too, right?
Yes, it will work.
Cheers,
Biju
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 12/13] clk: samsung: acpm: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (10 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 11/13] clk: renesas: rzg2l-cpg: " Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
2026-02-28 13:31 ` Krzysztof Kozlowski
2026-02-26 18:16 ` [PATCH 13/13] clk: sprd: " Brian Masney
12 siblings, 1 reply; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Brian Masney, 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_FW_MANAGED flag.
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..e2dffbfcdf221e31a4302074475a42481d6a829b 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_FW_MANAGED;
aclk->hw.init = &init;
return devm_clk_hw_register(dev, &aclk->hw);
--
2.53.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 12/13] clk: samsung: acpm: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 ` [PATCH 12/13] clk: samsung: acpm: " Brian Masney
@ 2026-02-28 13:31 ` Krzysztof Kozlowski
0 siblings, 0 replies; 38+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-28 13:31 UTC (permalink / raw)
To: Brian Masney, Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Tudor Ambarus, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, linux-samsung-soc
On 26/02/2026 19:16, Brian Masney wrote:
> This clk driver has a noop determine_rate clk op. Drop this empty
> function, and enable the CLK_ROUNDING_FW_MANAGED flag.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
>
>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 13/13] clk: sprd: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag
2026-02-26 18:16 [PATCH 00/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Brian Masney
` (11 preceding siblings ...)
2026-02-26 18:16 ` [PATCH 12/13] clk: samsung: acpm: " Brian Masney
@ 2026-02-26 18:16 ` Brian Masney
12 siblings, 0 replies; 38+ messages in thread
From: Brian Masney @ 2026-02-26 18:16 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_FW_MANAGED 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..b35f3e13799e93cff9cb184f5a54f862a6756f0f 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_FW_MANAGED), \
}, \
}
--
2.53.0
^ permalink raw reply related [flat|nested] 38+ messages in thread