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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D3BEC76196 for ; Thu, 6 Apr 2023 15:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238352AbjDFPVa (ORCPT ); Thu, 6 Apr 2023 11:21:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233628AbjDFPV2 (ORCPT ); Thu, 6 Apr 2023 11:21:28 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E45A93C5; Thu, 6 Apr 2023 08:21:24 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7C211C0A; Thu, 6 Apr 2023 08:22:08 -0700 (PDT) Received: from [10.2.7.51] (stinger.cambridge.arm.com [10.2.7.51]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ADE653F762; Thu, 6 Apr 2023 08:21:17 -0700 (PDT) Message-ID: Date: Thu, 6 Apr 2023 16:21:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 36/65] clk: versatile: sp810: Add a determine_rate hook Content-Language: en-US To: Maxime Ripard Cc: Michael Turquette , Stephen Boyd , =?UTF-8?Q?Andreas_F=c3=a4rber?= , 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 , Mark Brown , Jaroslav Kysela , Takashi Iwai , Paul Cercueil , Orson Zhai , Baolin Wang , Chunyan Zhang , 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 References: <20221018-clk-range-checks-fixes-v3-0-9a1358472d52@cerno.tech> <20221018-clk-range-checks-fixes-v3-36-9a1358472d52@cerno.tech> From: Pawel Moll In-Reply-To: <20221018-clk-range-checks-fixes-v3-36-9a1358472d52@cerno.tech> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On 04/04/2023 11:11, Maxime Ripard wrote: > The Versatile sp810 "timerclken" 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. Explanation of this mystery is pretty simple - the original patch: commit 6e973d2c438502dcf956e76305258ba7d1c7d1d3 Author: Pawel Moll Date: Thu Apr 18 18:23:22 2013 +0100 clk: vexpress: Add separate SP810 driver predates introduction of determine_rate to clk_ops... commit 71472c0c06cf9a3d1540762ea205654c584e3bc4 Author: James Hogan Date: Mon Jul 29 12:25:00 2013 +0100 clk: add support for clock reparent on set_rate and clearly no one (the author included ;-) bothered to have another look at this side of the driver. > 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. It's been one hell of a memory lane trip, but my recollection suggest that the main goal of the driver was simply initialisation of the mux to select the 1MHz parent, because the other option - 32kHz - just didn't make any sense whatsoever. And that would be the case on every single platform using SP810 I know (or at least: knew), so it's seems to me that making the state permanent, as you're suggesting (or I think you're suggesting?) it's the right thing to do. Thanks! Paweł