[PATCH 1/2] firmware: arm_scmi: imx: Support getting syslog of MISC protocol

Peng Fan peng.fan at nxp.com
Wed Sep 10 22:46:21 PDT 2025


> Subject: Re: [PATCH 1/2] firmware: arm_scmi: imx: Support getting
> syslog of MISC protocol
[...] 
> > +{
> > +	struct scmi_iterator_ops ops = {
> > +		.prepare_message =
> iter_misc_syslog_prepare_message,
> > +		.update_state = iter_misc_syslog_update_state,
> > +		.process_response =
> iter_misc_syslog_process_response,
> > +	};
> 
> Does it need const?  looks like also need static.
> 

Current drivers/firmware/arm_scmi/drivers not use const
for this. Changes it to const will trigger build warning as I understand.

And many other places also not declare it as const, such as
pinctrl/perf/sensor.

We could take your suggestion as an improvement in a future
patch to convert them all to const.

I am not sure whether we need static for this.

Sudeep, Cristian,

Do you expect me to convert all the ops to const in this
patchset or could we defer to a future patch?

Thanks,
Peng.

> Frank
> > +	struct scmi_imx_misc_syslog_ipriv ipriv = {
> > +		.array = array,
> > +		.size = size,
> > +	};
> > +	void *iter;
> > +
> > +	if (!array || !size || !*size)
> > +		return -EINVAL;
> > +
> > +	iter = ph->hops->iter_response_init(ph, &ops, *size,
> SCMI_IMX_MISC_SYSLOG_GET,
> > +					    sizeof(struct
> scmi_imx_misc_syslog_in),
> > +					    &ipriv);
> > +	if (IS_ERR(iter))
> > +		return PTR_ERR(iter);
> > +
> > +	/* If firmware return NOT SUPPORTED, propagate value to
> caller */
> > +	return ph->hops->iter_response_run(iter);
> > +}
> > +
> >  static const struct scmi_imx_misc_proto_ops
> scmi_imx_misc_proto_ops = {
> >  	.misc_ctrl_set = scmi_imx_misc_ctrl_set,
> >  	.misc_ctrl_get = scmi_imx_misc_ctrl_get,
> >  	.misc_ctrl_req_notify = scmi_imx_misc_ctrl_notify,
> > +	.misc_syslog = scmi_imx_misc_syslog_get,
> >  };
> >
> >  static int scmi_imx_misc_protocol_init(const struct
> > scmi_protocol_handle *ph) diff --git
> > a/include/linux/scmi_imx_protocol.h
> > b/include/linux/scmi_imx_protocol.h
> > index
> >
> 27bd372cbfb142b6acb0b1cf4b82f061529d0d45..2407d7693b6ba130
> 3e07629e45e2
> > a7eaaa906fd3 100644
> > --- a/include/linux/scmi_imx_protocol.h
> > +++ b/include/linux/scmi_imx_protocol.h
> > @@ -59,6 +59,8 @@ struct scmi_imx_misc_proto_ops {
> >  			     u32 *num, u32 *val);
> >  	int (*misc_ctrl_req_notify)(const struct scmi_protocol_handle
> *ph,
> >  				    u32 ctrl_id, u32 evt_id, u32 flags);
> > +	int (*misc_syslog)(const struct scmi_protocol_handle *ph, u16
> *size,
> > +			   void *array);
> >  };
> >
> >  /* See LMM_ATTRIBUTES in imx95.rst */
> >
> > --
> > 2.37.1
> >



More information about the linux-arm-kernel mailing list