From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22A2B606A339 for ; Fri, 4 Dec 2026 11:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=TUmt21fS; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=lKHPVLRF DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=BUV454BhBhwPFye+RifQvjOSEAYTNz66Dka8oUVtDQQ=; b=TUmt21fSOJFSmVzMiDdXTs4u4H 8nz5emQ0C6Iu0Oe6LmGEYVWfkd+8ycU6M4nWuBEoApTTMdhlCY+2nJveRvTN0RbeGQw10PHQ/v4AS Y1igCR4qP74fFez4EyH+/bT/o4H4Q1E/4Rcbop+m7U5mMve8TYg7ozqBTxirlpY5vveBuYHzv+ywY sx7HIM74Ic9ZsZC2b9Qmns6dgHMiIx+okl907lL9Dzls20zUUQwH2knXwGQz/Dl3Psifz/+wnSL4n 29NKo411USDuiiakxZ4NVOhlKMPAGdMcVjpCz7Ghw3Em9pjZlRj7iVghhRf/k5o9hOJZHHGVp7mhz IIWvhr7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZRhO-00000000APN-0oGm; Fri, 04 Dec 2026 11:43:34 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZRap-00000000AAX-1Vkx for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 11:38:25 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EAE831655; Fri, 4 Dec 2026 03:36:06 -0800 (PST) Received: from pluto (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 95B503F632; Fri, 4 Dec 2026 03:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796384169; bh=plintFvleb35D3Zm1+oLCCfg0W30RI80SpEZCrC3nC4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lKHPVLRFiQahhMPhzohJsuKEld1xaAbTnZRYCRfse0mKcDa8v1migR1Kmi9tTyQlq 39gi6rcS7p3lMUVpgEN3aesD77xIreVUzcQDwPcl4MBWv6oBPopiG+28tmkkUSs0We xXTBigAjw3883i8KZHNDiwpkp5EUFag2mSpb1Tls= Date: Fri, 4 Dec 2026 11:35:57 +0000 From: Cristian Marussi To: Ghennadi Procopciuc Cc: Brian Masney , Sudeep Holla , Stephen Boyd , Jerome Brunet , Cristian Marussi , linux-doc@vger.kernel.org, Alberto Ruiz , linux-arm-kernel@lists.infradead.org, Christophe Lizzi , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, arm-scmi@vger.kernel.org, Eric Chanudet , Enric Balletbo , NXP S32 Linux Team , Jonathan Corbet Subject: Re: [PATCH RFC 0/2] firmware: arm_scmi: clock: stop discovering every clock at boot Message-ID: References: <20261113-b4-scmi-clk-on-demand-v1-0-7fd162097b57@oss.nxp.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_033707_302496_246CC7A5 X-CRM114-Status: GOOD ( 36.68 ) X-Spam-Score: -4.4 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Wed, Dec 02, 2026 at 10:04:15AM +0200, Ghennadi Procopciuc wrote: > On 11/13/2026 3:27 PM, Ghennadi Procopciuc via B4 Relay wrote: > > Hi all, > > > > At probe, the SCMI clock protocol and clk-scmi discover and register > > every clock the platform reports, whether or not a Linux consumer > > references it. On platforms that report hundreds of clocks, this can > > add tens of milliseconds or more to every boot. > > > > This is sent as RFC to get feedback on the direction before a final > > version. The questions are listed at the end. > > > > The problem > > =========== > > > > For each clock, probe sends a fixed number of messages: > > > > - CLOCK_ATTRIBUTES, in scmi_clock_protocol_init() > > - CLOCK_GET_PERMISSIONS, if the platform supports it > > - CLOCK_DESCRIBE_RATES, at least once even with the bounded iterators > > - CLOCK_POSSIBLE_PARENTS_GET and CLOCK_NAME_GET, when applicable > > - CLOCK_RATE_GET, from __clk_core_init() at registration > > > > The total cost is about N_clocks x messages_per_clock x message_latency. > > It grows with the number of clocks the platform reports, not with the > > number of clocks Linux uses. Three properties make it worth addressing: > > > > 1. It is paid on every boot. The result does not change between boots > > with the same firmware, but nothing is cached. Every cold boot, warm > > reboot or kexec pays it again, and so does every VM that has its own > > SCMI clock provider. > > > > 2. It is on the critical path. scmi_clocks_probe() runs synchronously > > and registers the provider only at the end. Every consumer of an SCMI > > clock waits for the whole set to be discovered, and through fw_devlink > > so do the devices that depend on those consumers. A storage controller > > that needs one clock to mount the root filesystem waits for hundreds. > > > > 3. Most of the work is for clocks Linux has no use for. SoCs that run > > several agents or partitions on one SCMI server often report the full > > clock space to every agent. An agent may have only a dozen clocks > > referenced in its device tree, and may not even be allowed to control > > the others, but it still discovers and registers all of them. > > > > clk_disable_unused() adds to this. It walks every registered clock and, > > for clocks with an is_prepared op, sends CLOCK_CONFIG_GET for each one, > > including clocks Linux can never disable. > > Hi Sudeep, Cristian, Stephen, Brian, > Hi, this seems to me in general a good optimization for a known issue in the scenario you described; the concern, and the source of never-ending debate around this kind of SCMI issues, is usually WHY the FW is exposing such a huge set of clock to the SCMI agent for no use ? Ideally the SCMI point of view is that a clock (or any other SCMI resource in these regards...this has really been raised before for other protocols) that is not supposed to be used at all in any capacity by a specific agent should be hidden by the SCMI platform server from the view of that agent, since the SCNI server is supposed to present a per-agent view of strictly the resources needed by each agent.... ....this has been usually ignored on a number of FW implentation to ease the implementation itself, but is means basically that you are presenting a set of non-contiguosly numbered IDs for such resources... ...so if we are gonna allow programatically such partially out-of-spec behaviour and employ this optimization, we have to reason about what could go wrong while doing that, since most of the protocol enumeration logic across all the SCMI stack has been originally written assuming a set of contiguos resources...I am not saying that is necesarily broken all over the place but it is worth considering... Thanks, Cristian