From patchwork Tue Feb 27 19:48:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 13574369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF568C54798 for ; Tue, 27 Feb 2024 19:49:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=InjZpfPaS3zxrQ0aBaCaJGJEvnFfMIwQW2GfzxcBdLA=; b=wTdDCi5g5vhkTN YO1s3C3Tja/AXZy61DfkrIdsJ+6EhlVKbSRP2EtqchAjgeRu8ucg57aiK2tlf+PKvqFGtjY5+ckPh 5DT0eBOPuxNQPuFgQyBi4c8Bw7WHS3NbrkKI4TcqU2w1Nq9NkId83K+nKz3jFdMwU1dRUGGV9S3kE hUd0ohmHrZ7AjPAzgLFSMOKPidhtQXUu8O8Mv6m9J/l3jNTNHGezJY8VyezgScXvDfoSeyy9huJ5z H62OK0wd9WwMrLTbx0PNYMeZuzVgQ+cmJfwxAO67mCayGNiO72uXs4RT64a2/DTpIx4XTaHzEUU0f u7WQ+mYh+T9W4GFgAzOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rf3Ri-00000006g70-3fsn; Tue, 27 Feb 2024 19:48:58 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rf3Rf-00000006g5T-3ca7 for linux-arm-kernel@lists.infradead.org; Tue, 27 Feb 2024 19:48:57 +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 D4BBADA7; Tue, 27 Feb 2024 11:49:28 -0800 (PST) Received: from pluto.. (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E4A563F762; Tue, 27 Feb 2024 11:48:47 -0800 (PST) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, peng.fan@oss.nxp.com, michal.simek@amd.com, quic_sibis@quicinc.com, quic_nkela@quicinc.com, mturquette@baylibre.com, sboyd@kernel.org, souvik.chakravarty@arm.com, Cristian Marussi Subject: [PATCH 0/5] Rework SCMI Clock driver clk_ops setup procedure Date: Tue, 27 Feb 2024 19:48:07 +0000 Message-ID: <20240227194812.1209532-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240227_114855_970357_2EFEA63E X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, a small series to review how the SCMI Clock driver chooses and sets up the CLK operations to associate to a clock when registering with CLK framework. SCMI clocks exposed by the platform sports a growing number of clock properties since SCMI v3.2: discovered SCMI clocks could be restricted in terms of capability to set state/rate/parent/duty_cycle and the platform itself can have a varying support in terms of atomic support. Knowing upfront which operations are NOT allowed on some clocks helps avoiding needless message exchanges. As a result, the SCMI Clock driver, when registering resources with the CLK framework, aims to provide only the specific clk_ops as known to be certainly supported by the specific SCMI clock resource. Using static pre-compiled clk_ops structures to fulfill all the possible (and possibly growing) combinations of clock features is cumbersome and error-prone (there are 32 possible combinations as of now to account for the above mentioned clock features variation). This rework introduces a dynamic allocation mechanism to be able to configure the required clk_ops at run-time when the SCMI clocks are enumerated. Only one single clk_ops is generated for each of the features combinations effectively found in the set of returned SCMI resources. Based on sudeep/for-linux-next. Thanks, Cristian Cristian Marussi (5): clk: scmi: Allocate CLK operations dynamically clk: scmi: Add support for state control restricted clocks clk: scmi: Add support for rate change restricted clocks clk: scmi: Add support for re-parenting restricted clocks clk: scmi: Add support for get/set duty_cycle operations drivers/clk/clk-scmi.c | 226 ++++++++++++++++++++++++++++++++--------- 1 file changed, 179 insertions(+), 47 deletions(-)