From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1C4F78F26; Sun, 22 Feb 2026 14:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771771917; cv=none; b=CDI3iqyTy56Tul/B1z1syE+IvT2LmondaK2qb756wQjH+9PeU6dgwMaH57+J6osmVDoM4thIHXNksyPbVZCSCXLEPoLvOK08OaMYdEleRc8foGm1csDJmZrWKSG9tdXFWHt4WP995IDZK40Y5aPO4s8qtPuBhFlVlnFEGaEBT/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771771917; c=relaxed/simple; bh=RxqlOpyWWTWN+ztiWCzxhPuP/Tk2WGIgMWSwYZbFfnM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HReMUNWtshsn723JSGPUeK/b6x7kHVskH59gpWMvoDvVmOkpkZs8GYjHJlyP0pauDdjt1hPDRFOTs2sFkGUpe9nJRIxgR0BGJR33HJf/nZv0hkfofMXO8PzXvBUL/NHRgOI8241dT6i2Dzm7120QD1yZ5Pa3fkOTA0iKu3qwOMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 8ED2A339; Sun, 22 Feb 2026 06:51:41 -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 6CB193F59E; Sun, 22 Feb 2026 06:51:46 -0800 (PST) Date: Sun, 22 Feb 2026 14:51:38 +0000 From: Cristian Marussi To: Geert Uytterhoeven Cc: Sudeep Holla , Cristian Marussi , Etienne Carriere , Kuninori Morimoto , Marek Vasut , arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH/RFC] firmware: arm_scmi: Increase SCMI_MAX_NUM_RATES to 64 Message-ID: References: Precedence: bulk X-Mailing-List: arm-scmi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Feb 20, 2026 at 10:53:31AM +0100, Geert Uytterhoeven wrote: > Currently, the SCMI clock driver supports up to 16 clock rates. > However, the SCMI specification v3.2 does not explicitly specify the > maximum number of clock rates that can be returned (the theoretical > maximum is 4095 in the first call of the CLOCK_DESCRIBE_RATES command, > followed by 65535 remaining rates in subsequent calls). Hi Geert, > > In Renesas R-Car X5H SCP FW SDK v4.28.0, some clocks have 32 or 64 > rates, which are returned in blocks of maximum 27 entries. When SCMI > firmware returns more than 16 clock rates, Linux ignores all clock > rates, this reducing functionality of the affected clocks. > > Fix this by increasing the maximum number of clock rates to 64. > > Signed-off-by: Geert Uytterhoeven > --- > This does increase the size of each scmi_clock_info object by 384 > bytes, which is way too much on a system with nearly 2000 clocks. > As currrently all scmi_clock_info structures are allocated together as a > single array, the .rates[] member cannot just be converted to a flexible > array, without splitting the allocation. > Indeed the clock protocol does NOT dynamically allocate based on discovery outcome, like other SCMI protocols do, so that's a waste of resources that does NOT scale...I am gonna fix this, first, by allocating dynamically strictly for the effectively discovered resources (liek other protos do) > An alternative solution would be to no longer store all rates, as > proposed by Étienne Carrière in "[PATCH v2 1/2] firmware: arm_scmi: get > only min/max clock rates" > (https://lore.kernel.org/20241203173908.3148794-2-etienne.carriere@foss.st.com) Yes, the other further optimization could be to just query for min/max that are, indeed, the only rates needed currently, BUT Etienne series open code a brand new SCMI enumeration instead of rework and use existing SCMI iterators... ...I have an old incomplete series of mine that rework this...not tesetd and partially working of course :P...I think I will try to give it a respin to put such optimization on top of the above rework... I will try to post something this week...let's see Thanks, Cristian