Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1555572lqp; Mon, 15 Apr 2024 09:39:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfXCcRv5/QwysRK+4fzx8ojBDia1bP3pzOQ5zTGKXUCi/hN93/i2eb4Ie1dkmIxn6C/b2bz1ZX4eNL/vXL+FCthsQyJAU9KFC1RPVXkw== X-Google-Smtp-Source: AGHT+IE5FatmA2m65spd1kKUOyvBnY0TW685wAsqGMGLWSWIBB9YRKOvp39N8vRkJoEpIYrFnHwo X-Received: by 2002:a17:902:9883:b0:1e2:688e:597d with SMTP id s3-20020a170902988300b001e2688e597dmr8809114plp.21.1713199175071; Mon, 15 Apr 2024 09:39:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713199175; cv=pass; d=google.com; s=arc-20160816; b=l1YSKP0dxkPxG8vWm4uP68Pawk90n1I57KAsdePnUqhJu5J3nXk/kXsNtmmK8Fo5WC a8mD6KQs39v/V6VP9dH6kK+JbnB4KcvIkQcl+3iQp1sDDZY9juFpGzM8+wk+ljcbXaeX V3HHH0kMoKEncqCprmL9F9Vu20xkydbfBD0fAmRj1wPg31IvuOrQKKFgLBe8VZgaXxMk v2dmUgf1ZLI5fE/Khl4Ql4QzMCD3UhXvN1FUksyqzg7d6cF/jk5FLDFa4u1Rv/fQj3gK 5k/xIOuThMNwhrXoe0uaEM8coPYZkWaI76Tl9qkntij5e8680jxOBJwR8y3eBrsRHeRp GMhw== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=fZmGmkzGAPLkJirBWPQSmoDrrTsLvJHcJm8tRI+UKC4=; fh=mWEa8kD57fMXkUdPHBEJD6cIWPe6iYGLhbK4K2UH3fw=; b=LFyZzE0lEChFwsxaEi/oZmxGM74zKhvJQNQkCoy0lF+lyC7Jcq2I7u6qSZgfc5mOtM Ibpvj2OBZ7oy0czEyN+tDVX6MZkyzXQZzclWnrr+6I7F9QUGrj8/xqhGHpvJQE5K4IRA t/4kYYD97CkCCpZ0nkCP6f0qwj8T4l08x6w3AARhU5C4blq9FisCgee/3gYy6md5+uou 5oD7ccE0SaBDuhpjG97iFruYHjWQvN6d7YusA8/OSxVpKNRbtwXZT+aJnGaU0CBSJoHs 8btoXsn26dAJQlDT0CsSgz98LDKOrtfjR89ZTD2VAn7/I5cYwBTW2MiwvuRUv86Y4NTj OJyg==; 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-145569-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145569-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id v11-20020a170903238b00b001e5288343c6si8510154plh.97.2024.04.15.09.39.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 09:39:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145569-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-145569-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145569-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 D48F1286B18 for ; Mon, 15 Apr 2024 16:38:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 356DB84A5C; Mon, 15 Apr 2024 16:37:14 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5704783CCC; Mon, 15 Apr 2024 16:37:12 +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=1713199033; cv=none; b=SweqO6CyBbbow1LxAAUh5yroH0WwrP953Sp8sbho7D15yaLsmbhVsaNYn7YabkmTjyFm+RijaDAAF+TAkiqjYqtVPIiQuqkOpiBw7k+KN/TBuSVbVVJ59EpRjhemoiuRRiGWWRUuL+ftWqtsoq1/uAMcQNoaVyOjOjxzFxSMIPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713199033; c=relaxed/simple; bh=cK+5PBqMFF+PgTRuERucVVmlIpa7o9q+w7QkvwbOkxg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=POkZ6+DQHFRMCmdMDUrnaIYI8HXQ5a6AszVKPdW4lhfR7NaF1H9UuwQmZN8R3D4bILtwSeAtUJiwnxzDrhBpXraDXa7jiDVBiio8dsH6f2zWX12s/Zx9XxFeMxM75om3IRzUZONusckAHbYVv4qDmEfJrLios89QAUAgvCAhQSM= 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 593E3DA7; Mon, 15 Apr 2024 09:37:40 -0700 (PDT) Received: from pluto.fritz.box (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A184E3F64C; Mon, 15 Apr 2024 09:37:09 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.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, souvik.chakravarty@arm.com, mturquette@baylibre.com, sboyd@kernel.org, Cristian Marussi Subject: [PATCH v3 3/5] clk: scmi: Add support for rate change restricted clocks Date: Mon, 15 Apr 2024 17:36:47 +0100 Message-ID: <20240415163649.895268-4-cristian.marussi@arm.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415163649.895268-1-cristian.marussi@arm.com> References: <20240415163649.895268-1-cristian.marussi@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Some exposed SCMI Clocks could be marked as non-supporting rate changes. Configure a clk_ops descriptors which does not provide the rate change callbacks for such clocks when registering with CLK framework. CC: Michael Turquette CC: Stephen Boyd CC: linux-clk@vger.kernel.org Signed-off-by: Cristian Marussi --- v2 --> v3 - using SCMI_CLK_RATE_CTRL_SUPPORTED instead of _FORBIDDEN --- drivers/clk/clk-scmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c index e70708573965..ba234b56f742 100644 --- a/drivers/clk/clk-scmi.c +++ b/drivers/clk/clk-scmi.c @@ -20,6 +20,7 @@ enum scmi_clk_feats { SCMI_CLK_ATOMIC_SUPPORTED, SCMI_CLK_STATE_CTRL_SUPPORTED, + SCMI_CLK_RATE_CTRL_SUPPORTED, SCMI_CLK_FEATS_COUNT }; @@ -248,7 +249,8 @@ scmi_clk_ops_alloc(struct device *dev, unsigned long feats_key) ops->recalc_rate = scmi_clk_recalc_rate; ops->round_rate = scmi_clk_round_rate; ops->determine_rate = scmi_clk_determine_rate; - ops->set_rate = scmi_clk_set_rate; + if (feats_key & BIT(SCMI_CLK_RATE_CTRL_SUPPORTED)) + ops->set_rate = scmi_clk_set_rate; /* Parent ops */ ops->get_parent = scmi_clk_get_parent; @@ -302,6 +304,9 @@ scmi_clk_ops_select(struct scmi_clk *sclk, bool atomic_capable, if (!ci->state_ctrl_forbidden) feats_key |= BIT(SCMI_CLK_STATE_CTRL_SUPPORTED); + if (!ci->rate_ctrl_forbidden) + feats_key |= BIT(SCMI_CLK_RATE_CTRL_SUPPORTED); + if (WARN_ON(feats_key >= db_size)) return NULL; -- 2.44.0