Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1851398rwd; Fri, 2 Jun 2023 00:41:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7YKkzTK8etfRl7XzA0zhXAAFCc0cPswOm0anJkrzTFAPcwGtP0Ck5C2FLFsjhc3SktVWms X-Received: by 2002:a05:6358:9312:b0:127:8ab0:31f4 with SMTP id x18-20020a056358931200b001278ab031f4mr8945284rwa.16.1685691672718; Fri, 02 Jun 2023 00:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685691672; cv=none; d=google.com; s=arc-20160816; b=GtXC21G2afc4mPwT8rPXPLYIgKUEfAMsBEHavtz77NkZ3PPMe1GAjo6kJX9N9y3YSB rMcpEhHTcT6gufCI/8as+5jCa14FNR4HWgT9WZNd9mFt6TCGARZW0LXJHEVhBnQ3DTnu 7x9YX3xYYUs1FewwzwsWqu90eO8TptmFQxztUQMJ2V229VPvQdYkFD/eRx0PRKNTxE/f c76M0Rv3SeMiNf4vD0hAWFF/IH1GCFcYdTTwBTdvj5oBzZbXHbCSf3DE08T1jQboB6no EnFX9v8YoHImbVasIBjDiHFd2s5GqvovEnH/XyyV3DPaFKuX2/KdWxM6+uN3HqS3Xbii AIsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9mKK9xIT/M/5/jc96vgkpb/vVwKfqaNG0PLckzjbiG4=; b=VX+hLQQl7Z04athORJ0+plM+gjXyNXS3+hJS7FFvQFot2ptMe0wF0XccWUYFfwSR/M 413rv0OVgVtdh4CCympCMgEhStbvtf7l5x0QNezFATfxjb4wpJs13v8m0FgS6b3pi18c EoQ+AJDGYvUWDaUvEJlmuk+cYFHNxH2tzYtcS05M+PXKnSIiAU5DFnk5QwCb2z5QJkIM /CdWq63L/j/UA+LVQ+y7Ghd2AzLkcRzS6eL3S9Io20CtO4cgJhG39K1ZaMCVVbXT2ykb dpnoox468cKKHNw9V3UvWi4REl+LQWDoXsrtMTolh7Xh0WwHePWsa08qL0AJ3wdCb7MN ZqWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F16FgOCc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a17090a868200b0022c9cb7662csi2357488pjn.159.2023.06.02.00.40.58; Fri, 02 Jun 2023 00:41:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F16FgOCc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234300AbjFBHeM (ORCPT + 99 others); Fri, 2 Jun 2023 03:34:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234295AbjFBHeI (ORCPT ); Fri, 2 Jun 2023 03:34:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF4D19B; Fri, 2 Jun 2023 00:34:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 173C9616CD; Fri, 2 Jun 2023 07:34:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E88C1C433D2; Fri, 2 Jun 2023 07:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685691246; bh=9mKK9xIT/M/5/jc96vgkpb/vVwKfqaNG0PLckzjbiG4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F16FgOCcSPoEmt05v6oK+gE/WgeGCUBoueZaoq/VqkZdscoUAVuEVZnuUClN4ew/v Q2nOUi8xp/Ql3jqboZ0xVrYwINNEws3Pk2n3YJhhDVl7QFiNuRrM/SkuwTJYkF0NIE gUvNYg35gH5qJ25d1FRg/6okgyJ/+mR3W22YpU3G2Ci4JdMtUSLVi7XzkZRR9BBezg Ynhtsi8C/thkWiT51VYf6Yo0JvsfRFCm8P8m9RMgvyQ5ZpKSzNvDzlk8po+fGpHnJr zoGTeZ7YUh9G5zTEhXt1ecETeKaT8NzWQK5ur1R49ueGY3AdQXOtfDCkAYbHLJ/THD IvK4wfJpkr90g== Date: Fri, 2 Jun 2023 09:34:03 +0200 From: Maxime Ripard To: Jernej =?utf-8?Q?=C5=A0krabec?= Cc: Frank Oltmanns , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Andre Przywara , Chen-Yu Tsai , Icenowy Zheng , Michael Turquette , Rob Herring , Samuel Holland , Stephen Boyd Subject: Re: [RFC PATCH 0/3] clk: sunxi-ng: Optimize rate selection for NKM clocks Message-ID: References: <20230527132747.83196-1-frank@oltmanns.dev> <87mt1jbf18.fsf@oltmanns.dev> <4831731.31r3eYUQgx@jernej-laptop> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mepy56bihzsswzod" Content-Disposition: inline In-Reply-To: <4831731.31r3eYUQgx@jernej-laptop> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mepy56bihzsswzod Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 01, 2023 at 09:41:30PM +0200, Jernej =C5=A0krabec wrote: > Dne =C4=8Detrtek, 01. junij 2023 ob 07:16:45 CEST je Frank Oltmanns napis= al(a): > > Re: Why speed up factor calculation? > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > I'm not aware that the current implementation of calculating n, k, and m > > poses a bottleneck in any situation. Again, while going through the > > code, I wondered why not save a few CPU cycles by precalculating the > > meaningful combinations. In my opinion, it does not have any side > > effects, so we might as well do it. (There is of course the side effect > > of using a higher rate, but this is unrelated to precalculation as I > > could as well employ a rate comparison that only allows lower rates, or > > only optionally higher rates.) > >=20 > > > Clocks in general are very regression-prone, so I'd rather be a bit > > > conservative there, and "if it ain't broke, don't fix it". > >=20 > > Sure, I get that. > >=20 > > As I stated in my cover letter: > > "The motivation for these proposed changes lies in the current behavior > > of rate selection for NKM clocks, which doesn't observe the > > CLK_SET_RATE_PARENT flag. I.e. it does not select a different rate for > > the parent clock to find the optimal rate." > >=20 > > I thought that this required this optimization to be implemented, but by > > now, I'm no longer sure. I'll probably continue investigating different > > paths for CLK_SET_RATE_PARENT for NKM clocks and follow up with new > > findings. >=20 > Let's leave out any optimizations that are not apparently needed. Most cl= ock > rates are set only once at boot and others, like video clocks, not that o= ften, > so a suboptimal code speed doesn't hurt currently. I'm not even sure we can make that assumption for video clocks. We might for a panel, but for a more "dynamic" output like HDMI all bets are off and depending on the monitor, the user settings and the userspace stack we can definitely expect the video clock to change quite frequently. Maxime --mepy56bihzsswzod Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZHmbawAKCRDj7w1vZxhR xShKAPwNIDbWuVsfmQMaSWHoQcEXxKCSyuOn0P8yvZSBP9ukvgD+KAz6Y83cu2l3 Z/9DTMMbQ1AU1SWfM/GStx6AOU9woQA= =+40T -----END PGP SIGNATURE----- --mepy56bihzsswzod--