Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1882117rdb; Tue, 20 Feb 2024 09:38:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUNOqgy3CRHsjv3wylC0+ScMLhkl12C8SkIztgUr9L0tQS6P6nsmUdyHFgXQYsNts0kDfbKAbTnGUisL/CuWOz7n31OEZC3ps35oCSrSA== X-Google-Smtp-Source: AGHT+IEmMXrgXD6/eM2OwkBd0k+IXSe4l4DZzvTz7pSLTbFuB3qsSkpWsU7AyccmWwimFxj/B6Tv X-Received: by 2002:a05:6a20:d485:b0:19e:b37d:bdb7 with SMTP id im5-20020a056a20d48500b0019eb37dbdb7mr24535037pzb.19.1708450706619; Tue, 20 Feb 2024 09:38:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708450706; cv=pass; d=google.com; s=arc-20160816; b=e+xhTZTSgkeAjJQBnaeejVlrOhkxqDLWlz853giRURw4fTA7ufGzW0IFA2XWsYuGUm iqQIhoUGhmD1qlsJRFucJBQB9zJ5fMaU/pkHJ6fPt5BigTr9QsxgwWSWQ6V3Y9eKrafi XxSVY/jC/8TJxzF5eWIbZ9jOHEjKf6Sfwr7K5FBORmCaKQFtEZ/RjZwGPtCpMSRQimFw M3k3ZSTSxP4fc0JGhyuSNV+dfkNtlo1t9OMtmC0sInUqgvbrDa/lVmSN7fD5bEzGQhCM hZifvE8CF9k4ffG0aNAR0xmyUpGhA9bE37ukAn+PNwKgolbOHClndHymXphDLl9bFjPQ en2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-filter; bh=CT2QMXS2awc1UaugLcYawqtrm8RuYnHBK31jT43QizI=; fh=fRBML340f+bMStcl/PzaFDwaPSi0OPr3zsmun9/i2Ns=; b=yBx+uAWdiMXFs+ZulhaU9sRC+2yovnbSoKRW1NafD6DShRIRJNCYNQQfq4BI1dIRTR 1f2rMS9aQB12k+7BLMw44VJ/qCU7Vp0VefbZZ0d5490M+tmqCs8C1H+1AbkR8qjy8CA5 dOUTatFL985ojVev0iA+2gEld9GCnJhVI5vJjaQFOHzm2B7CZtKjtac8I3y0O1MFiU+u 2yIh8kv1T+lsAlHucRvqPVWRC1NO8sKtQsb3+dfqB7J0gLIQVQ1SXNpzzG2vpVtKzSzL +S8l0n9O45lWR6hW3FkIYORCRqd8o1A7x0zkg4s6JUwkxmUAlMjvCZ94F9bP6m3WZk+/ 9lNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=NMO8NtBn; arc=pass (i=1 spf=pass spfdomain=sberdevices.ru dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-73453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r201-20020a632bd2000000b005d553239b15si6450667pgr.493.2024.02.20.09.38.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 09:38:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=NMO8NtBn; arc=pass (i=1 spf=pass spfdomain=sberdevices.ru dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-73453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 19A5CB22ACE for ; Tue, 20 Feb 2024 17:36:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6FE977622; Tue, 20 Feb 2024 17:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="NMO8NtBn" Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) (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 7D5D476C9C; Tue, 20 Feb 2024 17:36:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=37.18.73.165 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708450595; cv=none; b=Fecn16lq1PbIcfIo+Uy6zOas08rqhU9J3PbUIQhfj+tS9Up+zNPlImqTnc2V7KHvtkvmCqpD9A+o2qy8wOzuAWb6v82+r/d5v8mcYIrmumIsheIa63dAj51typJBzMaHt8ke/VaNJ6VsRfBfVgv9c0QYewHYn+EsRRjjmAo05jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708450595; c=relaxed/simple; bh=cmTEJiha2tFDubjqRfGi+KdNyZivDUyjm8JbT+qL5uo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Fd7yUt1K1RV4WwWm8rav8eZkBsjhBJopH3XV0mOxV2S5b9SeTYb1IL8SXoz3LJEo6KmFyX6vEAOoJMg+mAiWrNOjn0oTI9Be1knAAUiV3LEC2R4vZF33QAciOwDIQraK2ld0+Ou5qLzrjPr8O+XYP/uRx6O9ZKNmLSv7sB7JIKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com; spf=pass smtp.mailfrom=sberdevices.ru; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b=NMO8NtBn; arc=none smtp.client-ip=37.18.73.165 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sberdevices.ru Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 3789F100322; Tue, 20 Feb 2024 20:36:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 3789F100322 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1708450582; bh=CT2QMXS2awc1UaugLcYawqtrm8RuYnHBK31jT43QizI=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=NMO8NtBn7IkhhTHIh+4qe3rb8AJgePA80AUDKl2Jh0f9msCkzvOsYcsI+orVuKYw3 KkLezKeEuOlsZzYNQC788a1Lg/g7HHZxF4VTu5Ic6f/RF2zobGj0JpUBj5H+k+aE0b c0WwZ+scGjZcW4Na2zSk2Rir4nWJWLiGiamhMCaHIa3KHh3Ivjv/ZRoyBGIgwe7VwO jqIsOmbFPWRpsESeF0mxOq2Cu71rHvsb+TfEOcl8jdN0He0SBwzf60QcyXy0Q1HVWk CpeSnvelkUGEDXQYp1IVVzXLNxH9+nRQVWgo5EtfrxRChM2ikxbUzDuaaI3jx58ZlS vKQr3zKgkpMfg== Received: from smtp.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 20 Feb 2024 20:36:22 +0300 (MSK) Received: from [172.28.64.15] (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 20 Feb 2024 20:36:21 +0300 Message-ID: Date: Tue, 20 Feb 2024 20:34:52 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] clk: allow to skip clk_core_req_round_rate_nolock() To: Michael Turquette , Stephen Boyd , , CC: References: <20240126201433.1830600-1-jan.dakinevich@salutedevices.com> Content-Language: en-US From: Jan Dakinevich In-Reply-To: <20240126201433.1830600-1-jan.dakinevich@salutedevices.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 183586 [Feb 20 2024] X-KSMG-AntiSpam-Version: 6.1.0.3 X-KSMG-AntiSpam-Envelope-From: YVDakinevich@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 7 0.3.7 6d6bf5bd8eea7373134f756a2fd73e9456bb7d1a, {Tracking_smtp_not_equal_from}, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;127.0.0.199:7.1.2;sberdevices.ru:5.0.1,7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;smtp.sberdevices.ru:5.0.1,7.1.1, FromAlignment: n, {Tracking_smtp_domain_mismatch}, {Tracking_smtp_domain_2level_mismatch}, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/02/20 16:18:00 #23712592 X-KSMG-AntiVirus-Status: Clean, skipped Please take a look at this patch. On 1/26/24 23:14, Jan Dakinevich wrote: > 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. > > Signed-off-by: Jan Dakinevich > --- > drivers/clk/clk.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > index 2253c154a824..04f0ddced932 100644 > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -2423,6 +2423,12 @@ static int clk_core_set_rate_nolock(struct clk_core *core, > if (!core) > return 0; > > + /* skip calculation of rounded rate if the clock already has exactly > + * the same rate as desired > + */ > + if (req_rate == clk_core_get_rate_nolock(core)) > + return 0; > + > rate = clk_core_req_round_rate_nolock(core, req_rate); > > /* bail early if nothing to do */ -- Best regards Jan Dakinevich