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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 870FBC6FD1C for ; Thu, 23 Mar 2023 13:13:16 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 09D71EC5; Thu, 23 Mar 2023 14:12:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 09D71EC5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1679577194; bh=AHU0pIED4pdCTNu/Ki2of6GAWy9IUUsw6t/t0Hez+4c=; h=In-Reply-To:References:Subject:From:To:Date:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=IRGSHqsNl1aWHE/Pw6m2FIzv4pxHgS5h7bkEnQa9KD1BRVYV/LZmVRVBNTHLV8GqY v94X9Qj86KEb7x0lNCZBHXvMUAGHzKM/etFGiVOInB8hV6R0wqLWQzPVEzhqxtIamh yX1ve++Xy1Otm4dymuMe08J0IXB50gVoacDDFbiU= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C66E6F8058C; Thu, 23 Mar 2023 14:10:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AF173F8027B; Thu, 23 Mar 2023 00:41:48 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 11832F80093 for ; Thu, 23 Mar 2023 00:41:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 11832F80093 Authentication-Results: alsa1.perex.cz; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qhMrUZAm 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-MailFrom: sboyd@kernel.org X-Mailman-Rule-Hits: max-recipients X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-size; news-moderation; no-subject; digests; suspicious-header Message-ID-Hash: LYLC7HHKKUJ27TLXRPNQCXC3XKXHYPTR X-Message-ID-Hash: LYLC7HHKKUJ27TLXRPNQCXC3XKXHYPTR X-Mailman-Approved-At: Thu, 23 Mar 2023 13:10:01 +0000 CC: Paul Cercueil , Maxime Coquelin , Chen-Yu Tsai , Daniel Vetter , Nicolas Ferre , Thierry Reding , Shawn Guo , Fabio Estevam , Ulf Hansson , Claudiu Beznea , Michael Turquette , Dinh Nguyen , Chunyan Zhang , Manivannan Sadhasivam , Andreas =?utf-8?q?F=C3=A4rber?= , Jonathan Hunter , Abel Vesa , Charles Keepax , Alessandro Zummo , Peter De Schrijver , Orson Zhai , Alexandre Torgue , Prashant Gaikwad , Liam Girdwood , Alexandre Belloni , Samuel Holland , Matthias Brugger , Richard Fitzgerald , Vinod Koul , NXP Linux Team , Sekhar Nori , Kishon Vijay Abraham I , Linus Walleij , Takashi Iwai , David Airlie , Luca Ceresoli , Jernej Skrabec , Pengutronix Kernel Team , Baolin Wang , David Lechner , Sascha Hauer , Mark Brown , Max Filippov , Geert Uytterhoeven , linux-stm32@st-md-mailman.stormreply.com, alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.ker, nel.org@alsa-project.org, linux-actions@lists.infradead.org, linux-clk@vger.kernel.org, AngeloGioacchino Del Regno , patches@opensource.cirrus.com, linux-tegra@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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?