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 E4741D35168 for ; Wed, 1 Apr 2026 09:54:19 +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=1RNGwsmvP7GGhVls2nrx+y+fKGkjNNHFYPve0B4CDtU=; b=DfoMQeUlGypfvs82QJbhqTmJFs jAgiwzVf9HvnEDotpOImGbvQQytMCDosIodOq6fa3s6M2beOUOncnADaEJcdzGoraIwESbp1xmxqw e9Y2fkqegvqgNS5myjQpGeeK5Vx6eaO9hJvWgr08oGXWOqhZp7W12u7PUhbL8b9AUL/D0PBiVjLil /Ti68o7y5YcMIPZ/1cgJcsYk3iE/fUsVxIiuaowzXgbTOeKNaOxIHh4zUw/rgR9PwINQp8ZBZmdC+ Z5rQN6P1a7f7Ha+2347MHmDVM8PkENzn6o4Gyhd/Vc8qfdhX08OXXU/GNmXUk8k/GWVDRYM94Li0W UiHndj1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w7sHA-0000000ERsL-1SbR; Wed, 01 Apr 2026 09:54:16 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w7sH8-0000000ERpr-0lt0 for linux-arm-kernel@lists.infradead.org; Wed, 01 Apr 2026 09:54:15 +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 52F3916F2; Wed, 1 Apr 2026 02:54:07 -0700 (PDT) Received: from donnerap.manchester.arm.com (donnerap.manchester.arm.com [10.33.8.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 228423F7D8; Wed, 1 Apr 2026 02:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1775037253; bh=nQAh8npDQCLKs0/rvJIIHrMmriDUWBHx8TScwimPiGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oahgx+y2QKJPBnOGjFEDLWXbTGf2Juu5i76kWb6fGV8xxDVUpRGwNl/aE+XTkG+za 3ubdbTljjsDqE+ARRADHlGT8XY4TZwPtZH4ihO3T0VCxRsVAOV8Nn+YgRWkx15R0kn VSlielVT+dz5YmLhJ8fsxBrmdQGJgihURnVfAFRU= 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, Cristian Marussi , Philip Radford Subject: [PATCH v4 05/11] firmware: arm_scmi: Add SCMIV4.0 Powercap notifications support Date: Wed, 1 Apr 2026 10:53:43 +0100 Message-ID: <20260401095349.2217840-6-philip.radford@arm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260401095349.2217840-1-philip.radford@arm.com> References: <20260401095349.2217840-1-philip.radford@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260401_025414_346089_19398AD2 X-CRM114-Status: GOOD ( 13.45 ) 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 Extend notification support to the new SCMIv4.0 Powercap format that carry also a CPL identifier where specified. Since this addition completes SCMIv4.0 Powercap support bump also the protocol version define. Signed-off-by: Cristian Marussi Signed-off-by: Philip Radford --- drivers/firmware/arm_scmi/powercap.c | 13 +++++++++---- include/linux/scmi_protocol.h | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/arm_scmi/powercap.c b/drivers/firmware/arm_scmi/powercap.c index db5bc4f38ea4..1d1188e98d49 100644 --- a/drivers/firmware/arm_scmi/powercap.c +++ b/drivers/firmware/arm_scmi/powercap.c @@ -18,7 +18,7 @@ #include "notify.h" /* Updated only after ALL the mandatory features for that version are merged */ -#define SCMI_PROTOCOL_SUPPORTED_VERSION 0x20000 +#define SCMI_PROTOCOL_SUPPORTED_VERSION 0x30000 #define CPL0 0 @@ -156,7 +156,8 @@ struct scmi_powercap_cap_changed_notify_payld { __le32 agent_id; __le32 domain_id; __le32 power_cap; - __le32 pai; + __le32 avg_ivl; + __le32 cpli; }; struct scmi_powercap_meas_changed_notify_payld { @@ -1312,14 +1313,18 @@ scmi_powercap_fill_custom_report(const struct scmi_protocol_handle *ph, const struct scmi_powercap_cap_changed_notify_payld *p = payld; struct scmi_powercap_cap_changed_report *r = report; - if (sizeof(*p) != payld_sz) + if (sizeof(*p) > payld_sz) break; r->timestamp = timestamp; r->agent_id = le32_to_cpu(p->agent_id); r->domain_id = le32_to_cpu(p->domain_id); r->power_cap = le32_to_cpu(p->power_cap); - r->pai = le32_to_cpu(p->pai); + r->avg_ivl = le32_to_cpu(p->avg_ivl); + if (sizeof(*p) == payld_sz) + r->cpli = le32_to_cpu(p->cpli); + else + r->cpli = 0; *src_id = r->domain_id; rep = r; break; diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index 547ab4763a63..299fa8499b3f 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -1125,7 +1125,8 @@ struct scmi_powercap_cap_changed_report { unsigned int agent_id; unsigned int domain_id; unsigned int power_cap; - unsigned int pai; + unsigned int avg_ivl; + unsigned int cpli; }; struct scmi_powercap_meas_changed_report { -- 2.47.3