Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1594456rwp; Thu, 13 Jul 2023 13:22:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlEJasqp/v5Yxqr8WgfKiRDzDLFS5IJE3UJAQ492sEoNubfY+9E8F0L9JY6+BTZ8X97/g1gu X-Received: by 2002:a17:90a:a58f:b0:250:6c76:fd9b with SMTP id b15-20020a17090aa58f00b002506c76fd9bmr1762465pjq.38.1689279744156; Thu, 13 Jul 2023 13:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689279744; cv=none; d=google.com; s=arc-20160816; b=uljhBMsz2CRwwnDYsgn+iUV36qlKEBdE9nbGKZZoQ/eMXjRXS+HGvsDl2Gq49+cqQZ 0feZ/3gSfM7z4klxnd3Vihl05oC9zDybkBa6fWAu+jdyWtkSR1+uDaZ8x1/H9Jog7DuH CfcvXyCSK3uH4bZaN2OKOfx1EmIvf4w0ryZFd3iAhV/iXthwsQHTgcRWJz4bzupjSxXd DOkZJOFK2wHL4CJ/pM2V2iZFSRPZnwW9V7jjO2T1Mv7C3qIaKq4EKdwGvE7oNUnstzyu +s7p7JPwE6Qvpb6EVLtd/l5iTvKQtDQjigrXwkWxR1AIDacy43P8lz0MBKr9rAQKE1PA OI3Q== 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=MzNHiIxtkUUvVKyi+hoem+U+nSXc3BBxyEjLIIQGKgU=; fh=grn4vTcilSprjaU4WadjDIqGtGFVlxI9UFvH6Afal3c=; b=MDuS/uVbNNCBYPsj8cjg8UX4FwdlvuvoDLg2y2+0+dX0KW7yBLT8sX4DAJJw0YlecW xfMxoTmic/zsTXSD7AvojVbupf6TiVqNOFACRwGa2EqDC37TAm595HMaJ4JLdnUqRbBU FB2yTBjMIW4gM1LgGPolTkfWZES3PsY2/jD3XgCwVqXHU4k851sE8qvdbJJ3dwdztWqq N+5wV0dju+wF3G2/dlxtoD/4YcaXzdMZ2hki+pXZ/bD+9Tb0GHLhwP9GZHtMBxkakU46 L9EzJq/Actd4qwKucAUf6bbkVMq8WUpcIR9Sw8+JmatYvg6oLvCajjyPviu4FOCadWgv N9zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VgICHNlT; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a17090a670c00b00263c4af31f2si5624816pjj.157.2023.07.13.13.22.11; Thu, 13 Jul 2023 13:22:24 -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=@collabora.com header.s=mail header.b=VgICHNlT; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232607AbjGMTiT (ORCPT + 99 others); Thu, 13 Jul 2023 15:38:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231909AbjGMTiR (ORCPT ); Thu, 13 Jul 2023 15:38:17 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7A64269D; Thu, 13 Jul 2023 12:38:16 -0700 (PDT) Received: from mercury (unknown [185.254.75.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id 40D93660704B; Thu, 13 Jul 2023 20:38:15 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689277095; bh=LCTHlbt9t3lIo/yJabi6ZxoDAc2P6YaDBhZi4GtjP58=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VgICHNlTWBb3DvnETMeo90SwdkRHWdjCiK+w2oRIUIUu1mkG75UswADjjq/uJirWt Bl6uIZl1DuZxUjQgfedKFdzU/httYdFOS69tf3NddCHkJApfDQhHeBpth1jgqs6jAw fXrNzaS97mzBwPb13lzZJhtSW2SAM5hjEg4spPk2DJUkiYe+QRkmBOFrNCsdvbuPRF 2nS0aG55sqgFk2lOlLhqcpDj5NmJ3/8ik5GhiB6BPXeiVXFmyD77Jr5wUat0jjNRwl l7WFAGZgI6XG1BQXbOa3i93rzS6Ea3Cfi+azHQiVQk6CoU6XpJgu6v1pjflT58ytCq icQ/UGivvUIKQ== Received: by mercury (Postfix, from userid 1000) id 745D01062E2E; Thu, 13 Jul 2023 21:38:12 +0200 (CEST) Date: Thu, 13 Jul 2023 21:38:12 +0200 From: Sebastian Reichel To: Jagan Teki Cc: Heiko Stuebner , linux-rockchip@lists.infradead.org, Peter Geis , Elaine Zhang , Finley Xiao , Michael Turquette , Stephen Boyd , Boris Brezillon , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Vincent Legoll Subject: Re: [PATCHv2 1/2] clk: rockchip: rk3588: make gate linked clocks ignore unused Message-ID: <20230713193812.px7q4sdfdppuywsg@mercury.elektranox.org> References: <20230403193250.108693-1-sebastian.reichel@collabora.com> <20230403193250.108693-2-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ckdtegxpm7vrxvpt" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 --ckdtegxpm7vrxvpt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Jagan, On Thu, Jul 13, 2023 at 08:25:03PM +0530, Jagan Teki wrote: > On Tue, 4 Apr 2023 at 01:03, Sebastian Reichel > wrote: > [...] > > + * Recent Rockchip SoCs have a new hardware block called Native Interf= ace > > + * Unit (NIU), which gates clocks to devices behind them. These effect= ively > > + * need two parent clocks. > > + * > > + * Downstream enables the linked clock via runtime PM whenever the gat= e is > > + * enabled. This implementation uses separate clock nodes for each of = the > > + * linked gate clocks, which leaks parts of the clock tree into DT. > > + * > > + * The GATE_LINK macro instead takes the second parent via 'linkname',= but > > + * ignores the information. Once the clock framework is ready to handl= e it, the > > + * information should be passed on here. But since these clocks are re= quired to > > + * access multiple relevant IP blocks, such as PCIe or USB, we mark al= l linked > > + * clocks critical until a better solution is available. This will was= te some > > + * power, but avoids leaking implementation details into DT or hanging= the > > + * system. > > */ >=20 > Does it mean the clk-link topology in the downstream kernel can be > reused the same as normal clock notation? Yes. > For example, I'm trying to add HCLK_VO1 directly to VO1 syscon instead > of routing to pclk_vo1_grf(done downstream) > vo1_grf: syscon@fd5a8000 { > compatible =3D "rockchip,rk3588-vo-grf", "syscon"; > reg =3D <0x0 0xfd5a8000 0x0 0x100>; > clocks =3D <&cru HCLK_VO1>; You need PCLK_VO1 (which is currently not exposed; I somehow missed it). > }; >=20 > This seems breaking syscon for vo1_grf and observed a bus error > while accessing regmap.=20 I investigated the issue you are seeing some weeks ago when my co-workers started to work on HDMI RX and TX. You are probably just missing this patch: https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux/-/comm= it/ecc6415344957fa88356cec10f8b75a9da603a7b > I remember in one of the RKDC discussion that the double parenting > of these clocks is mandatory while accessing associated IP blocks. Yes, it is necessary. > Any thoughts? The upstream workaround/hack is to have the second parent always enabled. This obviously wastes power, but means that the hardware description in the DT is correct. Once the clock framework supports two parents the kernel can be updated without touching the DT, which is considered ABI. Greetings, -- Sebastian --ckdtegxpm7vrxvpt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmSwUpcACgkQ2O7X88g7 +prvUBAAmj/+1Y2EoNVM52dwbYtpsK+nyCPxZN7qF818FlAZMAPLUPGLEhy5h+oT 9yP7Tj2QaoM1WIRajoE/q3UshWnjsZWLRdDqeZsAcsaUfl24MrvzhiYdm/hce0jT 7pL5gW8LJ6apq194xsC64AcF7AOHRBqduoHmlSmBg8Jz3t+O530MGtMCxLf7wCJl teEmkynSKx/BMYOORifhfoaoNtV5LgvDYjaBSrJ6IpZmCeMuKwmL4TR4xoUVFBaR IVu8nsnFn3bRhZ85T9R3NgfriPj2BLLbIsDe+qD8blzCETH9vAhAWDpKzBFnJ0NZ w8XcusaDX1vFOnzjaat/7OKxkguApB8eh/WLAZ1aXDZ0OwpntP3yMduoY5fmixKZ OrHS2H6wAELKuNO3UOkLfGqEE60+z2A3HEqZA5ltZWud6+oPtRENVmYSjDzNaEjl lRb/PFMYU6MVFiVtfxqgwKXMLqqIL/Pk3wfgY32FYvTrWkNiCSh0+AFBx8iVzCFI kTfPuC5o+k+FN7wxqvLYfpgI6poZYs1CSFMLOzpof3/79aJN/NaFbTGW8bngnFIQ CL2ycYNleFr91CYk83fQ7jbkR0VUd774yCH7FO8ytZjxl5uvecMEwBG3GAn+pZh7 Ns4kvC9k2SepoVw/FUj5ywI+DeizHMAkeR1Hjs5KP4A0nFESZqY= =ytIK -----END PGP SIGNATURE----- --ckdtegxpm7vrxvpt--