[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fd2b473bc7c3c70ae0e85b2a6315d9e8.sboyd@kernel.org>
Date: Tue, 10 Dec 2024 14:44:19 -0800
From: Stephen Boyd <sboyd@...nel.org>
To: Abel Vesa <abelvesa@...nel.org>, Fabio Estevam <festevam@...il.com>, Marek Vasut <marex@...x.de>, Michael Turquette <mturquette@...libre.com>, Miquel Raynal <miquel.raynal@...tlin.com>, Peng Fan <peng.fan@....com>, Pengutronix Kernel Team <kernel@...gutronix.de>, Sascha Hauer <s.hauer@...gutronix.de>, Shawn Guo <shawnguo@...nel.org>, Ying Liu <victor.liu@....com>
Cc: Laurent Pinchart <laurent.pinchart@...asonboard.com>, linux-clk@...r.kernel.org, imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org, Abel Vesa <abel.vesa@...aro.org>, Herve Codina <herve.codina@...tlin.com>, Luca Ceresoli <luca.ceresoli@...tlin.com>, Thomas Petazzoni <thomas.petazzoni@...tlin.com>, Ian Ray <ian.ray@...com>, Miquel Raynal <miquel.raynal@...tlin.com>
Subject: Re: [PATCH 4/5] clk: Add flag to prevent frequency changes when walking subtrees
Quoting Miquel Raynal (2024-11-21 09:41:14)
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index adfc5bfb93b5a65b6f58c52ca2c432d651f7dd7d..94d93470479e77769e63e97462b176261103b552 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1927,7 +1927,6 @@ long clk_get_accuracy(struct clk *clk)
> }
> EXPORT_SYMBOL_GPL(clk_get_accuracy);
>
> -__maybe_unused
> static unsigned long clk_determine(struct clk_core *core, unsigned long rate)
> {
> struct clk_rate_request req = {};
Please add functions in the same patch that uses them. It is hard to
review this patch when half the context is in another patch.
> @@ -2272,7 +2271,13 @@ static void clk_calc_subtree(struct clk_core *core)
> {
> struct clk_core *child;
>
> - core->new_rate = clk_recalc(core, core->parent->new_rate);
> + if (core->flags & CLK_NO_RATE_CHANGE_DURING_PROPAGATION) {
> + core->new_rate = clk_determine(core, core->rate);
> + if (!core->new_rate)
> + core->new_rate = clk_recalc(core, core->parent->new_rate);
> + } else {
> + core->new_rate = clk_recalc(core, core->parent->new_rate);
> + }
>
> hlist_for_each_entry(child, &core->children, child_node)
> clk_calc_subtree(child);
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 200135e0f6d00d48b10e843259333b9733c97f38..baef0b442ac1d36ee935cbcaaaa4e2d95fe7654c 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -38,6 +38,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)
> +/* do not passively change this clock rate during subtree rate propagation */
> +#define CLK_NO_RATE_CHANGE_DURING_PROPAGATION BIT(14)
Why doesn't rate locking work?
Powered by blists - more mailing lists