From: Frank Li <Frank.li@nxp.com>
To: Peng Fan <peng.fan@nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
Cristian Marussi <cristian.marussi@arm.com>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
arm-scmi@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] firmware: arm_scmi: imx: Support getting syslog of MISC protocol
Date: Wed, 10 Sep 2025 11:17:14 -0400 [thread overview]
Message-ID: <aMGWeswjrsJDiBKJ@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20250910-sm-syslog-v1-1-5b36f8f21da6@nxp.com>
On Wed, Sep 10, 2025 at 10:28:17PM +0800, Peng Fan wrote:
> MISC protocol supports getting system log regarding system sleep latency,
> wakeup interrupt and etc. Add the API for user to retrieve the information
> from SM.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> .../firmware/arm_scmi/vendors/imx/imx-sm-misc.c | 83 ++++++++++++++++++++++
> include/linux/scmi_imx_protocol.h | 2 +
> 2 files changed, 85 insertions(+)
>
...
> +
> +static int scmi_imx_misc_syslog_get(const struct scmi_protocol_handle *ph, u16 *size,
> + void *array)
> +{
> + 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.
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..2407d7693b6ba1303e07629e45e2a7eaaa906fd3 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
>
next prev parent reply other threads:[~2025-09-10 15:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 14:28 [PATCH 0/2] firmware: arm_scmi/imx: Support dump syslog Peng Fan
2025-09-10 14:28 ` [PATCH 1/2] firmware: arm_scmi: imx: Support getting syslog of MISC protocol Peng Fan
2025-09-10 15:17 ` Frank Li [this message]
2025-09-11 5:46 ` Peng Fan
2025-09-10 14:28 ` [PATCH 2/2] firmware: imx: sm-misc: Dump syslog info Peng Fan
2025-09-10 15:25 ` Frank Li
2025-09-12 7:50 ` Peng Fan
2025-09-10 16:10 ` Dan Carpenter
2025-09-11 5:47 ` Peng Fan
2025-09-12 0:08 ` kernel test robot
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=aMGWeswjrsJDiBKJ@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=sudeep.holla@arm.com \
/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
all inboxes | Powered by JetHome®