Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp922078rwd; Tue, 13 Jun 2023 02:09:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ax58f443qNAgVIhgigmaQ3iZ1rqKG8/RNIN3HTXF+U7UHVSz6mRff1m4vpMNsNVAGK/PJ X-Received: by 2002:a17:907:7253:b0:96f:9cea:a34d with SMTP id ds19-20020a170907725300b0096f9ceaa34dmr12659695ejc.21.1686647356390; Tue, 13 Jun 2023 02:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686647356; cv=none; d=google.com; s=arc-20160816; b=rr0nqsGCY8rsyHP0/hcIOH77K+e+M1SeQT/PhEuw5PpplWxStZkmrei8k5SnxLqbXC GAz5Dq1c47dvtXO019RbAkVTd6UroHoyMQSe1/RQz1cTKB9qa+uBIe87FQ1ioJUaaFDG RrCy4A0e9nCAO4uEujNlXnSNVzXBkxWaJGIHYHObMN3YLoBrkfiNRHavc1NohZ1ojKn0 cdZClkotFvQ7GWJaixqLwvfhIdlL5dAigM0IoylsN3UL5HFqv0YLlXkzSP6NyZ7qgbCU 0jF2/chz8G68xJHe9ilS8qPbhwPpglc/oE9kEm8XmirIYOU9rz7i/Ee3juIamBekKlos 06pg== 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:feedback-id :dkim-signature:dkim-signature; bh=/CdbbkQw2JgvECapcYhzDdCpNmrXlO/cyqRMfqJjWFQ=; b=H+OEV5XNnrtoYHQZmSW5Ri49MgE2vyHuDYv+KQ0eIK9VARS8Tr3Cz9dSfXSE3ZBeKR iKQ5kQcJM+vvvIlhB2cE/jjiUHX1Y+rHDXQL6/BDT97ufFJDU+DflO/uJtR67Sb43UW2 ZVji74j+YxKPm6I92OPWzV+dS3kGdLxdT0H5/Nb9gPXuJKMTkzpGZ137n7z0yr1EgseR XbUNathXbZg1YJkTpFo6kyvM/nUkcqb9TLi9LMQVpQIFE8+TElwe753K4v8e5n+5B+nP JRXMIf3Jlm9mZ5cMU4f/FpTImUFr/C7yMjRV2Rxtim3F44z1UV7958ggBDj3tL1dLAj2 FjVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=ns8G9UmR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=DVcPvl6v; 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=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz22-20020a170906f2d600b00973771bddcdsi6737897ejb.685.2023.06.13.02.08.51; Tue, 13 Jun 2023 02:09:16 -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=@cerno.tech header.s=fm2 header.b=ns8G9UmR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=DVcPvl6v; 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=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240545AbjFMIXr (ORCPT + 99 others); Tue, 13 Jun 2023 04:23:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235114AbjFMIXp (ORCPT ); Tue, 13 Jun 2023 04:23:45 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4F81AC; Tue, 13 Jun 2023 01:23:44 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4CC125C00BB; Tue, 13 Jun 2023 04:23:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 13 Jun 2023 04:23:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1686644624; x=1686731024; bh=/C dbbkQw2JgvECapcYhzDdCpNmrXlO/cyqRMfqJjWFQ=; b=ns8G9UmRINxWqsG+A/ 56bLukbhzJVd2XOQEgXFwVwHDUxB7JKJdwTQfUOuEqn+eli2+/dB7r5b4E4WzX/q FfgMIwdcv6QSD57QuQtHnEUmCCo55NTvlfR2r/w/LARkXMybgbOCLUMlOore5wyy LkZgClN/MH3JPc+LS+I0Zh0b/Jt05uqBaNCtCgWnqjXe71Ja0N4P6k10kSbTz6vT BXXrDyCwTTkkjGpFL/btQlJgyF/nDX/nt9x4JKfs9mXvYtdJHTnPRGF03RmnE7wg MsHuMkTgtUCYgkabgpU2h+hlEBTbhQoI9WCORU9d+ytMZt6i3sOwQSEQ6+ejaTdh Yz+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1686644624; x=1686731024; bh=/CdbbkQw2JgvE CapcYhzDdCpNmrXlO/cyqRMfqJjWFQ=; b=DVcPvl6v5rSDVR/UPtFzDzPUS9dEH sRp/SqgGyFoTHzrMQNDGoXhKKbKspjaRw8VL+WFDe8TCgqCQFQXsMJKsI5gNMJ7S BFxdu9pfIBD6+y/0LaQPDhG6hWM54QNtU+3BcpUCtlt6S2hDG39afNiCj/X7AEeN lrELR4FYsJPPeSkLnXC2IA54aIEAe8Dib+LOJzJ3x6uY8AMVjYCvqzl/cHHcqkWY hkEIzlsEl6BS874LX8ngrXH3jurQz8sFAYolzqMjH0mT+CCWgsMi9EhuCrPnBsHK 8pgdiwX/DrCSY6wAzNWYU7CDEMghWKP9VMJMwt0GMYDvIYvFWaafLC9cA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeduiedgudefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtdfsredttdejnecuhfhrohhmpeforgig ihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrf grthhtvghrnhepledufeegudehveeljeeigfehtedvffehjedvjeevhfduueevheeuvedv veevueeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Jun 2023 04:23:43 -0400 (EDT) Date: Tue, 13 Jun 2023 10:23:42 +0200 From: Maxime Ripard To: Adam Ford Cc: Fabio Estevam , linux-clk@vger.kernel.org, aford@beaconembedded.com, Abel Vesa , Peng Fan , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , open list Subject: Re: [PATCH] clk: imx: composite-8m: Add imx8m_divider_determine_rate Message-ID: <7j2zd5aszxenphluy7weslzrjkg7nglymcukxxv2xhbt3z2lql@qifooseclzy6> References: <20230506195325.876871-1-aford173@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="nwyrv6kg3riqg7ne" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 --nwyrv6kg3riqg7ne Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 12, 2023 at 11:11:21AM -0500, Adam Ford wrote: > On Mon, Jun 12, 2023 at 11:08=E2=80=AFAM Maxime Ripard wrote: > > > > On Sun, Jun 11, 2023 at 12:02:42PM -0500, Adam Ford wrote: > > > On Tue, Jun 6, 2023 at 1:45=E2=80=AFPM Fabio Estevam wrote: > > > > > > > > On Sat, May 6, 2023 at 4:53=E2=80=AFPM Adam Ford wrote: > > > > > > > > > > Currently, certain clocks are derrived as a divider from their > > > > > parent clock. For some clocks, even when CLK_SET_RATE_PARENT > > > > > is set, the parent clock is not properly set which can lead > > > > > to some relatively inaccurate clock values. > > > > > > > > > > > + Maxime > > > > > > > > Unlike imx/clk-composite-93 and imx/clk-divider-gate, it > > > > > cannot rely on calling a standard determine_rate function, > > > > > because the 8m composite clocks have a pre-divider and > > > > > post-divider. Because of this, a custom determine_rate > > > > > function is necessary to determine the maximum clock > > > > > division which is equivalent to pre-divider * the > > > > > post-divider. > > > > > > > > > > With this added, the system can attempt to adjust the parent rate > > > > > when the proper flags are set which can lead to a more precise cl= ock > > > > > value. > > > > > > > > > > On the imx8mplus, no clock changes are present. > > > > > On the Mini and Nano, this can help achieve more accurate > > > > > lcdif clocks. When trying to get a pixel clock of 31.500MHz > > > > > on an imx8m Nano, the clocks divided the 594MHz down, but > > > > > left the parent rate untouched which caused a calulation error. > > > > > > > > > > Before: > > > > > video_pll 594000000 > > > > > video_pll_bypass 594000000 > > > > > video_pll_out 594000000 > > > > > disp_pixel 31263158 > > > > > disp_pixel_clk 31263158 > > > > > > > > > > Variance =3D -236842 Hz > > > > > > > > > > After this patch: > > > > > video_pll 31500000 > > > > > video_pll_bypass 31500000 > > > > > video_pll_out 31500000 > > > > > disp_pixel 31500000 > > > > > disp_pixel_clk 31500000 > > > > > > > > > > Variance =3D 0 Hz > > > > > > > > > > All other clocks rates and parent were the same. > > > > > Similar results on imx8mm were found. > > > > > > > > > > Fixes: 690dccc4a0bf ("Revert "clk: imx: composite-8m: Add support= to determine_rate"") > > > > > Signed-off-by: Adam Ford > > > > > > > > > > Peng / Abel, > > > > > > Any suggestions on how we can move this forward? Looking at the > > > clk-composite-8m driver, imx8m_clk_composite_compute_dividers uses the > > > max values which is basically what my patch does. There was some > > > discussion about making determine_rate mandatory for muxes[1] and this > > > patch should help with this in addition to making it easier to sync > > > more video resolutions on the 8m Mini and Nano. > > > > Those patches have been queued by Stephen for 6.6 :) >=20 > One of the patches in the older series was reverted, but this was to > address the patch that was reverted. Was it? I haven't been cc'd and it doesn't seem to be in -next either? Maxime --nwyrv6kg3riqg7ne Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZIgnjQAKCRDj7w1vZxhR xeECAQCW6BrJCTYOwaTtOLoq9I6KrLKDuhOEnpgjdPNxMnDiMwEAm1AJbnoZRKG+ 3MpnJ+ukedK/884Qm9erqEyS+2oQxAo= =HR4v -----END PGP SIGNATURE----- --nwyrv6kg3riqg7ne--