From mboxrd@z Thu Jan 1 00:00:00 1970 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 AB69CC79FBB for ; Wed, 9 Sep 2026 22:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LYQey/hIa/LnaI6Q/5JmSI/g+gWQh8LHVp1Ia2a0c3M=; b=p50NvtHldOU8fH3QGyar7Fqacv JvV28+AVbrguW80lpZZ3/TNpZx7iUVAmuqeWpPnLMSQE3OpNHjeIQRrFpDdfNHaZ6L1j97duu5cD+ edR+VCLY8juOExuhizjbiFqNoGcfjl7FTdB45VS4VZ17CkHNslJUakuCjQf8i6h6nID3fc9rxeirk ebE5kou7RSLSwmZLzlZQsgB4PAUQWTNs094dmXo6tM7FS8pFyQ7vXtQCaXF0o/9pIj+UYy7adZZlG rgwtuUEX8oV5EFVdY6vw9RvsKvpq1Vl8I/xAixUHryKtFGN+Lr/J8++sbVKhl5aM1MaDDgaqukTS5 U8mg1E+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x4QPb-0000000Cxx7-20Xk; Wed, 09 Sep 2026 22:04:59 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x4QPW-0000000CxvC-0U9f for linux-arm-kernel@lists.infradead.org; Wed, 09 Sep 2026 22:04:55 +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 CC15D169C; Wed, 9 Sep 2026 15:04:49 -0700 (PDT) Received: from oss-apollo7005.lab.cambridge.arm.com (oss-apollo7005.lab.cambridge.arm.com [10.7.15.171]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3F1433F7D8; Wed, 9 Sep 2026 15:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1788991493; bh=VaIjpliNHMdmpjcZ2+EaV8d740iUXIoJDb8F//xzL00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IMLUagqT5uhVayad3yYOTL4c4s8B3sW0Dz7KO0VGZ2bvvIo4b+G+c+IaqcDPNtq4g knQYeIjdQoeLdv/9OY0ahuOY1GqXZlUJ+mcz9NyB34YFsISBtvajXdBLrAJhYYLCsY bMbx1iYUaSI8L94NpY9hS/ie598YVqzUmkFSGfV8= From: Philip Radford To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org, linux-pm@vger.kernel.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, etienne.carriere@st.com, peng.fan@oss.nxp.com, michal.simek@amd.com, quic_sibis@quicinc.com, dan.carpenter@linaro.org, d-gole@ti.com, souvik.chakravarty@arm.com, philip.radford@arm.com, Cristian Marussi Subject: [PATCH v9 02/13] firmware: arm_scmi: Add an optional custom parameter to fastchannel helpers Date: Wed, 9 Sep 2026 22:04:26 +0000 Message-Id: <20260909220437.1254412-3-philip.radford@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260909220437.1254412-1-philip.radford@arm.com> References: <20260909220437.1254412-1-philip.radford@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260909_150454_233370_123B58D4 X-CRM114-Status: GOOD ( 13.68 ) 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 From: Cristian Marussi Starting from SCMIv4.0 the protocols DESCRIBE_FASTCHANNEL commands allow to specify one additional per-protocol custom field in the outgoing message request in order to, optionally, further narrow down the scope of the fastchannel discovery request; the related message-reply format is instead unchanged. Add an optional custom protocol parameter to the common fastchannel helper so as to enable the caller to choose the kind of message to send based on the detected protocol version. Signed-off-by: Cristian Marussi Signed-off-by: Philip Radford --- drivers/firmware/arm_scmi/driver.c | 12 ++++++++++-- drivers/firmware/arm_scmi/perf.c | 8 ++++---- drivers/firmware/arm_scmi/powercap.c | 8 ++++---- drivers/firmware/arm_scmi/protocols.h | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 3e0d975ec94c..81cb8eec14bc 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -1902,6 +1902,11 @@ static int scmi_iterator_run_bound(void *iter, unsigned int *start, struct scmi_msg_get_fc_info { __le32 domain; __le32 message_id; + __le32 custom; +#define MSG_FC_INFO_SZ_EXTENDED \ + (sizeof(struct scmi_msg_get_fc_info)) +#define MSG_FC_INFO_SZ \ + (sizeof(struct scmi_msg_get_fc_info) - sizeof(__le32)) }; struct scmi_msg_resp_desc_fc { @@ -1930,7 +1935,7 @@ struct scmi_msg_resp_desc_fc { static void scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph, u8 describe_id, u32 message_id, u32 valid_size, - u32 domain, void __iomem **p_addr, + u32 domain, u32 *custom, void __iomem **p_addr, struct scmi_fc_db_info **p_db, u32 *rate_limit) { int ret; @@ -1961,13 +1966,16 @@ scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph, } ret = ph->xops->xfer_get_init(ph, describe_id, - sizeof(*info), sizeof(*resp), &t); + custom ? MSG_FC_INFO_SZ_EXTENDED : + MSG_FC_INFO_SZ, sizeof(*resp), &t); if (ret) goto err_out; info = t->tx.buf; info->domain = cpu_to_le32(domain); info->message_id = cpu_to_le32(message_id); + if (custom) + info->custom = cpu_to_le32(*custom); /* * Bail out on error leaving fc_info addresses zeroed; this includes diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index 4583d02bee1c..7f283f457e02 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -835,25 +835,25 @@ static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph, return; ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, - PERF_LEVEL_GET, 4, dom->id, + PERF_LEVEL_GET, 4, dom->id, NULL, &fc[PERF_FC_LEVEL].get_addr, NULL, &fc[PERF_FC_LEVEL].rate_limit); ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, - PERF_LIMITS_GET, 8, dom->id, + PERF_LIMITS_GET, 8, dom->id, NULL, &fc[PERF_FC_LIMIT].get_addr, NULL, &fc[PERF_FC_LIMIT].rate_limit); if (dom->info.set_perf) ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, - PERF_LEVEL_SET, 4, dom->id, + PERF_LEVEL_SET, 4, dom->id, NULL, &fc[PERF_FC_LEVEL].set_addr, &fc[PERF_FC_LEVEL].set_db, &fc[PERF_FC_LEVEL].rate_limit); if (dom->set_limits) ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, - PERF_LIMITS_SET, 8, dom->id, + PERF_LIMITS_SET, 8, dom->id, NULL, &fc[PERF_FC_LIMIT].set_addr, &fc[PERF_FC_LIMIT].set_db, &fc[PERF_FC_LIMIT].rate_limit); diff --git a/drivers/firmware/arm_scmi/powercap.c b/drivers/firmware/arm_scmi/powercap.c index 27e3c805e927..31b19967452f 100644 --- a/drivers/firmware/arm_scmi/powercap.c +++ b/drivers/firmware/arm_scmi/powercap.c @@ -726,24 +726,24 @@ static void scmi_powercap_domain_init_fc(const struct scmi_protocol_handle *ph, return; ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL, - POWERCAP_CAP_SET, 4, domain, + POWERCAP_CAP_SET, 4, domain, NULL, &fc[POWERCAP_FC_CAP].set_addr, &fc[POWERCAP_FC_CAP].set_db, &fc[POWERCAP_FC_CAP].rate_limit); ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL, - POWERCAP_CAP_GET, 4, domain, + POWERCAP_CAP_GET, 4, domain, NULL, &fc[POWERCAP_FC_CAP].get_addr, NULL, &fc[POWERCAP_FC_CAP].rate_limit); ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL, - POWERCAP_PAI_SET, 4, domain, + POWERCAP_PAI_SET, 4, domain, NULL, &fc[POWERCAP_FC_PAI].set_addr, &fc[POWERCAP_FC_PAI].set_db, &fc[POWERCAP_FC_PAI].rate_limit); ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL, - POWERCAP_PAI_GET, 4, domain, + POWERCAP_PAI_GET, 4, domain, NULL, &fc[POWERCAP_FC_PAI].get_addr, NULL, &fc[POWERCAP_FC_PAI].rate_limit); diff --git a/drivers/firmware/arm_scmi/protocols.h b/drivers/firmware/arm_scmi/protocols.h index 15ad5162e37a..6b27e1b531a1 100644 --- a/drivers/firmware/arm_scmi/protocols.h +++ b/drivers/firmware/arm_scmi/protocols.h @@ -291,7 +291,7 @@ struct scmi_proto_helpers_ops { u32 message_id, u32 *attributes); void (*fastchannel_init)(const struct scmi_protocol_handle *ph, u8 describe_id, u32 message_id, - u32 valid_size, u32 domain, + u32 valid_size, u32 domain, u32 *custom, void __iomem **p_addr, struct scmi_fc_db_info **p_db, u32 *rate_limit); -- 2.25.1