Linux-Samsung-soc Archive mirror
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Brian Masney <bmasney@redhat.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: "linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Abel Vesa <abelvesa@kernel.org>,
	Andrea della Porta <andrea.porta@suse.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Chanwoo Choi <cw00.choi@samsung.com>, Frank Li <Frank.Li@nxp.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Orson Zhai <orsonzhai@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Tudor Ambarus <tudor.ambarus@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	"arm-scmi@vger.kernel.org" <arm-scmi@vger.kernel.org>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Cristian Marussi <cristian.marussi@arm.com>,
	Fabio Estevam <festevam@gmail.com>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>, Peng Fan <peng.fan@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>
Subject: RE: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED
Date: Fri, 27 Feb 2026 12:00:55 +0000	[thread overview]
Message-ID: <TY3PR01MB113465A96D1EEBB43C82C12A98673A@TY3PR01MB11346.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20260226-clk-det-rate-fw-managed-v1-1-4421dd2f6dc6@redhat.com>

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

  parent reply	other threads:[~2026-02-27 12:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-27  8:16   ` Geert Uytterhoeven
2026-02-27  8:57     ` Biju Das
2026-02-27 12:00   ` Biju Das [this message]
2026-02-27 14:44     ` Brian Masney
2026-02-27 16:38   ` Brian Masney
2026-03-02 11:27   ` Sudeep Holla
2026-02-26 18:16 ` [PATCH 12/13] clk: samsung: acpm: drop determine_rate op and use CLK_ROUNDING_FW_MANAGED flag Brian Masney
2026-02-28 13:31   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=TY3PR01MB113465A96D1EEBB43C82C12A98673A@TY3PR01MB11346.jpnprd01.prod.outlook.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=Frank.Li@nxp.com \
    --cc=abelvesa@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=andersson@kernel.org \
    --cc=andrea.porta@suse.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bmasney@redhat.com \
    --cc=cristian.marussi@arm.com \
    --cc=cw00.choi@samsung.com \
    --cc=festevam@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=orsonzhai@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=s.nawrocki@samsung.com \
    --cc=sboyd@kernel.org \
    --cc=sudeep.holla@kernel.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).