[PATCH v2 01/17] firmware: arm_scmi: Define a common SCMI_MAX_PROTOCOLS value
Dhruva Gole
d-gole at ti.com
Mon Jan 19 22:44:19 PST 2026
On Jan 19, 2026 at 11:18:27 +0000, Jonathan Cameron wrote:
> On Wed, 14 Jan 2026 11:46:05 +0000
> Cristian Marussi <cristian.marussi at arm.com> wrote:
>
> > Add a common definition of SCMI_MAX_PROTOCOLS and use it all over the
> > SCMI stack.
> >
> > Signed-off-by: Cristian Marussi <cristian.marussi at arm.com>
> Hi Cristian,
>
> Mention the introduction of SCMI_PROTOCOL_LAST in the patch description
> and probably say why it takes that value (which is much less than
> the SCMI_MAX_PROTOCOLS value).
Rather I wonder why even add it? Is it just like a documentation/ marker
or is some other usage even planned for it?
>
> Jonathan
>
> > ---
> > 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 dee9f238f6fd..78e9e27dc9ec 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)
> > @@ -1673,7 +1671,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 aafaac1496b0..c6efe4f371ac 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 = 0x7f,
> > };
> >
> > +#define SCMI_MAX_PROTOCOLS 256
> > +
> > enum scmi_system_events {
> > SCMI_SYSTEM_SHUTDOWN,
> > SCMI_SYSTEM_COLDRESET,
>
--
Best regards,
Dhruva Gole
Texas Instruments Incorporated
More information about the linux-arm-kernel
mailing list