Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6157071rwl; Tue, 4 Apr 2023 08:34:34 -0700 (PDT) X-Google-Smtp-Source: AKy350Z79BIo9t9PKnikuHEJfcJ+8N797EaXQ6GCd1pdmP/xe/gVVowwwU07zN8UM5ek+9TrR5wi X-Received: by 2002:a17:902:db07:b0:1a1:cc0c:a5c0 with SMTP id m7-20020a170902db0700b001a1cc0ca5c0mr3423224plx.63.1680622473514; Tue, 04 Apr 2023 08:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680622473; cv=none; d=google.com; s=arc-20160816; b=bo2qd3Dowu1VXHGSpv9ZwAEnPH5eAAYpyFgOmhdWJOQemRs/+oR0kIU3XqRx4qNQQu rLOi5SUudQmBgYG3pJh1pz8b3inCwJDVfWZQaw/YKQXpIZ4w9maZNG9lw6PHIcmUUXhi Fndt2dt0BeBhs+imHudOncVqnaqfzSTb3i3344ASwJwi6OFdAG4OhPar1NSZqx2zPIT3 3QNOlPbbkO6K4DnCw9jDlei0HDFSwyF7OMT4xJ7IyLNZdlzx53jsGpGJkJM1W/ezpV7Q lWzFIQzZznxCbC1bNNCW9Th+BiczG1CFBqc5ynJVmuK8BNw316FfwAZsf5rrzVhVu6sN yuMQ== 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:dkim-signature; bh=4Mxa11v6DCBGa9/pCbz1RdUlcwFcqdP1raw2ePqcRJs=; b=MBSFGXx7h+rm2vvMnuhQgCtoOHNcwMQ9bBrSCSGa5uUjiSKL5bEE3fIgiSTCsKApQ7 UkME5JzEP8CyRNn2Ddr0xoakmKCq6e+z/rb5bPAbEAcrb55iMj2NxP0IUySCj2WLrq1w E88XcvOelleCFNPlKQBDx3r3/zbzQKjnrAji0jCvhq+6oGStLjks4UzaHshN72/wgZ7m AD6KGsWJo2XKyZAhgnhVuue/yp9WKQMqe+TQ86JTZs/9eZigCFqnO9OERTZRZj9uW51f QYOIJ0gpo+BC3btGhalcJWuzBun3vg8xahNHxh4qc4IQhCP+8FoOKk/zxt8tVLPGUeel XH7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=juLKZrGe; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a6557c5000000b0050b026c3aa7si10321590pgr.395.2023.04.04.08.34.20; Tue, 04 Apr 2023 08:34:33 -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=@kernel.org header.s=k20201202 header.b=juLKZrGe; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233070AbjDDP0j (ORCPT + 99 others); Tue, 4 Apr 2023 11:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234830AbjDDP0g (ORCPT ); Tue, 4 Apr 2023 11:26:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27BAB4493; Tue, 4 Apr 2023 08:26:35 -0700 (PDT) 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 A4893635F9; Tue, 4 Apr 2023 15:26:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 166DCC4339B; Tue, 4 Apr 2023 15:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680621994; bh=S5RX+65IdJoFD1RV6kPG02G0jupKJXUIf9T04GMrChI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=juLKZrGeWUX9d0oOR/CCL+88qbCAb/xWCfYJOewm4RggCItQtMsffW8KgmQJXRJdf wIGDohsQC49Uu+Ack+4kjWMLAjsoMV3eb751vy96HTaqKD91T/UUKbpSlW86M8yyWU kzibdkPn/HM0qi9cV+Pg+vpi80+5XFQ+v5x9mDGc2lQrl4NnUSCzI4lyIjnRln2nSD O5kE/0LQwnVa4MaO8VpBvXstlEflZ23NPK1LSMQlUuVw1QtKT/IAOLsLs/T1N/El4F IlKMU2toIuXW4dsXuO5nqayGgzbPTQ/Kz+zZdF9SFWy3SohdZ+M+0IoBj9mTyg+9sZ lTrq/E6gLN+BQ== Date: Tue, 4 Apr 2023 16:26:18 +0100 From: Mark Brown To: Maxime Ripard Cc: Michael Turquette , Stephen Boyd , Andreas =?iso-8859-1?Q?F=E4rber?= , Manivannan Sadhasivam , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Max Filippov , Charles Keepax , Richard Fitzgerald , Maxime Coquelin , Alexandre Torgue , Luca Ceresoli , David Lechner , Sekhar Nori , Abel Vesa , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Matthias Brugger , Geert Uytterhoeven , Dinh Nguyen , Peter De Schrijver , Prashant Gaikwad , Thierry Reding , Jonathan Hunter , Ulf Hansson , Linus Walleij , David Airlie , Daniel Vetter , Vinod Koul , Kishon Vijay Abraham I , Alessandro Zummo , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Paul Cercueil , Orson Zhai , Baolin Wang , Chunyan Zhang , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, patches@opensource.cirrus.com, linux-stm32@st-md-mailman.stormreply.com, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-phy@lists.infradead.org, linux-rtc@vger.kernel.org, linux-sunxi@lists.linux.dev, alsa-devel@alsa-project.org, linux-mips@vger.kernel.org Subject: Re: [PATCH v3 43/65] ASoC: tlv320aic32x4: Add a determine_rate hook Message-ID: <01f32440-8dd2-4030-9006-a3123be55845@sirena.org.uk> References: <20221018-clk-range-checks-fixes-v3-0-9a1358472d52@cerno.tech> <20221018-clk-range-checks-fixes-v3-43-9a1358472d52@cerno.tech> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pRxU5n1hMJtSd1CQ" Content-Disposition: inline In-Reply-To: <20221018-clk-range-checks-fixes-v3-43-9a1358472d52@cerno.tech> X-Cookie: Being ugly isn't illegal. Yet. X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, 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 --pRxU5n1hMJtSd1CQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 04, 2023 at 12:11:33PM +0200, Maxime Ripard wrote: > The tlv320aic32x4 clkin clock implements a mux with a set_parent hook, > but doesn't provide a determine_rate implementation. > This is a bit odd, since set_parent() is there to, as its name implies, > change the parent of a clock. However, the most likely candidate to > trigger that parent change is a call to clk_set_rate(), with > determine_rate() figuring out which parent is the best suited for a > given rate. > The other trigger would be a call to clk_set_parent(), but it's far less > used, and it doesn't look like there's any obvious user for that clock. It could be configured from device tree as well couldn't it? > So, the set_parent hook is effectively unused, possibly because of an > oversight. However, it could also be an explicit decision by the > original author to avoid any reparenting but through an explicit call to > clk_set_parent(). Historically clk_set_rate() wouldn't reparent IIRC. > The latter case would be equivalent to setting the flag > CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook > to __clk_mux_determine_rate(). Indeed, if no determine_rate > implementation is provided, clk_round_rate() (through > clk_core_round_rate_nolock()) will call itself on the parent if > CLK_SET_RATE_PARENT is set, and will not change the clock rate > otherwise. __clk_mux_determine_rate() has the exact same behavior when > CLK_SET_RATE_NO_REPARENT is set. > And if it was an oversight, then we are at least explicit about our > behavior now and it can be further refined down the line. To be honest it's surprising that we'd have to manually specify this, I would expect to be able to reparent. I suspect it'd be better to go the other way here and allow reparenting. --pRxU5n1hMJtSd1CQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmQsQZoACgkQJNaLcl1U h9C4KAf9FbCqTcQH5npaqJcyqXkbkD2B/+L43dup6TDsW3MJ6KnGh7YONz0DFQtI yTePWQzrTp7lltc9dQ8/QOvh4Xj3HSYJ30m5Ok0oX7lCLwy3LjEHtJiou/laIivq v+hAN2lVJPs0oOLwI+1tyi2p+UjtHzWUJcD37bHzIsY4esaL/B/Bp7m6z1JNpyoj rIleJHkETKjUABBzN/UR62y6TPaPPm/hSUcy0eudfmZZhPOWkuX/iBrFcXcUgc+c XOAtB0+uAsDUhULdGhXZSInCoKu0mdVwLr1QoZOB7q7J3Tl83t/8Mxuk8Dr+XEWh JBFDNPB3HM8uQvBR5j9pbnSLt/7E/A== =Jkqi -----END PGP SIGNATURE----- --pRxU5n1hMJtSd1CQ--