All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Maxime Ripard <mripard@redhat.com>
Cc: Stephen Boyd <sboyd@kernel.org>,  Abel Vesa <abelvesa@kernel.org>,
	 Peng Fan <peng.fan@nxp.com>,
	 Michael Turquette <mturquette@baylibre.com>,
	Shawn Guo <shawnguo@kernel.org>,
	 Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	 Fabio Estevam <festevam@gmail.com>,
	 Ying Liu <victor.liu@nxp.com>,  Marek Vasut <marex@denx.de>,
	 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-clk@vger.kernel.org,  imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	 Abel Vesa <abel.vesa@linaro.org>,
	Herve Codina <herve.codina@bootlin.com>,
	 Luca Ceresoli <luca.ceresoli@bootlin.com>,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 Ian Ray <ian.ray@ge.com>
Subject: Re: [PATCH 4/5] clk: Add flag to prevent frequency changes when walking subtrees
Date: Fri, 10 Jan 2025 16:40:26 +0100	[thread overview]
Message-ID: <878qri8yol.fsf@bootlin.com> (raw)
In-Reply-To: <20250106-fabulous-tapir-of-acceptance-c4e3e7@houat> (Maxime Ripard's message of "Mon, 6 Jan 2025 15:36:33 +0100")

Hi Maxime,

>> The exclusive rate code could support this if it doesn't already do so.
>> If you call clk_set_rate_exclusive(child, <constant rate>) followed by
>> clk_set_rate(parent, <new rate>) the core code should try to keep the
>> child at the constant rate, or fail the clk_set_rate() call on the
>> parent. It should be possible to confirm this with some KUnit tests for
>> clk_set_rate_exclusive(). Similarly, if another child, child_B, of the
>> parent changes the parent rate, we should speculate the new rate of the
>> child_A that's protected and fail if we can't maintain the rate. We need
>> to start generating a list of clks that we operate a rate change on to
>> support this though, because right now we rely on the stack to track the
>> clks that we change the rate of.
>> 
>> Initially we thought that we could do this with clk notifiers. That may
>> work here, but I suspect it will be clunky to get working because clk
>> notifiers operate on struct clk.
>
> I think notifiers are great for customers, but not really adequate for
> the clock drivers tree. Indeed, you can only react to a (sub)tree
> configuration using notifiers, but you can't affect it to try something
> new that would be a better fit.
>
> Like, if we have a PLL A, with two child clocks that are dividers. B is
> initially (exclusively) set to freq X, and then you want to set C to 2X.
>
> The best thing to do is to set A to 2X, and double B's divider. It's
> simple enough, but we have no way to try to negociate that at the
> moment.

Indeed. Do you have something in mind to address this situation (eg. a
new clk provider or core API)?

Thanks,
Miquèl

  reply	other threads:[~2025-01-10 15:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21 17:41 [PATCH 0/5] clk: Fix simple video pipelines on i.MX8 Miquel Raynal
2024-11-21 17:41 ` [PATCH 1/5] clk: imx: clk-imx8mp: Allow LDB serializer clock reconfigure parent rate Miquel Raynal
2024-11-21 17:41 ` [PATCH 2/5] clk: Add a helper to determine a clock rate Miquel Raynal
2024-11-21 17:41 ` [PATCH 3/5] clk: Split clk_calc_subtree() Miquel Raynal
2024-11-21 17:41 ` [PATCH 4/5] clk: Add flag to prevent frequency changes when walking subtrees Miquel Raynal
2024-12-10 22:44   ` Stephen Boyd
2024-12-23 18:38     ` Miquel Raynal
2024-12-31  1:09       ` Stephen Boyd
2024-12-17 12:47   ` Maxime Ripard
2024-12-23 18:43     ` Miquel Raynal
2024-12-31  1:22       ` Stephen Boyd
2025-01-06 14:36         ` Maxime Ripard
2025-01-10 15:40           ` Miquel Raynal [this message]
2025-01-10 15:38         ` Miquel Raynal
2024-11-21 17:41 ` [PATCH 5/5] clk: imx: imx8mp: Prevent media clocks to be incompatibly changed Miquel Raynal
2024-11-22  6:01 ` [PATCH 0/5] clk: Fix simple video pipelines on i.MX8 Liu Ying
2024-11-22  9:54   ` Miquel Raynal
2024-11-26  6:49     ` Liu Ying
2024-11-26 11:03       ` Miquel Raynal
2024-11-27  7:24         ` Liu Ying
2024-12-17 12:54     ` Maxime Ripard
2024-12-23 18:59       ` Miquel Raynal
2025-01-06 14:45         ` Maxime Ripard

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=878qri8yol.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=abel.vesa@linaro.org \
    --cc=abelvesa@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=herve.codina@bootlin.com \
    --cc=ian.ray@ge.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=marex@denx.de \
    --cc=mripard@redhat.com \
    --cc=mturquette@baylibre.com \
    --cc=peng.fan@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=victor.liu@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.