Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2138944rbb; Tue, 27 Feb 2024 11:49:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX8Qno4voZvyXpZD+DE7/muSc1Qv1gTfQFdu020kCHbwUWm0Kn0Dosv++ucwDuuK2ZL9EWjGIFtUQvkOlFJrqGfWSVkK35Bg9YxwqWLtg== X-Google-Smtp-Source: AGHT+IGNBXf3NWQY2QMF1mwpeI4vHr1GS96niJCXutbTF0ge3x+eHBeL84DQYIVZlHuoWWvyeiyl X-Received: by 2002:a05:6808:1589:b0:3c1:b7ce:1e1 with SMTP id t9-20020a056808158900b003c1b7ce01e1mr302724oiw.23.1709063344276; Tue, 27 Feb 2024 11:49:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709063344; cv=pass; d=google.com; s=arc-20160816; b=CrZQVuQVuhwjIFyCehuWThpPi6x+v3HrUQCCK02O01tjamScX/q83XRWX8Dk29IVJF bAsUZqYRZcafp8Mj437jztMTGGXYu5iXg5K3DHnPqXsWztCm1wn206LjTI48xc0lq3Yy ztib1a3Jms99FRaJF41iHXSiAypdTg9hdEGFZyWQixP3SrLZwRhTyMt8VTNohbH79L0j FMjViwLw8FC0YUhqxwCOr1ENQMKMenffJK97dTfPiEKXBMHJn5wUFx849WELOFq/jcfE 57ir/E68olFXP3phsQlmSrSyjJuFLjtHe9M023tqVeeQBuZgwyCIIMmKHHGpfamxIB4S u3Pw== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83950-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b70-20020a633449000000b005dc5576a4fasi5725420pga.770.2024.02.27.11.49.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 11:49:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83950-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83950-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5AC972838EE for ; Tue, 27 Feb 2024 19:49:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C90A61482FC; Tue, 27 Feb 2024 19:48:58 +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 Content-Transfer-Encoding: 8bit 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(-) -- 2.43.0