From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20B0AC74A5B for ; Wed, 22 Mar 2023 23:41:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A99710E41D; Wed, 22 Mar 2023 23:41:47 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 86A0310E41D for ; Wed, 22 Mar 2023 23:41:45 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2981EB81EA0; Wed, 22 Mar 2023 23:41:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB1FBC433D2; Wed, 22 Mar 2023 23:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679528502; bh=AHU0pIED4pdCTNu/Ki2of6GAWy9IUUsw6t/t0Hez+4c=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=qhMrUZAm8XEQhH+BGl6x55Y1Wd0UlbZIqAiPPr++LjM278cFuBNvP6Rpo9lXFGyqL uJ6LWk0ZldLVQTkF8EhEtux9mFcIydmVdkkNiB3jsxskjV3J9TxBW+ZWw4AhchZNSS M2Mt12jWyLTObCnbEMQVSwcWlQybSHgVqcVm1SCLrDBy1nq0jsAccne6avkIMyuXjA +Iylb5tPBf/uEkEjMeRO2JSySC6AvvEaLfkavbQkcL5CdgNLbCm1zo3rBXpbY0HuQl /qS04gYV5Ay5BvMbb9UUtlZdBQgsaPJetgh8R5A/sgXgF8t56P/kwN5ccnXw8HrEPJ TB1oQwtO3fAag== Message-ID: <06a293adc75990ed3e297b076fc38d8a.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20221109110045.j24vwkaq3s4yzoy3@houat> References: <20221018-clk-range-checks-fixes-v2-0-f6736dec138e@cerno.tech> <20221018-clk-range-checks-fixes-v2-56-f6736dec138e@cerno.tech> <80VTKR.CE8RVN8M3ZYK3@crapouillou.net> <20221104145946.orsyrhiqvypisl5j@houat> <20221107085417.xrsh6xy3ouwdkp4z@houat> <20221109110045.j24vwkaq3s4yzoy3@houat> Subject: Re: [PATCH v2 56/65] clk: ingenic: cgu: Switch to determine_rate From: Stephen Boyd To: Aidan MacDonald , Maxime Ripard Date: Wed, 22 Mar 2023 16:41:40 -0700 User-Agent: alot/0.10 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: , Ulf Hansson , Prashant Gaikwad , Alexandre Belloni , Michael Turquette , Sekhar Nori , Alexandre Torgue , dri-devel@lists.freedesktop.org, Jaroslav Kysela , Paul Cercueil , Max Filippov , Thierry Reding , linux-phy@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Abel Vesa , Liam Girdwood , Geert Uytterhoeven , Samuel Holland , Chunyan Zhang , Takashi Iwai , linux-tegra@vger.kernel.org, Jernej Skrabec , Jonathan Hunter , Chen-Yu Tsai , NXP Linux Team , Orson Zhai , linux-mips@vger.kernel.org, Luca Ceresoli , Kishon Vijay Abraham I , linux-clk@vger.kernel.org, Charles Keepax , alsa-devel@alsa-project.org, Manivannan Sadhasivam , linux-kernel@vger.kernel.org, Sascha Hauer , linux-actions@lists.infradead.org, Richard Fitzgerald , Mark Brown , linux-mediatek@lists.infradead.org, ".com"@freedesktop.org, Baolin Wang , Matthias Brugger , Pengutronix Kernel Team , nel.org@freedesktop.org, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , linux-sunxi@lists.linux.dev, patches@opensource.cirrus.com, Peter De Schrijver , Nicolas Ferre , Andreas =?utf-8?q?F=C3=A4rber?= , Dinh Nguyen , Vinod Koul , Maxime Coquelin , linux-renesas-soc@vger.ker, David Lechner , Shawn Guo , Claudiu Beznea , linux-rtc@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Quoting Maxime Ripard (2022-11-09 03:00:45) > On Mon, Nov 07, 2022 at 08:57:22PM +0000, Aidan MacDonald wrote: > >=20 > > Maxime Ripard writes: > >=20 > > > Hi, > > > > > > On Fri, Nov 04, 2022 at 05:35:29PM +0000, Aidan MacDonald wrote: > >=20 > > Assigning the parent clock in the DT works once, at boot, but going off > > what you wrote in the commit message, if the clock driver has a > > .determine_rate() implementation that *can* reparent clocks then it > > probably *will* reparent them, and the DT assignment will be lost. >=20 > Yes, indeed, but assigned-clock-parents never provided any sort of > guarantee on whether or not the clock was allowed to reparent or not. > It's just a one-off thing, right before probe, and a clk_set_parent() > call at probe will override that just fine. >=20 > Just like assigned-clock-rates isn't permanent. >=20 > > What I'm suggesting is a runtime constraint that the clock subsystem > > would enforce, and actively prevent drivers from changing the parent. > > Either explicitly with clk_set_parent() or due to .determine_rate(). > >=20 > > That way you could write a .determine_rate() implementation that *can* > > select a better parent, but if the DT applies a constraint to fix the > > clock to a particular parent, the clock subsystem will force that parent > > to be used so you can be sure the clock is never reparented by accident. >=20 > Yeah, that sounds like a good idea, and CLK_SET_RATE_NO_REPARENT isn't > too far off from this, it's just ignored by clk_set_parent() for now. I > guess we could rename CLK_SET_RATE_NO_REPARENT to CLK_NO_REPARENT, make > clk_set_parent handle it, and set that flag whenever > assigned-clock-parents is set on a clock. >=20 > It's out of scope for this series though, and I certainly don't want to > deal with all the regressions it might create :) >=20 This sounds like a new dt binding that says the assigned parent should never change. It sounds sort of like gpio hogs. A clock-hogs binding?