From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C66F7342C92; Wed, 27 Aug 2025 13:50:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756302631; cv=none; b=bc9h+gGGyZ/ohefJtj25jaExmeN0UpW35lBCbimGbcRsGY9EQSZr0b5n+WQOlj4wihDQzWTxt7aAZYmNnrWYQFLJBgETU/Jspn+hASSp+pugOR9tNjcwBpYIbKNlj17472tC1uN5qd2WSWI1dXptI9fLM5dVhAKq2yXj8ByGPBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756302631; c=relaxed/simple; bh=sjDy2yPaMyRUWRHA7zNCNkrYIPM6l4g0nDQeVISxPDs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VvLjF50lMH9BSuMKY/T0ifYiu9BvZ9cOl5k7gZaEOMdlVu7hNVjMY+LLOvtvLKbsV9m/MjIAwQ7d9WPFuzzMuXPGB5Z73mcC/HTaQFguerZhp7GLSzOEsM5jbgU9U0O7aaj1x4c+U7gEezTN1/gqIlOd69QCOx2KAlSMkcOe0IU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com; spf=none smtp.mailfrom=foss.arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=foss.arm.com 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 D1ECC1688; Wed, 27 Aug 2025 06:50:20 -0700 (PDT) Received: from bogus (unknown [10.57.57.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A11B23F694; Wed, 27 Aug 2025 06:50:11 -0700 (PDT) Date: Wed, 27 Aug 2025 14:49:48 +0100 From: Sudeep Holla To: Brian Masney Cc: Peng Fan , Sudeep Holla , Cristian Marussi , Michael Turquette , Stephen Boyd , Chen Wang , Inochi Amaoto , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Paul Cercueil , Keguang Zhang , Taichi Sugaya , Takao Orito , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Jacky Huang , Shan-Chun Hung , Vladimir Zapolskiy , Piotr Wojtaszczyk , Paul Walmsley , Samuel Holland , Yixun Lan , Steen Hegelund , Daniel Machon , UNGLinuxDriver@microchip.com, Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , Michal Simek , Maxime Ripard , Andreas =?utf-8?Q?F=C3=A4rber?= , Manivannan Sadhasivam , Sven Peter , Janne Grunau , Alyssa Rosenzweig , Neal Gompa , Eugeniy Paltsev , Ray Jui , Scott Branden , Broadcom internal kernel review list , Max Filippov , Matthias Brugger , AngeloGioacchino Del Regno , Daniel Palmer , Romain Perier , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Bjorn Andersson , Geert Uytterhoeven , Heiko Stuebner , Andrea della Porta , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi , Alim Akhtar , Qin Jian , Viresh Kumar , Ulf Hansson , Luca Ceresoli , Alex Helms , Linus Walleij , Liviu Dudau , Lorenzo Pieralisi , Nobuhiro Iwamatsu , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sophgo@lists.linux.dev, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, patches@opensource.cirrus.com, linux-actions@lists.infradead.org, asahi@lists.linux.dev, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, soc@lists.linux.dev Subject: Re: [PATCH 112/114] clk: scmi: remove round_rate() in favor of determine_rate() Message-ID: <20250827-abstract-maize-tanuki-d1bdcb@sudeepholla> References: <20250811-clk-for-stephen-round-rate-v1-0-b3bf97b038dc@redhat.com> <20250811-clk-for-stephen-round-rate-v1-112-b3bf97b038dc@redhat.com> <20250827070933.GB18994@nxa18884-linux.ap.freescale.net> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Aug 27, 2025 at 09:13:17AM -0400, Brian Masney wrote: > On Wed, Aug 27, 2025 at 03:09:33PM +0800, Peng Fan wrote: > > Hi Brian, Sudeep, Cristian > > > > On Mon, Aug 11, 2025 at 11:19:44AM -0400, Brian Masney via B4 Relay wrote: > > >From: Brian Masney > > > > > >This driver implements both the determine_rate() and round_rate() clk > > >ops, and the round_rate() clk ops is deprecated. When both are defined, > > >clk_core_determine_round_nolock() from the clk core will only use the > > >determine_rate() clk ops, so let's remove the round_rate() clk ops since > > >it's unused. > > > > > >Signed-off-by: Brian Masney > > >--- > > > drivers/clk/clk-scmi.c | 30 ------------------------------ > > > 1 file changed, 30 deletions(-) > > > > > >diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c > > >index d2408403283fc72f0cf902e65f4c08bcbc7b4b0b..6c6ddb92e7cf6a0cfac2c7e19c0f15f777bb8c51 100644 > > >--- a/drivers/clk/clk-scmi.c > > >+++ b/drivers/clk/clk-scmi.c > > >@@ -54,35 +54,6 @@ static unsigned long scmi_clk_recalc_rate(struct clk_hw *hw, > > > return rate; > > > } > > > > > >-static long scmi_clk_round_rate(struct clk_hw *hw, unsigned long rate, > > >- unsigned long *parent_rate) > > >-{ > > > > I see the point of round_rate is not used if determine_rate is there. > > But reading the code of round_rate, It might be better to rename > > scmi_clk_round_rate to scmi_clk_determine_rate. > > > > Anyway, need Sudeep and Cristian to comment. > > In this case, yes the round_rate implementation is filled out, whereas > the determine_rate lets the firmware handle it, and > scmi_clk_recalc_rate() will later populate the rate the clock is running > at. > > I can convert round_rate over to determine_rate in this case, however it > would be a change to what's there now, and risks a regression. Here's > the relevant code from drivers/clk/clk.c where the determine_rate and > round_rate ops are called: I am inclined towards this. Determine rate was added recently when the clock parent support was added IIUC, so I don't think it should regress anything. > > static int clk_core_determine_round_nolock(struct clk_core *core, > struct clk_rate_request *req) > { > ... > if (clk_core_rate_is_protected(core)) { > req->rate = core->rate; > } else if (core->ops->determine_rate) { > return core->ops->determine_rate(core->hw, req); > } else if (core->ops->round_rate) { > rate = core->ops->round_rate(core->hw, req->rate, > &req->best_parent_rate); > ... > > If Sudeep / Cristian want the round rate converted to determine rate in > this driver, then I can do that in a v2. > Yes please. Also please post it independent if it doesn't have to be in the series. To many in cc and lots of patches to respin all. -- Regards, Sudeep