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 B17EEC6FD1D for ; Thu, 30 Mar 2023 16:07:37 +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 E76FB20B; Thu, 30 Mar 2023 18:06:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E76FB20B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1680192455; bh=4zOE3jMEKOhNI25UF0fOfIL08piHi2bqDz6TyK76qR4=; 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=SQhhsLmk0Qy631qmxZMLHTRjr6FDStuetvwk22LYSZT5+09heoSueETgzJ/W/Ak2M +9lVThwocJFrag3p4dPoZcdqhx+vI6OKIJeC7FdK9X+IETCjhv72ve9TnEUrXQ9Jct g538+EJ18klE+unGvuENOjOKroNacYG0xf2al5Ak= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 5B617F80482; Thu, 30 Mar 2023 18:06:31 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F0E7EF80272; Wed, 29 Mar 2023 22:04:28 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1EA7EF80114 for ; Wed, 29 Mar 2023 22:04:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1EA7EF80114 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=uw7qtD3H 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 dfw.source.kernel.org (Postfix) with ESMTPS id B515561E1B; Wed, 29 Mar 2023 20:04:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 090DEC433D2; Wed, 29 Mar 2023 20:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680120256; bh=4zOE3jMEKOhNI25UF0fOfIL08piHi2bqDz6TyK76qR4=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=uw7qtD3HESWGMQ9Baj1w6twvKM7JMNgmt7PKXoCvJOczY0u340GfBpvymvmBiBWVx qf+kcFVYf4dg0yAAoDZF/aYBqaksZ6Fa6+sA1PoByUd2LNaPRyh7sgPqRQE/0pwpm6 kLBCPzCQv/zuh06cTNQJrCxJ0npzPNiAuiOv4nPQtFpsUot5FTUeXXUIthYvejQLJp rYE7s1omKIT+oMjKorhMYWPlc7LMeX1LkHhCE8Dy2xq0wbdX6qu2wzq8S2YfmcMFVE ghrqf/6Xyf4MjMXD1dbNaL7jIuCYUjU2Xzl7KYDgsErEqGoLGnH3utZKKa/Vvp72NN 7AGUd6HAiLFYg== Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230329195049.lbdbkbqu6zbq5xii@penduick> References: <20221018-clk-range-checks-fixes-v2-0-f6736dec138e@cerno.tech> <20221018-clk-range-checks-fixes-v2-43-f6736dec138e@cerno.tech> <20221104155123.qomguvthehnogkdd@houat> <20221107084322.gk4j75r52zo5k7xk@houat> <20221107152603.57qimyzkinhifx5p@houat> <5819b1362f35ce306e1b6d566bfd44e5.sboyd@kernel.org> <20230329195049.lbdbkbqu6zbq5xii@penduick> Subject: Re: [PATCH v2 43/65] ASoC: tlv320aic32x4: Add a determine_rate hook From: Stephen Boyd To: Maxime Ripard Date: Wed, 29 Mar 2023 13:04:13 -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: BNYJUQQ6FVMO7IB6C7EE6P37EDMHH63N X-Message-ID-Hash: BNYJUQQ6FVMO7IB6C7EE6P37EDMHH63N X-Mailman-Approved-At: Thu, 30 Mar 2023 16:06:27 +0000 CC: Mark Brown , Maxime Coquelin , Chen-Yu Tsai , Daniel Vetter , Nicolas Ferre , Thierry Reding , Shawn Guo , Fabio Estevam , Ulf Hansson , Claudiu Beznea , Michael Turquette , Dinh Nguyen , Paul Cercueil , 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 , 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 (2023-03-29 12:50:49) > On Wed, Mar 22, 2023 at 04:31:04PM -0700, Stephen Boyd wrote: >=20 > > The clk_set_parent() path is valid for those cases. Probably nobody > > cares about determine_rate because they don't set rates on these clks. > > Some drivers even explicitly left out determine_rate()/round_rate() > > because they didn't want to have some other clk round up to the mux > > and change the parent. > >=20 > > Eventually we want drivers to migrate to determine_rate op so we can get > > rid of the round_rate op and save a pointer (we're so greedy). It's been > > 10 years though, and that hasn't been done. Sigh! I can see value in > > this series from the angle of migrating, but adding a determine_rate op > > when there isn't a round_rate op makes it hard to reason about. What if > > something copies the clk_ops or sets a different flag? Now we've just > > added parent changing support to clk_set_rate(). What if the clk has > > CLK_SET_RATE_PARENT flag set? Now we're going to ask the parent clk to > > change rate. Fun bugs. > >=20 > > TL;DR: If the set_parent op exists but determine_rate/round_rate doesn't > > then the clk is a mux that doesn't want to support clk_set_rate(). Make > > a new mux function that's the contents of the CLK_SET_RATE_NO_REPARENT > > branch in clk_mux_determine_rate_flags() and call that directly from the > > clk_ops so it is clear what's happening, > > clk_hw_mux_same_parent_determine_rate() or something with a better name. > > Otherwise migrate the explicit determine_rate op to this new function > > and don't set the flag. > >=20 > > It may be possible to entirely remove the CLK_SET_RATE_NO_REPARENT flag > > with this design, if the determine_rate clk_op can call the inner > > wrapper function instead of __clk_mux_determine_rate*() (those > > underscores are awful, we should just prefix them with clk_hw_mux_*() > > and live happier). That should be another patch series. >=20 > Sorry but it's not really clear to me what you expect in the v2 of this > series (if you even expect one). It looks that you don't like the > assignment-if-missing idea Mark suggested, but should I just > rebase/resend or did you expect something else? >=20 Yes, we want explicit code. Just rebase & resend. Don't add a determine_rate if there isn't a round_rate. Don't add more users of CLK_SET_RATE_NO_REPARENT. Instead, make an explicit determine_rate function for that. If you want to work on the removal of CLK_SET_RATE_NO_REPARENT go for it. Otherwise I'll take care of it after this series.