Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp809335rwl; Wed, 5 Apr 2023 08:02:20 -0700 (PDT) X-Google-Smtp-Source: AKy350bNH8C1t/trVOBM1Qkedf4xCD+G6xtwM6J/0eYj2M7CJUfvgy1xvl6q+3yTYou9NGy71pC4 X-Received: by 2002:a05:6402:1641:b0:502:2440:577e with SMTP id s1-20020a056402164100b005022440577emr2636309edx.16.1680706939459; Wed, 05 Apr 2023 08:02:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680706939; cv=none; d=google.com; s=arc-20160816; b=M1XP6CqDUXeGyWf5mvfpbQa1mC4MoC6cEXgvv9k0GtDLatWk8js1ptLg91fkBFqWeX p3/Q72ZZjkep/94tVK5epCrR4QRmv7uwAHk9Qelv+QHiiYWV//VJl0j6fwXP69abzRhu We9B+ZNFI/jzXgDxSeIsdLhYs/wDWMEPrRUw8MtMqyCVNH4PE7o+zxlD3D4BOyeANw5E JuemLP7hO9tQKzZTDBkcBdrcTMhRS5aTg6VaSvbHFpps3xtnAHJJCDtDyf2dVTMNnDYH y4es1JxzuD6fBbWojf4MAQaN1h/wBdRu0+fGhu6y6jQyx66s/CJfHoJwsWcdQyOHUij0 IKvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=12Dan7+hixlpFENmGLL4GqaHPQrKwrlwcpNYaShrlRU=; b=qfZLzWrOR3mBBZ+RyI2dfhLFay43Hx3ezBgTuI7ZDwNBFS5OVyjzYVFckuaWBmIIp2 umdumIE1Eo3DkxWu3ORieJEEkuiIk1eBqNyKO/2TnzGg3FImRMpRC+7BzfS4jnz13ddI KbAKegHvu0lI5XxrSvKStRbzOZg+OdDSBtWq0eBIKSA6iptzjXvSjBmLL2uYD87Pm0W1 wcfDZEQfX+kWT1bm+fGSLkL2c08iRZEb248sgbLe6SGXyU2o2GcMZaFt79rr8bLcZgUu sf7sM89kAdOl/Rp6IdtVJbpaRGB0eMZcwhK6wa+QYP0WX3a1yMG20psCuEA5LErCm7ec 8aFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=hkUfRXi9; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=lOTStozR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k6-20020a05640212c600b004fe93335704si3748849edx.420.2023.04.05.08.01.50; Wed, 05 Apr 2023 08:02:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=hkUfRXi9; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=lOTStozR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238266AbjDEOvR (ORCPT + 99 others); Wed, 5 Apr 2023 10:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233443AbjDEOvP (ORCPT ); Wed, 5 Apr 2023 10:51:15 -0400 Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 277135277; Wed, 5 Apr 2023 07:51:13 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 297162B066F9; Wed, 5 Apr 2023 10:51:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 05 Apr 2023 10:51:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1680706262; x=1680713462; bh=12 Dan7+hixlpFENmGLL4GqaHPQrKwrlwcpNYaShrlRU=; b=hkUfRXi9ZUU/v0L/+I gVrH+uthhloeGbMuMyLFaLPGdmHx+ZfnEv71Adty8UoYbiAE/xjl8u5KqVjg9iph dDL+1SNtFZ1DIoSql0P9/+KZLkrmQQF9uAj4XJ3/r3yzAoVDyU+3UZyu1+aTEPER OWkJxOHbEINNDSPozQUVQlhGFT/1jQ99cutqUong+yuWAY6hka25mlIqIA3GjQ0M xDl9zwU8ch2EEnAt9r2dDdVWFEMDWJMeeAG6cjRIoFxOKPLQyawDWpS1LKq7S1Sc MGSHJpnZvjWdEWmQvJiSBEknGcWQYWFHfj+4DYMwd9wCkAvA7EmYRRWbg1P2K/Fd qCiA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1680706262; x=1680713462; bh=12Dan7+hixlpF ENmGLL4GqaHPQrKwrlwcpNYaShrlRU=; b=lOTStozRcIhNQiVpqSWvy6hRgVXT/ Z8/ftiEBKyaVp1oyePcUHHGpoOaAaw1wd36ZBldHKB440gbnuuWDgL4aZxY4t+D2 JoJRCNbY0NF2d9BzWQZ6I8nmk8bEGEJ52MOxbUnQvnpqprCtvLgw9V0VvdXk8yjW C/YVrE2H0tJEXEaoqCnm6pQNlv7lYnQwjCa/Zg4z9cPIiCtx72SsV2zfomP957up I+sHEZnv3M0+ChpZ9XsHO6Dx8kCKXakzvR1oF5fyxjofwoD6OTcV2p4PzM7eDPWe UjJ4Qg64vq3vbaPOW4sz1a3L5/0xOG6j9Rn4k8PPs7pnugtw7Htymzhvg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejuddgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtsfertddtudenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeefjeeiueeiheevtddvgfeluedufeeigeeijefhveelfeevueefieehuefg ffetteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 5 Apr 2023 10:50:59 -0400 (EDT) Date: Wed, 5 Apr 2023 16:50:56 +0200 From: Maxime Ripard To: Paul Cercueil Cc: Aidan MacDonald , Stephen Boyd , Maxime Coquelin , Chen-Yu Tsai , Daniel Vetter , Nicolas Ferre , Thierry Reding , Jaroslav Kysela , 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.kernel.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 Subject: Re: [PATCH v2 56/65] clk: ingenic: cgu: Switch to determine_rate Message-ID: References: <20221107085417.xrsh6xy3ouwdkp4z@houat> <20221109110045.j24vwkaq3s4yzoy3@houat> <06a293adc75990ed3e297b076fc38d8a.sboyd@kernel.org> <20230324111959.frjf4neopbs67ugd@houat> <20230327192430.b2cp3yyrkzy4g4vw@penduick> <1e0e8e9fe44c27e844e7e918a985704e58da2c27.camel@crapouillou.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="i7uz65y3usvns4hs" Content-Disposition: inline In-Reply-To: <1e0e8e9fe44c27e844e7e918a985704e58da2c27.camel@crapouillou.net> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --i7uz65y3usvns4hs Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 05, 2023 at 02:57:26PM +0200, Paul Cercueil wrote: > Le lundi 27 mars 2023 =E0 21:24 +0200, Maxime Ripard a =E9crit=A0: > > On Fri, Mar 24, 2023 at 08:58:48PM +0000, Aidan MacDonald wrote: > > > > > My suggestion: add a per-clock bitmap to keep track of which > > > > > parents > > > > > are allowed. Any operation that would select a parent clock not > > > > > on the > > > > > whitelist should fail. Automatic reparenting should only select > > > > > from > > > > > clocks on the whitelist. And we need new DT bindings for > > > > > controlling > > > > > the whitelist, for example: > > > > >=20 > > > > > =A0=A0=A0 clock-parents-0 =3D <&clk1>, <&pll_c>; > > > > > =A0=A0=A0 clock-parents-1 =3D <&clk2>, <&pll_a>, <&pll_b>; > > > > >=20 > > > > > This means that clk1 can only have pll_c as a parent, while > > > > > clk2 can > > > > > have pll_a or pll_b as parents. By default every clock will be > > > > > able > > > > > to use any parent, so a list is only needed if the machine > > > > > needs a > > > > > more restrictive policy. > > > > >=20 > > > > > assigned-clock-parents should disable automatic reparenting, > > > > > but allow > > > > > explicit clk_set_parent(). This will allow clock drivers to > > > > > start doing > > > > > reparenting without breaking old DTs. > > > >=20 > > > > I'm generally not a fan of putting all these policies in the > > > > device > > > > tree. Do you have an example where it wouldn't be possible to do > > > > exactly > > > > this from the driver itself? > > >=20 > > > I'm confused. What's implicit in the example is clk1 and clk2 might > > > have *other* possible choices of parent clock and the device tree > > > is > > > limiting what the OS is allowed to choose. > > >=20 > > > Why would you put such arbitrary limitations into the driver? > >=20 > > Why would we put such arbitrary limitations in the firmware? As this > > entire thread can attest, people are already using the device tree to > > work around the limitations of the Linux driver, or reduce the > > features of Linux because they can rely on the device tree. Either > > way, it's linked to the state of the Linux driver, and any other OS > > or > > Linux version could very well implement something more dynamic. >=20 > Probably because if we have to choose between setting policy in the > kernel or in the firmware, it is arguably better to set it in the > firmware. I have a very different view on this I guess. Firmware is (most of the time) hard to update, and the policy depend on the state of support of a given OS so it's likely to evolve. The kernel is the best place to me to put that kind of policy. Why do you think differently? > Especially when talking about clocks, as the firmware is already the > one programming the boot clocks. I'm not sure what your point is there. I don't think I ever saw a firmware getting the clocks right for every possible scenario on a given platform. And if it was indeed the case, then we wouldn't even a kernel driver. Maxime --i7uz65y3usvns4hs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZC2KyAAKCRDj7w1vZxhR xbx0AQDo/091Al9F55xVR4k44hMshHS0Db7q/bHfCkOFHJG+RwEAxo0zFijQl/Op i9WCXbYvyuKQciwCDCJE5/F+69faAgw= =nWIA -----END PGP SIGNATURE----- --i7uz65y3usvns4hs--