public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: Peng Fan <peng.fan@oss.nxp.com>
Cc: Cristian Marussi <cristian.marussi@arm.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org,
	sudeep.holla@arm.com, james.quinlan@broadcom.com,
	f.fainelli@gmail.com, vincent.guittot@linaro.org,
	etienne.carriere@st.com, michal.simek@amd.com,
	quic_sibis@quicinc.com, dan.carpenter@linaro.org, d-gole@ti.com,
	souvik.chakravarty@arm.com
Subject: Re: [RFC PATCH 1/7] firmware: arm_scmi: Define a common SCMI_MAX_PROTOCOLS value
Date: Wed, 25 Jun 2025 14:59:46 +0100	[thread overview]
Message-ID: <aFwA0n2krgW0_cNr@pluto> (raw)
In-Reply-To: <20250624031351.GC10415@nxa18884-linux>

On Tue, Jun 24, 2025 at 11:13:51AM +0800, Peng Fan wrote:
> On Fri, Jun 20, 2025 at 08:28:07PM +0100, Cristian Marussi wrote:
> >Add a common definition of SCMI_MAX_PROTOCOLS and use it all over the
> >SCMI stack.
> >

Hi Peng,

thanks for having a look.

> >Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> >---
> > drivers/firmware/arm_scmi/notify.c | 4 +---
> > include/linux/scmi_protocol.h      | 3 +++
> > 2 files changed, 4 insertions(+), 3 deletions(-)
> >
> >diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
> >index e160ecb22948..27a53a6729dd 100644
> >--- a/drivers/firmware/arm_scmi/notify.c
> >+++ b/drivers/firmware/arm_scmi/notify.c
> >@@ -94,8 +94,6 @@
> > #include "common.h"
> > #include "notify.h"
> > 
> >-#define SCMI_MAX_PROTO		256
> >-
> > #define PROTO_ID_MASK		GENMASK(31, 24)
> > #define EVT_ID_MASK		GENMASK(23, 16)
> > #define SRC_ID_MASK		GENMASK(15, 0)
> >@@ -1652,7 +1650,7 @@ int scmi_notification_init(struct scmi_handle *handle)
> > 	ni->gid = gid;
> > 	ni->handle = handle;
> > 
> >-	ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO,
> >+	ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTOCOLS,
> > 						sizeof(char *), GFP_KERNEL);
> > 	if (!ni->registered_protocols)
> > 		goto err;
> >diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
> >index 688466a0e816..6f8d36e1f8fc 100644
> >--- a/include/linux/scmi_protocol.h
> >+++ b/include/linux/scmi_protocol.h
> >@@ -926,8 +926,11 @@ enum scmi_std_protocol {
> > 	SCMI_PROTOCOL_VOLTAGE = 0x17,
> > 	SCMI_PROTOCOL_POWERCAP = 0x18,
> > 	SCMI_PROTOCOL_PINCTRL = 0x19,
> >+	SCMI_PROTOCOL_LAST = 0xff,
> 
> The enum says this is std protocol, but 0x80~0xff is for vendor extension.
> It might confuse others to keep "SCMI_PROTOCOL_LAST" here.
> 

Yes indeed. This patch was lingering around since ages in my trees and
it is probably to review in itself.

> > };
> > 
> >+#define SCMI_MAX_PROTOCOLS	(SCMI_PROTOCOL_LAST + 1)
> 
> How about "#define SCMI_MAX_PROTOCOLS 256" as the line you removed in notify.c.
> 

Yes, probably the easiest thing to do.

Thanks,
Cristian


  reply	other threads:[~2025-06-25 17:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20 19:28 [RFC PATCH 0/7] Introduce SCMI Telemetry support Cristian Marussi
2025-06-20 19:28 ` [RFC PATCH 1/7] firmware: arm_scmi: Define a common SCMI_MAX_PROTOCOLS value Cristian Marussi
2025-06-24  3:13   ` Peng Fan
2025-06-25 13:59     ` Cristian Marussi [this message]
2025-06-20 19:28 ` [RFC PATCH 2/7] firmware: arm_scmi: Allow protocols to register for notifications Cristian Marussi
2025-06-20 19:28 ` [RFC PATCH 3/7] firmware: arm_scmi: Add Telemetry protocol support Cristian Marussi
2025-06-20 20:46   ` Dan Carpenter
2025-06-25 14:02     ` Cristian Marussi
2025-06-25 14:04     ` Cristian Marussi
2025-06-20 21:01   ` Dan Carpenter
2025-06-25 14:04     ` Cristian Marussi
2025-06-20 19:28 ` [RFC PATCH 4/7] firmware: arm_scmi: Add System Telemetry driver Cristian Marussi
2025-06-20 21:27   ` Dan Carpenter
2025-06-25 14:11     ` Cristian Marussi
2025-06-20 19:28 ` [RFC PATCH 5/7] firmware: arm_scmi: Add System Telemetry chardev/ioctls API Cristian Marussi
2025-06-20 21:51   ` Dan Carpenter
2025-06-25 14:14     ` Cristian Marussi
2025-06-20 19:28 ` [RFC PATCH 6/7] include: trace: Add Telemetry trace events Cristian Marussi
2025-06-20 19:28 ` [RFC PATCH 7/7] firmware: arm_scmi: Use new Telemetry traces Cristian Marussi
2025-06-24 10:22 ` [RFC PATCH 0/7] Introduce SCMI Telemetry support Dhruva Gole
2025-06-25 14:53   ` Cristian Marussi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aFwA0n2krgW0_cNr@pluto \
    --to=cristian.marussi@arm.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=d-gole@ti.com \
    --cc=dan.carpenter@linaro.org \
    --cc=etienne.carriere@st.com \
    --cc=f.fainelli@gmail.com \
    --cc=james.quinlan@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=quic_sibis@quicinc.com \
    --cc=souvik.chakravarty@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox