From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29AA73E8C79 for ; Fri, 27 Feb 2026 14:45:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772203504; cv=none; b=Sl7aKpiV785bWORmcX0NuNMDp8PMUjWyPy1nGxZ8o2fJKMko3ISZyux92dKb0yAkyQhzx7Q69Fpg49tUt73EO2fZy7VjvgJD7YxL3CCl3Kan8uyOi66g4alf5saF4lX8LJefqvN2V+ou/vrT/jNvzpte6HZyCfAq3QmJoJCtjnA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772203504; c=relaxed/simple; bh=eQ7qXAOyj81yfe/+OeMnHJ4AQMCfEecRpWABhPohsPc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: In-Reply-To:Content-Type:Content-Disposition; b=oJj6/pROQK4kvQ7iOz2GZaXYs+tnqukwQNRU8lrvDZJwPoYKSpOAaLwVVU//QxTPi9rQKtCom9svsSdKHPZdDEYKn1jzkmOkmKrs7fTvfTRU6NyA596gThHORcCYK8U9ffnmVkj0PyBD0njP8fBAVbj1ozjP9hZaQFXzDLqzJKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Uua0fC8f; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Uua0fC8f" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772203502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pjpP6CrvDx4JRD336SFvsZfBjEjd+fqZc06LPodyXOg=; b=Uua0fC8fsiwn9RWG5DaRKfjOcJvXQwSOYIHFOiqLtwaFGksJ1pqx2f6uR9Ddt8n4lCzO41 JLRy5n/t154LbGmfUlabxckKm2xSgvGvuXxu2a5QsHIuOCmkvSo3dtedKKR9tKD/eY58c5 l54cVlJjVhVzwtII4SSM55yOsqzuqVE= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-dDbU4F0OONSZcE9QaOrUyQ-1; Fri, 27 Feb 2026 09:44:59 -0500 X-MC-Unique: dDbU4F0OONSZcE9QaOrUyQ-1 X-Mimecast-MFC-AGG-ID: dDbU4F0OONSZcE9QaOrUyQ_1772203499 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-89546cbb998so201880846d6.0 for ; Fri, 27 Feb 2026 06:44:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772203498; x=1772808298; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pjpP6CrvDx4JRD336SFvsZfBjEjd+fqZc06LPodyXOg=; b=oKQFym0hZMJvAltaR3G/x4xC4sWYS2rHgNbqRzelZtaFgEZNv/KOxyeQxt/+lpoy34 HvyignwqNO+M6jua2CNnNvehFr5jMXpwGColcfg4013V5eUCKGKwFcO6W6wUXAIeuZry tjkXk+3uR5zz+3aHXUXqf8BwxVuxY3GkJt29U1E11KXKlGz8vJqD321E9Jtng5QqhJAT m5E7DKzO+8CjLYxaDGtjao17g8uScqgXmzXcQtT3xNN0IHjW02Qg62pN0475v1Qj6OTX XwT3IG9gXHkeHuZRmPTI3bxl0Bj0m6EpOYYVxb8bHT8jOIJjMFAE2GTN0v8dDB95Fnte uxog== X-Forwarded-Encrypted: i=1; AJvYcCXiuFoHHLOIH/FPy2XpbacfdCWMyk0TmMZ46F8XF0lepVVqZ1jltLWU8A1fBnmHtO/mnQU=@lists.linux.dev X-Gm-Message-State: AOJu0YwwsnaOzNl0u1+9rKLdCYgsNt4h8DzVa6sdwHWrfnOPwV4Q8MlZ Q2Z74dSI1W807xcbbKDcv09HN5aQ6rEotLnKMXYP76/tWcBSRb1U258lyKh+YZ3Z/l9OkVRecW3 v0EDdcq18BZvzqdOPcP1s5rDbskshlJmhFslbCpOpxDRnGiLgC4kg9Q== X-Gm-Gg: ATEYQzz6ChUMbHvRiaFtvRzMicxfOGux1ZHWKC5hATcdQWt4O9O/9Np7iUkKW+xQq8y AoMcWxYdgtzhkeNKqkZlzKetqv1u1LOkQvT9Ssl1N+ArP9DRpcHdR8/S2FNT7hWQ1XVBr3N5Czq 3Wez/LW6+qEtOVxb0o64ULsRraUH9L4V0yCo6ro/0iZaKGFIKrv24BWnZhdjufYptUvYCn8OM7j T1+Lh4ail/rwchpcM2Rent4Dv/qvjx05njxb4fkO6IfkNYm2t09QJQUMv32IcnoHPm+vGDCbMnG iKtJPELOZVfOuzmBlFym/UZ/Awe0VCzHNLZo5HHiJ17+Dm/j2UUcXspPM9mkRUX5UOApq3znqJe d9DQ+2e3rnX/ZnimiTfFua1nML4tt0GK6/A0aNPrbVvN9b0FZ5WUCl6sE X-Received: by 2002:a05:6214:2481:b0:88a:2360:7f15 with SMTP id 6a1803df08f44-899d1d86467mr45187686d6.12.1772203498554; Fri, 27 Feb 2026 06:44:58 -0800 (PST) X-Received: by 2002:a05:6214:2481:b0:88a:2360:7f15 with SMTP id 6a1803df08f44-899d1d86467mr45187146d6.12.1772203498037; Fri, 27 Feb 2026 06:44:58 -0800 (PST) Received: from redhat.com (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899c73a3130sm45123526d6.49.2026.02.27.06.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 06:44:57 -0800 (PST) Date: Fri, 27 Feb 2026 09:44:55 -0500 From: Brian Masney To: Biju Das Cc: Michael Turquette , Stephen Boyd , "linux-clk@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Abel Vesa , Andrea della Porta , Baolin Wang , Bjorn Andersson , Chanwoo Choi , Frank Li , Geert Uytterhoeven , Krzysztof Kozlowski , Orson Zhai , Sascha Hauer , Sudeep Holla , Sylwester Nawrocki , Tudor Ambarus , Alim Akhtar , "arm-scmi@vger.kernel.org" , Chunyan Zhang , Cristian Marussi , Fabio Estevam , "imx@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "linux-arm-msm@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-samsung-soc@vger.kernel.org" , Peng Fan , Pengutronix Kernel Team Subject: Re: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED Message-ID: References: <20260226-clk-det-rate-fw-managed-v1-0-4421dd2f6dc6@redhat.com> <20260226-clk-det-rate-fw-managed-v1-1-4421dd2f6dc6@redhat.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.2.14 (2025-02-20) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: EvsUkZgjc24MDKk-D5vs7Z1cR8eaKGaYQgoWIXy_bLo_1772203499 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Feb 27, 2026 at 12:00:55PM +0000, Biju Das wrote: > > -----Original Message----- > > From: linux-arm-kernel On Behalf Of Brian Masney > > Sent: 26 February 2026 18:17 > > Subject: [PATCH 01/13] clk: add new flag CLK_ROUNDING_FW_MANAGED > > > > There are some clocks where the rounding is managed by the hardware, and the determine_rate() clk ops > > is just a noop that simply returns 0. Add a new flag for these type of clocks, and update the clk core > > so that the > > determine_rate() clk op is not required when this flag is set. > > > > Signed-off-by: Brian Masney > > [snip] > > drivers/clk/clk.c | 24 +++++++++++++++++++++--- > > include/linux/clk-provider.h | 2 ++ > > 2 files changed, 23 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index > > fd418dc988b1c60c49e3ac9c0c44aa132dd5da28..0a522a0817411c7f7c6e9cffd6f024e672a331a8 100644 > > --- a/drivers/clk/clk.c > > +++ b/drivers/clk/clk.c > > @@ -1557,6 +1557,20 @@ static int __init clk_disable_unused(void) } > > late_initcall_sync(clk_disable_unused); > > > > +/** > > + * clk_is_rounding_fw_managed - Check to see if clk rounding is handled > > +by the > > + * firmware. > > + * @core: the clk to check > > + * > > + * Clks that have this flag enabled do not need to have a > > +determine_rate() op > > + * set, and will always return success for any rounding operation since > > +the > > + * firmware will deal with the rounding. > > + */ > > +static inline bool clk_is_rounding_fw_managed(struct clk_core *core) { > > + return core->flags & CLK_ROUNDING_FW_MANAGED; } > > + > > static int clk_core_determine_round_nolock(struct clk_core *core, > > struct clk_rate_request *req) > > { > > @@ -1589,6 +1603,8 @@ static int clk_core_determine_round_nolock(struct clk_core *core, > > req->rate = core->rate; > > } else if (core->ops->determine_rate) { > > return core->ops->determine_rate(core->hw, req); > > + } else if (clk_is_rounding_fw_managed(core)) { > > + return 0; > > } else { > > return -EINVAL; > > } > > @@ -1673,7 +1689,7 @@ EXPORT_SYMBOL_GPL(clk_hw_forward_rate_request); > > > > static bool clk_core_can_round(struct clk_core * const core) { > > - return core->ops->determine_rate; > > + return core->ops->determine_rate || clk_is_rounding_fw_managed(core); > > } > > > > static int clk_core_round_rate_nolock(struct clk_core *core, @@ -3528,6 +3544,7 @@ static const > > struct { > > ENTRY(CLK_IS_CRITICAL), > > ENTRY(CLK_OPS_PARENT_ENABLE), > > ENTRY(CLK_DUTY_CYCLE_PARENT), > > + ENTRY(CLK_ROUNDING_FW_MANAGED), > > #undef ENTRY > > }; > > > > @@ -3906,7 +3923,7 @@ static int __clk_core_init(struct clk_core *core) > > > > /* check that clk_ops are sane. See Documentation/driver-api/clk.rst */ > > if (core->ops->set_rate && !core->ops->determine_rate && > > - core->ops->recalc_rate) { > > + core->ops->recalc_rate && !clk_is_rounding_fw_managed(core)) { > > pr_err("%s: %s must implement .determine_rate in addition to .recalc_rate\n", > > __func__, core->name); > > ret = -EINVAL; > > @@ -3920,7 +3937,8 @@ static int __clk_core_init(struct clk_core *core) > > goto out; > > } > > > > - if (core->ops->set_parent && !core->ops->determine_rate) { > > + if (core->ops->set_parent && !core->ops->determine_rate && > > + !clk_is_rounding_fw_managed(core)) { > > > pr_err("%s: %s must implement .set_parent & .determine_rate\n", > > __func__, core->name); > > ret = -EINVAL; > > > After applying patch#11, I get a message as you removed .determine_rate, Also it breaks display. > > [ 0.096414] __clk_core_init: .pll5_foutpostdiv must implement .round_rate or .determine_rate in addition to .recalc_rate Thanks for testing. This happens because rzg2l_cpg_pll_clk_register() doesn't have the new flag set. I'll fix this, and go through all of the others again just to make sure I don't miss any others. Brian