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: 21044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2928243dyb; Tue, 27 Feb 2024 11:49:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXGHWcEGoiDtV3FR609T+Wm39TfhxXGAZWOHMjj62pAKhckHDhmtBfvGcQ8k3DCnH2eNijfwCyr+O66IJPJ/oeaMknG4A== X-Google-Smtp-Source: AGHT+IHvtyx6skMwpnPaO1ywDkLhAAR5UK97lHopf8KLwCrTLMuF63fTBMpfwKo2keT1Q9+km8th X-Received: by 2002:a17:906:150b:b0:a3f:20b9:2b68 with SMTP id b11-20020a170906150b00b00a3f20b92b68mr7075964ejd.10.1709063359573; Tue, 27 Feb 2024 11:49:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709063359; cv=pass; d=google.com; s=arc-20160816; b=af4/o7Pfm5qgWqY1L6tsB2c3l0LuRBo+EbRDSzXrEIRtO5PUsrylPoi8zs6ixpzb5o m0C5vftRWvabU5Ib2nQpjNNLFSNwhq+0xjPncloc17baxI9ubJJRgWlbYNEVY4A4RjEh kdAqvn7UJ0F2fbEbREfJSzgmRV8aG0ztXAvl9+qx2WYLtR2ObtVqduueTkEmu4Mx2jTS kqLjtipNCOBGYd6eGXXlmDjs1Dku8cNUH+WVJmSIRtI8MXJ1TpCC1zEBNL9MRo7f8gaL CfbT5snvE7S3Rc5SjQAQS9fzYza+VwV2TzQcMsDqnjL3Ktpe5dgUGjFAVJWomHNINmXd ywjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=hzJRcQD8PzsrjBTLDnMWKqxsNSDpd1t1Y/gYRYOfCUc=; fh=K3/BrpR9VDZepyMRnvdOXWD0/f1CIwhhFAPor5DZYek=; b=OirPiexttLJ3XliwzMSWovBr5LQYNnGdDx32Um8ckuV3C9M0AT4OFv02PGL0hk6NLL MLlVMdSMRCGu3JG6NJNeI8gE5Vrmn6SirOaEZJOjNZJqVnIekJ6g7PWN4n1H1Ub4ofPR X6cJSU0Lirmtb1kSOZtbPxaYZamCcLXJ3Oq2uYuiMfkHpuCTlgJ/4n9fk/T/JsNo4jK/ lyOVmKQxHE8FkKujtO54N5hKsckBHCGT4ERQQ8L7ZZomzP5XDTe5E6czVoLv5pU/M/M6 QWNJkHzqzWdgvqGASV96IihTAfpCdyPIta/V0t/R7r4Wf5PjY08L0f8DdcR4a62NUdPX yAjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-83950-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83950-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n2-20020a1709062bc200b00a3e4f5516bdsi967026ejg.208.2024.02.27.11.49.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 11:49:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83950-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-83950-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83950-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 2A44F1F267C5 for ; Tue, 27 Feb 2024 19:49:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D493A149DF2; Tue, 27 Feb 2024 19:48:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 828AB524D0 for ; Tue, 27 Feb 2024 19:48:56 +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=1709063338; cv=none; b=D6s3hO4c0olxeXV5f0uB+iUDCrjRT4nPtbpigHFz/hb252vmK+Plx2tni0IOV4IXz16BNZ7qscuRKIZMEmbKIhjyq2Pka0Y+eaRQxwqgtrvkr5Q0fqtfAAjrvKBn0a2ZbUhfW0p8ZVjDywzKmYh1UlGS52D6j/JTAUey43BLqog= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709063338; c=relaxed/simple; bh=djPZd5I/pMg6e5I9NCeoqTVSDgCYM/N+fPrTMqPZHO4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UlwEsSMBz709lTxTh0ESmBXJzTSnUu2ecDXkdTPqqeym9IKcQnlB2H4+ssVANiHYqEpi+edvMUswyhzH/OyLe0iB/PllLPvY2Xbh5qZZlZchrx8nx2ZVOHe+4ElprB6BbMyjaYLZvkWZ32LITPndndAOsExk2ympjAwrgScKut0= 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 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792082821334349462 X-GMAIL-MSGID: 1792082821334349462 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(-)