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 40E8132C942 for ; Wed, 29 Apr 2026 13:55:46 +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=1777470947; cv=none; b=E0nlrO0N5IfgyCth3cGjGsb0QLAbG2RmQeeakfqNAjk2O/ed2xIjzSfn92oIikYCJy9nYXMWhaAbNZrXUnf23ZBB1JV/nVxcYM4LnrXT1HzRspnOeacuz9IJQLM4RCuACrXGVgW24bA5N4/2fvnEGUZ/G2W69xtgWDq3PbD4/ts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777470947; c=relaxed/simple; bh=buDqtxL5iiA+P59BL7gOogsMTPfTAbw/6u3MZ3bRXX0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TYDrNFPW8vOK7Ifd3qzdD3NWVD5TNgb0ohtgBazE98w/0DH1GSIcr85Y86E1R1QnjUi7DDZ1TPUrUArI3LP9z/9RRXiOOsMHbFJcGRQLEXnhIfelNPDVrvgucTyVtWOhcgZAWwdrb4BFckQdLM4c+WTjsDHXjlz4GQ9Wpuk48AI= 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=aaye5le9; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=aIpiukdD; 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="aaye5le9"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="aIpiukdD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777470945; 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=E4gmtst5bATy4vi+nqQOmDuupzzNRv5w7Vbola4ydK4=; b=aaye5le9VF60v6sPq4CiCo/9qzuijopOb5flH3s2LuBRfAMvPzMGoAoqOxQUO0Mah2s6I7 xZwl9Rt/ndjWlsIfBeDqIBI5tNcIpm5MaQnpq6TY6iuFhvQPjgIjN4ZmdwPGdTCf/gn/hW 6NQxs60dSSYqLLlGdFhQxLqCDm4jyOA= 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-111-JgH63f3oMXKxfvNwrou03A-1; Wed, 29 Apr 2026 09:55:44 -0400 X-MC-Unique: JgH63f3oMXKxfvNwrou03A-1 X-Mimecast-MFC-AGG-ID: JgH63f3oMXKxfvNwrou03A_1777470943 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-8acb85a973cso179568226d6.3 for ; Wed, 29 Apr 2026 06:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1777470943; x=1778075743; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=E4gmtst5bATy4vi+nqQOmDuupzzNRv5w7Vbola4ydK4=; b=aIpiukdDtwMfeu5U8x7pAWQk1igCGTDDEl1VOIRCChHAvLkCYOLBCQMfizk5Wc6fa1 GOG7IQiJq7VDTj0HSc8ckVqTRf1S3/KpuB0/d32uzyX0YHIZtw7RBZqAx+ZKrN4UVTfo Wk1sSJ6utW7+ydSYNVH+UhTbbxJlUjVTI7IZn1ILhR0IfiXHZB5FK1FPmbY826fn3LT0 VwS6vJoA4sAMMTPJlEBvIFwXLFoDtJDwsQN34h9RA3ZoKjoIjywy/A2laQ+5cpldXa7L yxl2MXhjHWhVfwRurbF3kN1ap7u0rixf/xvcabi7NTBsFk9RW779MIc6azHgnNL/kLMM gDcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777470943; x=1778075743; 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=E4gmtst5bATy4vi+nqQOmDuupzzNRv5w7Vbola4ydK4=; b=Y+uBKPFDUIpAJ88b7+Kin8CfUsPOQTmwHMLEIcrgoywOF67MwKCtVD50q5nw2gY7tz cwyBD1gV423nIIW50BCxRe8U7UYRoMJ9f5ujBnTeogUQTQwaz80iNofB4Bsm52N9LZDV ehdZrhmWHrJhNuRIMaloZuI8AoMQOasHQxkfv9UFHskUGvrux9topevLh1InxVT0uGfa i5zTizj76GR8nDrh1rHdh+lYkasNWj7OzXPu5wvYzN7FkVJMrX4Y3UfB+lWEtJmixWDB oVQ1zMAhW/ZTAGCMat31CH471YrV0ghQORIx5o+KowgTvkp5sId+k76KQ1WUXDFWSP9k WcgA== X-Forwarded-Encrypted: i=1; AFNElJ/GWkx9uVps9ye5BdTIwOdiMGobKSpQX9KQEIzyJjKHd9tX7ZUqKDeDLXpZMGpQSql3J5DaV1WjDk0=@vger.kernel.org X-Gm-Message-State: AOJu0YyJwLKTQr8UOwA2v6pDKeJ+iA4gB6T2y8xleEHIuERAr0Si3jZi piGzULGP3VT0qYEzin9/lTDeW8UAkzcEErYV4l3ap0xn0y+GUcJXPcf3tWtJOmLTEnsziVHpjB7 nfgsMMsRAx5XUIII3vaJrG1/wH3EFlrEZXJp7VV19kBQxdUC3G1K/rkWCt/QGUA== X-Gm-Gg: AeBDies7oxWPHSMwrV7nRJtVRXTd1CchGJ2lHYSN/HcGdyVyFTe2R98ATqaokHWd4P6 jhVbUtSmtMuUkXQxu/BLzdXKdcZ0wR/UmHuhiXLgI0xdfHQm13/d59Gc47Lb+AgSzpN6yjGJ5oT SxdONcrh2E1icn3z46PBwKhTLFZ0ZuC32H4CR150v8nO9RH+C+w+WyUV+hpUiDTuErSB8UOwWOC YeySvxtmhEtYIS2hQAJUnXw03b7ONlfQPGNszJOivHi8++g1r8JbWy9v0Z5wMTohR3Luwur+4ff K8L3fVXprhNT7fJ+RkWFNTJwpQnkS463ow1BuitWh0tTGMOqHhfWXq1vybSkayN/9DZBIOemVFb h2/BU/OVHFXJjcFYNts8kSbCgoagPWfjD0vomRmYrXm7BX1PBQf4XFGVp8Ue04OZYNNc= X-Received: by 2002:a05:6214:600e:b0:8ac:aeb0:2eb4 with SMTP id 6a1803df08f44-8b3ede04448mr57443736d6.45.1777470943488; Wed, 29 Apr 2026 06:55:43 -0700 (PDT) X-Received: by 2002:a05:6214:600e:b0:8ac:aeb0:2eb4 with SMTP id 6a1803df08f44-8b3ede04448mr57443326d6.45.1777470943011; Wed, 29 Apr 2026 06:55:43 -0700 (PDT) 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-8b3ef86e2f1sm21005096d6.48.2026.04.29.06.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 06:55:42 -0700 (PDT) Date: Wed, 29 Apr 2026 09:55:39 -0400 From: Brian Masney To: Stephen Boyd Cc: Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Sudeep Holla , Abel Vesa , Andrea della Porta , Baolin Wang , Bjorn Andersson , Chanwoo Choi , Frank Li , Geert Uytterhoeven , Krzysztof Kozlowski , Orson Zhai , Sascha Hauer , 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 v2 01/12] clk: add new flag CLK_ROUNDING_NOOP Message-ID: References: <20260309-clk-det-rate-fw-managed-v2-0-c48ef5a3100a@redhat.com> <20260309-clk-det-rate-fw-managed-v2-1-c48ef5a3100a@redhat.com> <177742893645.5403.3938693995862346406@localhost.localdomain> Precedence: bulk X-Mailing-List: linux-clk@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: <177742893645.5403.3938693995862346406@localhost.localdomain> User-Agent: Mutt/2.3.1 (2026-03-20) On Tue, Apr 28, 2026 at 07:15:36PM -0700, Stephen Boyd wrote: > Quoting Brian Masney (2026-03-09 07:38:40) > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > > index fd418dc988b1c60c49e3ac9c0c44aa132dd5da28..1187e5b1dbc123d2d2c1f43690d7dcf75a7c4ac3 100644 > > --- a/drivers/clk/clk.c > > +++ b/drivers/clk/clk.c > > @@ -1673,7 +1690,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_noop(core); > > } > > > > static int clk_core_round_rate_nolock(struct clk_core *core, > > @@ -3528,6 +3545,7 @@ static const struct { > > ENTRY(CLK_IS_CRITICAL), > > ENTRY(CLK_OPS_PARENT_ENABLE), > > ENTRY(CLK_DUTY_CYCLE_PARENT), > > + ENTRY(CLK_ROUNDING_NOOP), > > #undef ENTRY > > }; > > > > @@ -3906,13 +3924,19 @@ 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_noop(core)) { > > pr_err("%s: %s must implement .determine_rate in addition to .recalc_rate\n", > > __func__, core->name); > > ret = -EINVAL; > > goto out; > > } > > > > + if (clk_is_rounding_noop(core) && core->ops->determine_rate) { > > + pr_err("%s: %s cannot implement both .determine_rate and CLK_ROUNDING_NOOP\n", > > + __func__, core->name); > > + goto out; > > + } > > + > > This hunk has me irked. I'd rather we export some function like > clk_determine_rate_noop() that just returns 0 instead of adding another > flag. The chance that someone can get it wrong goes down and you can > naturally grep for any clks that are using determine_rate() without > having to also include this flag in the grep. It makes it easier to > reason about as well because we can have code that just checks for > determine_rate presence instead of both (i.e. clk_core_can_round() isn't > changed). Plus a clk_ops structure is more self-contained because it > doesn't rely on the clk flags to go with it. I also like the clk_determine_rate_noop() approach much better as well. I'll send a new version. Thanks, Brian