[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251017161014.0000347c@huawei.com>
Date: Fri, 17 Oct 2025 16:10:14 +0100
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Cristian Marussi <cristian.marussi@....com>
CC: <linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<arm-scmi@...r.kernel.org>, <sudeep.holla@....com>,
<james.quinlan@...adcom.com>, <f.fainelli@...il.com>,
<vincent.guittot@...aro.org>, <etienne.carriere@...com>,
<peng.fan@....nxp.com>, <michal.simek@....com>, <quic_sibis@...cinc.com>,
<dan.carpenter@...aro.org>, <d-gole@...com>, <souvik.chakravarty@....com>
Subject: Re: [PATCH 03/10] firmware: arm_scmi: Allow protocols to register
for notifications
On Thu, 25 Sep 2025 21:35:47 +0100
Cristian Marussi <cristian.marussi@....com> wrote:
> Allow protocols themselves to register for their own notifications and
> providing their own notifier callbacks. While at that, allow for a protocol
> to register events with compilation-time unknown report/event sizes: such
> events will use the maximum transport size.
>
> Signed-off-by: Cristian Marussi <cristian.marussi@....com>
Hi Cristian,
A few drive by comments...
> diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
> index 78e9e27dc9ec..3e623c14745d 100644
> --- a/drivers/firmware/arm_scmi/notify.c
> +++ b/drivers/firmware/arm_scmi/notify.c
> @@ -593,7 +593,12 @@ int scmi_notify(const struct scmi_handle *handle, u8 proto_id, u8 evt_id,
> if (!r_evt)
> return -EINVAL;
>
> - if (len > r_evt->evt->max_payld_sz) {
> + /* Events with a zero max_payld_sz are sized to be of the maximum
Local multiline comment syntax seems to be
/*
* Events...
> + * size allowed by the transport: no need to be size-checked here
> + * since the transport layer would have already dropped such
> + * over-sized messages.
> + */
> + if (r_evt->evt->max_payld_sz && len > r_evt->evt->max_payld_sz) {
> diff --git a/drivers/firmware/arm_scmi/protocols.h b/drivers/firmware/arm_scmi/protocols.h
> index d62c4469d1fd..2e40a7bb5b01 100644
> --- a/drivers/firmware/arm_scmi/protocols.h
> +++ b/drivers/firmware/arm_scmi/protocols.h
> @@ -161,8 +161,13 @@ struct scmi_proto_helpers_ops;
> * @dev: A reference to the associated SCMI instance device (handle->dev).
> * @xops: A reference to a struct holding refs to the core xfer operations that
> * can be used by the protocol implementation to generate SCMI messages.
> + * @hops: A reference to a struct holding refs to the common helper operations
> + * that can be used by the protocol implementation.
@hops isn't added in this patch so either it should be handled in where it was
added, or if that was missed a precursor patch to this one.
> * @set_priv: A method to set protocol private data for this instance.
> * @get_priv: A method to get protocol private data previously set.
> + * @notifier_register: A method to register interest for notifications from
> + * within a protocol implementation unit: notifiers can
> + * be registered only for the same protocol.
> *
> * This structure represents a protocol initialized against specific SCMI
> * instance and it will be used as follows:
> @@ -182,6 +187,9 @@ struct scmi_protocol_handle {
> int (*set_priv)(const struct scmi_protocol_handle *ph, void *priv,
> u32 version);
> void *(*get_priv)(const struct scmi_protocol_handle *ph);
> + int (*notifier_register)(const struct scmi_protocol_handle *ph,
> + u8 evt_id, const u32 *src_id,
> + struct notifier_block *nb);
> };
>
> /**
Powered by blists - more mailing lists