Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2854831lqo; Tue, 14 May 2024 11:08:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdnDg31CrRtHJi99bnDRyyGH36yiXUXGG4n9TKUKhFpPrj+T32HM6Z/pQ7j3mQrW+faQuina2SWIZxmaYpy0JZylmPLMbbJ9RaNvShbw== X-Google-Smtp-Source: AGHT+IGN80ShK5UAc2P8BYe+b/CWZbpnAGc5W819eWV0ml05ziYN25aRY0E265dalCML1xr3tYjZ X-Received: by 2002:a17:906:c78c:b0:a5a:1b60:7c9a with SMTP id a640c23a62f3a-a5a2d676415mr1227421966b.71.1715710092606; Tue, 14 May 2024 11:08:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715710092; cv=pass; d=google.com; s=arc-20160816; b=0eSCLsWG8U6cMA4gqDGibjJdPWic/ShIhUavBk7MlNC51GfIaSdNVpyK29SgwYVzX8 7F7mmgEdyMjws1dtBWhNJ61go94MtixwekAaHwcyeckECPUW5fL7hy4bD68oQDeEi1VI TjVOD6wMBF6pZscCnOLDARCssBWF0LeHVW/rBQLSSso82ivE1EZS+TvhEamFZmCb+GUb wwTqA7BS/DSkC10F2uGbTqL3SASKuFcAInXU/DF6Yu3kU+W/z+RX+gpLwI7SpQA494iP R9lAv0gB2t9jqVISw3M6679xO9/JxQCjhVEVBfwliLXXBlGQJQduCkLZOeH9S1IvNXEy idFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cbX8GqhX/BZI3INfM/Qv8VnQNKKluIjMW+Q960sJgIs=; fh=zpo3PxtZ7H6tYlWL1/5ogQMlb4nSWQ+5nyW5TFqQmdM=; b=KCN+73ldND0QtHkpk8kOXQCp/RoAmAef1r7tk6Zoy6vHQjLBIBErn5b1GEoifwwtH+ 5/AqOUmH0bHhx0y9r5Qklaz733oIftym89aR/hHsHBZiwEJHVMAt3RwhvCV9ZQ8B1eNt G6Uw8urk7cl2GGOqM38wU2w0Ppc3u6d/UgHVqGdActjMSQFRx80fx07FRJ5zlKYdj2t2 JK3le2dJ3UbM95bQFdKg8pNHHCtf6+2FY+j09rob7FLmpvDSJOb9dcHowSRQV9Ni6Fov nZ2Z1rVWsszadTeq1E17JsLAD6iGs7T4dPqEHF0i3rDKKadcLgTuMAYpKqIQU8YlZbWi ulkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bf+h40iI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-179041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179041-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. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a179461fbsi633193466b.102.2024.05.14.11.08.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 11:08:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bf+h40iI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-179041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179041-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 0BF1F1F220E9 for ; Tue, 14 May 2024 18:08:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE1D21802D6; Tue, 14 May 2024 18:08:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bf+h40iI" 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 CB0D51E487; Tue, 14 May 2024 18:08:03 +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=1715710083; cv=none; b=UBUEae/0E0wdjkYVCmondQ3gTMiIFE1DpiJbOsmE85lYbkvmfFzrwRy2CEFXSklKTecE1Vm2C4EErZr3C/5F6Xqj9MbR6VSpupVjotDkkBQafR4rrCMYDiJKdByntsOmVCe8+r6oOYnr1q/Gugdll0lUdgxpsZT+l2E0PIBsJdw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715710083; c=relaxed/simple; bh=cbX8GqhX/BZI3INfM/Qv8VnQNKKluIjMW+Q960sJgIs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OV/EDabMtlxVSKVu4WqoIVNxlD54hcjhlZzoPu79JhQasXnh3wSbW3OWe3rzdPmmtdD2G5I0ZS+21wq6aCTacNP5JIT9apcnO5CDgpI6exFuoUjqvakqy/XfurSP7IfmZh1OhZ9FA1WacmmFVzgMDLn/fkfVDZ8P+AymC9rBQqc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bf+h40iI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A479C2BD10; Tue, 14 May 2024 18:08:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715710083; bh=cbX8GqhX/BZI3INfM/Qv8VnQNKKluIjMW+Q960sJgIs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bf+h40iITMx+HMtakGjF+9/YfDsjyy3kaM12Pw5oEzoF/GFsHCcnobcK+YEvcmzRu 4BAXjZo4SPdALOQA0C9akfuAMtTGrCANEisUMKSQooeQUyZ10O762N/Met+qyYaoPC ZNs1KMvP0iFny8JsH33SrFy7w8lKQVkK0/NJz0xcrVTp2r6hE1323/Ag7GymrxHC0v kKStIuEm386j/r5cVmvaV4pTAxkJydn5sfIctAyIwn1t9NycTBHWSaRimfq9MQF1ib hwGg1IwC8GgcQ68RQiqC58txx+xQaPiRKE1VJU1fGyG6kDsx/lD2FJCs2wxc7THcvg mv4uWYbZjWhEQ== Date: Tue, 14 May 2024 19:07:58 +0100 From: Conor Dooley To: Xingyu Wu Cc: Michael Turquette , Stephen Boyd , Emil Renner Berthing , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , "linux-kernel@vger.kernel.org" , "linux-clk@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "devicetree@vger.kernel.org" Subject: Re: [PATCH v5 0/2] Add notifier for PLL0 clock and set it 1.5GHz on Message-ID: <20240514-congenial-smother-1e4b0fc6a5df@spud> References: <20240507065319.274976-1-xingyu.wu@starfivetech.com> <20240510-unfounded-syrup-d1263d57d05a@spud> <20240511-unbiased-dainty-ccb5ece9b1b9@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ICN+M2oef3F7o4Ka" Content-Disposition: inline In-Reply-To: --ICN+M2oef3F7o4Ka Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 14, 2024 at 07:40:02AM +0000, Xingyu Wu wrote: > On 11/05/2024 20:19, Conor Dooley wrote: > >=20 > > On Sat, May 11, 2024 at 03:02:56AM +0000, Xingyu Wu wrote: > > > On 11/05/2024 05:05, Conor Dooley wrote: > > > > > > > > On Tue, May 07, 2024 at 02:53:17PM +0800, Xingyu Wu wrote: > > > > > This patch is to add the notifier for PLL0 clock and set the PLL0 > > > > > rate to 1.5GHz to fix the lower rate of CPUfreq on the JH7110 SoC. > > > > > > > > > > The first patch is to add the notifier for PLL0 clock. Setting the > > > > > PLL0 rate need the son clock (cpu_root) to switch its parent clock > > > > > to OSC clock and switch it back after setting PLL0 rate. It need > > > > > to use the cpu_root clock from SYSCRG and register the notifier in > > > > > the SYSCRG driver. > > > > > > > > > > The second patch is to set cpu_core rate to 500MHz and PLL0 rate > > > > > to 1.5GHz to fix the problem about the lower rate of CPUfreq on > > > > > the visionfive board. The cpu_core clock rate is set to 500MHz > > > > > first to ensure that the cpu frequency will not suddenly become > > > > > high and the cpu voltage is not enough to cause a crash when the = PLL0 is set > > to 1.5GHz. > > > > > The cpu voltage and frequency are then adjusted together by CPUfr= eq. > > > > > > > > Hmm, how does sequencing work here? If we split the patches between > > > > trees it sounds like without the dts patch, the clock tree would (or > > > > could) crash, or mainline if the clock changes there before the dts > > > > ones do. Am I misunderstanding that? > > > > > > Oh, I think you misunderstood it. Patch 1 (clock driver patch) does > > > not cause the clock tree crash without the patch 2 (dts patch), and it > > > just provides the correct flow of how to change the PLL0 rate. The > > > patch 2 is to set the clock rate of cpu_core and PLL0 rate, which > > > causes the crash without patch 1. Setting cpu_core rate is to avoid c= rashes by > > insufficient cpu voltage when setting PLL0 rate. > >=20 > > So is the problem in the other direction then? My dts tree will crash i= f I apply the > > dts change without the clock patch? >=20 > Sorry, I tested it and it could not crash using only dts patch. It can se= parate the > patches and use it individually. >=20 > > Additionally, what about U-Boot? Will it have problems if the dts is im= ported > > there without changes to its clock driver? > >=20 >=20 > It is not apply to U-Boot. In the U-Boot, the PLL0 rate should be 1GHz to= for GMAC > and PMIC to work. But now the PLL0 rate should be 1.5GHz in the Linux. There's a push in U-Boot to move devicestrees to use "OF_UPSTREAM", which means importing devicetrees directly from Linux and using them in U-Boot. I don't really want to merge a patch that would present U-Boot with a problem if the VisionFive 2 moved to that model there. Cheers, Conor. --ICN+M2oef3F7o4Ka Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZkOofgAKCRB4tDGHoIJi 0ufXAP9Uh+ZzbT/spgRCgoklThu+gutedLdqt2wyY4s4A/w6HgD/UbHkgmXSa+SY yCs4XmyR6wDsGVSfXZlZ8fhpLfp/FAI= =qwt+ -----END PGP SIGNATURE----- --ICN+M2oef3F7o4Ka--