Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp651195rdb; Thu, 22 Feb 2024 15:27:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWISFOzdEfCVgzKAVJCE3b5hfHvW6c3qCY3OYOPLtmyyBQTSuZJJnsw6DY6OZzl6I7ZekGZdnFg4O5ZCcAbJBjp2P5FvzTYGpqWr+5/eA== X-Google-Smtp-Source: AGHT+IGaykMfb59ZX7D0Ch+wuScFO2x7RMOIia0gqaZBvZSLMhuWDNYTIAe/hM4QLH5Gk85neU+L X-Received: by 2002:a17:906:5f99:b0:a3f:b6a4:8878 with SMTP id a25-20020a1709065f9900b00a3fb6a48878mr175647eju.40.1708644462997; Thu, 22 Feb 2024 15:27:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708644462; cv=pass; d=google.com; s=arc-20160816; b=vATcOqHaV+MAkozzqSG/92em/poxd3GF6AqDVh/CpO3OVMx1dvSeGNWVd6kuoES7F1 OlJqSzXQ+5HPFYv4QVa7kUbRu+L47+epkp3vwDgGkYWONcYut6gnw26w6wuzPA3RQpM7 5PrqzJWJnQE5pL8XLAykIfDgNsUlKm3HLslxXWP3ouefIXZZkXdf/aOEHiZWHeaqiVSj Dkn3qtgBfyz5Y8LWNZU/RpvROxAq7UWvu11R5ROsML0MyH0uJ9K44B3hyqrVB9LOc1jJ jtTd0yCNWtSXmVq73b5IXd+axflWkRAgATlgURoyXGYHUWCd2qZR9CV/xnqDUZIe16Xr Dokw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:date:to:cc:from:subject:references:in-reply-to :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:dkim-signature; bh=Y6o9VsjyTfZlt/ma3RPwq/TFdMyO1XRt/4IORTwFDy0=; fh=1rVZO/c2j04whdvEHZ8Dh/8kVECTju9nsK2q+xklBp0=; b=ZEQsPDXEbGscst0LhX231y3unpEDMI2evaqQgllTf08vFz9qEpBGCljscsHY3MRMp4 kGsDr6ivrO6LouaBgg7MIdtAw/jM0x3MHAovOil7O4aKn/QWJDmNWnMjhBzxuFX7RRFT egx1SdTgW5V6S0f8a5yijJRlKi7JNKUURJ8rY/HozRgORuwGV6w+llAo9Vt2Zu/Ogmtk JrGiS4oI/lyL99uftzauoGVSLWg/8FO5+yCEr/o4AVGyWa+B4CHDOI45gDfn3sBUYvll hejxuDeDCcWCsL+k+8XEJiPB7M0wunntNfQt/35vIgglCO3qJxxtLwnM6HnXzhNOU3Mh 2hZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="L4/nyA5B"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77531-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m17-20020a170906235100b00a3e3c7a2e92si4988965eja.942.2024.02.22.15.27.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 15:27:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="L4/nyA5B"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77531-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A2ED51F24917 for ; Thu, 22 Feb 2024 23:27:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6541A13BACC; Thu, 22 Feb 2024 23:20:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L4/nyA5B" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 89C62137933; Thu, 22 Feb 2024 23:20:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708644052; cv=none; b=HEcq6ODCK1wWO6jw5VLS0nKKDFbcsTqbd6pR/QQmGi4yW5AB47LoavFztkiza8PMTECwaGQLUcmwjgWOmYUj2zB/+nkK8bIsgRPv4Zldmj8aU1DViKBflWR8MlcyWi5sqcD7NnJSC7OV9uP/G0Dck5gDaDtme4KprZa+8rehb8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708644052; c=relaxed/simple; bh=Y6o9VsjyTfZlt/ma3RPwq/TFdMyO1XRt/4IORTwFDy0=; h=Message-ID:Content-Type:MIME-Version:In-Reply-To:References: Subject:From:Cc:To:Date; b=SwTQR+A2PxdeBawb1EID2TL7qEEl21pShpnwxl5iZ2H8XY6vTdHm+blvmXIaBv6F6ip15ND0VoSgThJqHYj1424has7UfVEDNWCxuMmrqUUERt4tY8oafo3PQNJDcBof/FxqxbM8ybTU4hYApeSAgPAjRsyEMCfEhoRgbwAm7JI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L4/nyA5B; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E16C8C433C7; Thu, 22 Feb 2024 23:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708644052; bh=Y6o9VsjyTfZlt/ma3RPwq/TFdMyO1XRt/4IORTwFDy0=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=L4/nyA5B3xHgkBMZCAKK8tZodBCng8xc5aBKftryCDGHYUE4LwIywUXsACUZaSPkP a8eHL/07HPfMIgQ9cRwdYP3kqEt9m9Jd/6BzYYVo2VwQs2lCvXXOM/km7WKCyEt/Dz MeORyVyf3Sg86ZaPkelEmgUK+AICfFuKUMe0hsophLShjQwQosOm7gTPwvqbZYyNKZ GjnrIOb7IYMuWn9RFj6NBbe8zH5Tl8PU9FGgxhEl/Y9baO+1ih39j/jTO1xmvhmVj4 OzXxd/b+G7Yz7X6kcXapWS33amTt2jJQiW6nFl9aDDBnbnsgspbm2rCGFa87AupdKf oAU4tLbfeS9PA== Message-ID: Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20240126201433.1830600-1-jan.dakinevich@salutedevices.com> References: <20240126201433.1830600-1-jan.dakinevich@salutedevices.com> Subject: Re: [PATCH] clk: allow to skip clk_core_req_round_rate_nolock() From: Stephen Boyd Cc: kernel@salutedevices.com, Jan Dakinevich To: Jan Dakinevich , Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 22 Feb 2024 15:20:49 -0800 User-Agent: alot/0.10 Quoting Jan Dakinevich (2024-01-26 12:14:33) > Calling of clk_core_req_round_rate_nolock() can be time-consuming in a > case of deep hierarchy with multiple dividers/parents. But if the clock > already has exactly the same rate as desired, there is no need to > determine how it could be rounded. What exactly are you trying to avoid? Is this an optimization or a bug fix? TL;DR: I'm unlikely to apply this patch. I could see some driver implementing round_rate()/determine_rate() in a way that rounds the rate passed in, so that even if the rate is what the clk is running at _right now_, it still wants to change it to something else, or at least call down into the driver to call the set_rate clk_op. Applying this patch will break that. The contract is that clk_set_rate(rate) =3D=3D clk_set_rate(clk_round_rate(rate)). It doesn't look like anything needs to change.