Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info
@ 2025-09-04 10:40 Peng Fan
  2025-09-04 10:40 ` [PATCH v4 1/6] firmware: arm_scmi: imx: Add documentation for MISC_BOARD_INFO Peng Fan
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Peng Fan @ 2025-09-04 10:40 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: arm-scmi, imx, linux-arm-kernel, linux-kernel, Peng Fan

System Manager firmware provides API to dump board, silicon, firmware
information. It also provides API to dump system sleep, wakeup
information. So add the interface for Linux to retrieve the information:

patch 1 is to add doc for board information which was missed before.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in v4:
- Patch 1: Typo in commit log, state the attribute is set to 0 by firmware
           add NOT SUPPORTED return value for syslog
- Patch 2: rename to scmi_imx_misc_build_info_discover, add -EOPNOTSUPP check
- Patch 3: rename to scmi_imx_misc_cfg_info_get, correct command order,
           add -EOPNOTSUPP check.
- Patch 4: correct command order, add -EOPNOTSUPP check.
- Patch 5: correct command order, align command name in doc and driver,
           Use u32 for consistency, add comment for sleep record.
	   Add a comment for iterator run "saying propagate -EOPNOTSUPP
	   to caller".
- Link to v3: https://lore.kernel.org/r/20250827-sm-misc-api-v1-v3-0-82c982c1815a@nxp.com

Changes in v3:
- Add R-b from Cristian
- Store size, per Cristian's comments in patch 5: "*(ipriv->size) =
st->num_returned + st->num_remaining"
- Minor change in patch 6 to add size check
- Rebased to next-20250826
- Link to v2: https://lore.kernel.org/r/20250710-sm-misc-api-v1-v2-0-c3e953e34be6@nxp.com

Changes in v2:
- Add more info in patch 1 for documentation(attribute is reserved for
  future use, boardname may not align with the board name in device tree)
- Drop dump silicon revision API
- Update discover build info, cfg info, board info API to be only used in probe phase
- Update to use single sysfs single value for syslog.
- Link to v1: https://lore.kernel.org/r/20250627-sm-misc-api-v1-v1-0-2b99481fe825@nxp.com

---
Peng Fan (6):
      firmware: arm_scmi: imx: Add documentation for MISC_BOARD_INFO
      firmware: arm_scmi: imx: Support discovering buildinfo of MISC protocol
      firmware: arm_scmi: imx: Support getting cfg info of MISC protocol
      firmware: arm_scmi: imx: Support getting board info of MISC protocol
      firmware: arm_scmi: imx: Support getting syslog of MISC protocol
      firmware: imx: sm-misc: Dump syslog info

 .../firmware/arm_scmi/vendors/imx/imx-sm-misc.c    | 194 +++++++++++++++++
 drivers/firmware/arm_scmi/vendors/imx/imx95.rst    |  24 +++
 drivers/firmware/imx/sm-misc.c                     | 232 +++++++++++++++++++++
 include/linux/scmi_imx_protocol.h                  |  23 ++
 4 files changed, 473 insertions(+)
---
base-commit: 8e5b06f3b616530c57cd765b769c5ce54aaa6da7
change-id: 20250627-sm-misc-api-v1-85c030c670c6

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>



^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v4 1/6] firmware: arm_scmi: imx: Add documentation for MISC_BOARD_INFO
  2025-09-04 10:40 [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Peng Fan
@ 2025-09-04 10:40 ` Peng Fan
  2025-09-04 10:40 ` [PATCH v4 2/6] firmware: arm_scmi: imx: Support discovering buildinfo of MISC protocol Peng Fan
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Peng Fan @ 2025-09-04 10:40 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: arm-scmi, imx, linux-arm-kernel, linux-kernel, Peng Fan

System Manager Firmware supports getting board information, add
documentation for this MISC_BOARD_INFO command.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/firmware/arm_scmi/vendors/imx/imx95.rst | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx95.rst b/drivers/firmware/arm_scmi/vendors/imx/imx95.rst
index 4e246a78a042a79eb81be35632079c7626bbbe57..06687fa4c44ff76c1589ad4ddf4225a1b55c2246 100644
--- a/drivers/firmware/arm_scmi/vendors/imx/imx95.rst
+++ b/drivers/firmware/arm_scmi/vendors/imx/imx95.rst
@@ -1660,6 +1660,7 @@ protocol_id: 0x84
 |Name                |Description                                              |
 +--------------------+---------------------------------------------------------+
 |int32 status        |SUCCESS: system log return                               |
+|                    |NOT_SUPPORTED:  system log not available                 |
 +--------------------+---------------------------------------------------------+
 |uint32 numLogflags  |Descriptor for the log data returned by this call.       |
 |                    |Bits[31:20] Number of remaining log words.               |
@@ -1670,6 +1671,29 @@ protocol_id: 0x84
 |uint32 syslog[N]    |Log data array, N is defined in bits[11:0] of numLogflags|
 +--------------------+---------------------------------------------------------+
 
+MISC_BOARD_INFO
+~~~~~~~~~~~~~~~
+
+message_id: 0xE
+protocol_id: 0x84
+
++--------------------+---------------------------------------------------------+
+|Return values                                                                 |
++--------------------+---------------------------------------------------------+
+|Name                |Description                                              |
++--------------------+---------------------------------------------------------+
+|int32 status        |SUCCESS: config name return                              |
+|                    |NOT_SUPPORTED: name not available                        |
++--------------------+---------------------------------------------------------+
+|uint32 attributes   |Board specific attributes reserved for future expansion  |
+|                    |without breaking backwards compatibility. The firmware   |
+|                    |sets the value to 0                                      |
++--------------------+---------------------------------------------------------+
+|uint8 boardname[16] |Board name. Null terminated ASCII string of up           |
+|                    |to 16 bytes in length.(This is SM exported boardname     |
+|                    |which may not align with the boardname in device tree)   |
++--------------------+---------------------------------------------------------+
+
 NEGOTIATE_PROTOCOL_VERSION
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 2/6] firmware: arm_scmi: imx: Support discovering buildinfo of MISC protocol
  2025-09-04 10:40 [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Peng Fan
  2025-09-04 10:40 ` [PATCH v4 1/6] firmware: arm_scmi: imx: Add documentation for MISC_BOARD_INFO Peng Fan
@ 2025-09-04 10:40 ` Peng Fan
  2025-09-04 10:40 ` [PATCH v4 3/6] firmware: arm_scmi: imx: Support getting cfg info " Peng Fan
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Peng Fan @ 2025-09-04 10:40 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: arm-scmi, imx, linux-arm-kernel, linux-kernel, Peng Fan

MISC protocol supports discovering the System Manager(SM) build
information including build commit, build time and etc. Retrieve the
information from SM.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 .../firmware/arm_scmi/vendors/imx/imx-sm-misc.c    | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
index a8915d3b4df518719d56bfff38922625ad9b70f6..c2928bc89b001b288ee64565cec9da5668b56e7e 100644
--- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
+++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
@@ -25,6 +25,7 @@
 enum scmi_imx_misc_protocol_cmd {
 	SCMI_IMX_MISC_CTRL_SET	= 0x3,
 	SCMI_IMX_MISC_CTRL_GET	= 0x4,
+	SCMI_IMX_MISC_DISCOVER_BUILDINFO = 0x6,
 	SCMI_IMX_MISC_CTRL_NOTIFY = 0x8,
 };
 
@@ -65,6 +66,15 @@ struct scmi_imx_misc_ctrl_get_out {
 	__le32 val[];
 };
 
+struct scmi_imx_misc_buildinfo_out {
+	__le32 buildnum;
+	__le32 buildcommit;
+#define MISC_MAX_BUILDDATE	16
+	u8 builddate[MISC_MAX_BUILDDATE];
+#define MISC_MAX_BUILDTIME	16
+	u8 buildtime[MISC_MAX_BUILDTIME];
+};
+
 static int scmi_imx_misc_attributes_get(const struct scmi_protocol_handle *ph,
 					struct scmi_imx_misc_info *mi)
 {
@@ -272,6 +282,33 @@ static int scmi_imx_misc_ctrl_set(const struct scmi_protocol_handle *ph,
 	return ret;
 }
 
+static int scmi_imx_misc_build_info_discover(const struct scmi_protocol_handle *ph)
+{
+	char date[MISC_MAX_BUILDDATE], time[MISC_MAX_BUILDTIME];
+	struct scmi_imx_misc_buildinfo_out *out;
+	struct scmi_xfer *t;
+	int ret;
+
+	ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_DISCOVER_BUILDINFO, 0,
+				      sizeof(*out), &t);
+	if (ret)
+		return ret;
+
+	ret = ph->xops->do_xfer(ph, t);
+	if (!ret) {
+		out = t->rx.buf;
+		strscpy(date, out->builddate, MISC_MAX_BUILDDATE);
+		strscpy(time, out->buildtime, MISC_MAX_BUILDTIME);
+		dev_info(ph->dev, "SM Version\t= Build %u, Commit %08x %s %s\n",
+			 le32_to_cpu(out->buildnum), le32_to_cpu(out->buildcommit),
+			 date, time);
+	}
+
+	ph->xops->xfer_put(ph, t);
+
+	return ret;
+}
+
 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,
@@ -299,6 +336,10 @@ static int scmi_imx_misc_protocol_init(const struct scmi_protocol_handle *ph)
 	if (ret)
 		return ret;
 
+	ret = scmi_imx_misc_build_info_discover(ph);
+	if (ret && ret != -EOPNOTSUPP)
+		return ret;
+
 	return ph->set_priv(ph, minfo, version);
 }
 

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 3/6] firmware: arm_scmi: imx: Support getting cfg info of MISC protocol
  2025-09-04 10:40 [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Peng Fan
  2025-09-04 10:40 ` [PATCH v4 1/6] firmware: arm_scmi: imx: Add documentation for MISC_BOARD_INFO Peng Fan
  2025-09-04 10:40 ` [PATCH v4 2/6] firmware: arm_scmi: imx: Support discovering buildinfo of MISC protocol Peng Fan
@ 2025-09-04 10:40 ` Peng Fan
  2025-09-04 10:40 ` [PATCH v4 4/6] firmware: arm_scmi: imx: Support getting board " Peng Fan
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Peng Fan @ 2025-09-04 10:40 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: arm-scmi, imx, linux-arm-kernel, linux-kernel, Peng Fan

MISC protocol supports getting the System Manager(SM) mode selection
and configuration name. Retrieve the information from SM.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 .../firmware/arm_scmi/vendors/imx/imx-sm-misc.c    | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
index c2928bc89b001b288ee64565cec9da5668b56e7e..92b641f467b053a1a15332fa0a584ea7400e3bda 100644
--- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
+++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
@@ -27,6 +27,7 @@ enum scmi_imx_misc_protocol_cmd {
 	SCMI_IMX_MISC_CTRL_GET	= 0x4,
 	SCMI_IMX_MISC_DISCOVER_BUILDINFO = 0x6,
 	SCMI_IMX_MISC_CTRL_NOTIFY = 0x8,
+	SCMI_IMX_MISC_CFG_INFO_GET = 0xC,
 };
 
 struct scmi_imx_misc_info {
@@ -75,6 +76,12 @@ struct scmi_imx_misc_buildinfo_out {
 	u8 buildtime[MISC_MAX_BUILDTIME];
 };
 
+struct scmi_imx_misc_cfg_info_out {
+	__le32 msel;
+#define MISC_MAX_CFGNAME	16
+	u8 cfgname[MISC_MAX_CFGNAME];
+};
+
 static int scmi_imx_misc_attributes_get(const struct scmi_protocol_handle *ph,
 					struct scmi_imx_misc_info *mi)
 {
@@ -309,6 +316,30 @@ static int scmi_imx_misc_build_info_discover(const struct scmi_protocol_handle *
 	return ret;
 }
 
+static int scmi_imx_misc_cfg_info_get(const struct scmi_protocol_handle *ph)
+{
+	struct scmi_imx_misc_cfg_info_out *out;
+	char name[MISC_MAX_CFGNAME];
+	struct scmi_xfer *t;
+	int ret;
+
+	ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_CFG_INFO_GET, 0, sizeof(*out), &t);
+	if (ret)
+		return ret;
+
+	ret = ph->xops->do_xfer(ph, t);
+	if (!ret) {
+		out = t->rx.buf;
+		strscpy(name, out->cfgname, MISC_MAX_CFGNAME);
+		dev_info(ph->dev, "SM Config\t= %s, mSel = %u\n",
+			 name, le32_to_cpu(out->msel));
+	}
+
+	ph->xops->xfer_put(ph, t);
+
+	return ret;
+}
+
 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,
@@ -340,6 +371,10 @@ static int scmi_imx_misc_protocol_init(const struct scmi_protocol_handle *ph)
 	if (ret && ret != -EOPNOTSUPP)
 		return ret;
 
+	ret = scmi_imx_misc_cfg_info_get(ph);
+	if (ret && ret != -EOPNOTSUPP)
+		return ret;
+
 	return ph->set_priv(ph, minfo, version);
 }
 

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 4/6] firmware: arm_scmi: imx: Support getting board info of MISC protocol
  2025-09-04 10:40 [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Peng Fan
                   ` (2 preceding siblings ...)
  2025-09-04 10:40 ` [PATCH v4 3/6] firmware: arm_scmi: imx: Support getting cfg info " Peng Fan
@ 2025-09-04 10:40 ` Peng Fan
  2025-09-04 10:40 ` [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog " Peng Fan
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Peng Fan @ 2025-09-04 10:40 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: arm-scmi, imx, linux-arm-kernel, linux-kernel, Peng Fan

MISC protocol supports getting board information. Retrieve the information
from SM.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 .../firmware/arm_scmi/vendors/imx/imx-sm-misc.c    | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
index 92b641f467b053a1a15332fa0a584ea7400e3bda..9055d3c848bd159c8133298de31d3dd5a8138ec3 100644
--- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
+++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
@@ -28,6 +28,7 @@ enum scmi_imx_misc_protocol_cmd {
 	SCMI_IMX_MISC_DISCOVER_BUILDINFO = 0x6,
 	SCMI_IMX_MISC_CTRL_NOTIFY = 0x8,
 	SCMI_IMX_MISC_CFG_INFO_GET = 0xC,
+	SCMI_IMX_MISC_BOARD_INFO = 0xE,
 };
 
 struct scmi_imx_misc_info {
@@ -76,6 +77,12 @@ struct scmi_imx_misc_buildinfo_out {
 	u8 buildtime[MISC_MAX_BUILDTIME];
 };
 
+struct scmi_imx_misc_board_info_out {
+	__le32 attributes;
+#define MISC_MAX_BRDNAME	16
+	u8 brdname[MISC_MAX_BRDNAME];
+};
+
 struct scmi_imx_misc_cfg_info_out {
 	__le32 msel;
 #define MISC_MAX_CFGNAME	16
@@ -316,6 +323,30 @@ static int scmi_imx_misc_build_info_discover(const struct scmi_protocol_handle *
 	return ret;
 }
 
+static int scmi_imx_misc_board_info(const struct scmi_protocol_handle *ph)
+{
+	struct scmi_imx_misc_board_info_out *out;
+	char name[MISC_MAX_BRDNAME];
+	struct scmi_xfer *t;
+	int ret;
+
+	ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_BOARD_INFO, 0, sizeof(*out), &t);
+	if (ret)
+		return ret;
+
+	ret = ph->xops->do_xfer(ph, t);
+	if (!ret) {
+		out = t->rx.buf;
+		strscpy(name, out->brdname, MISC_MAX_BRDNAME);
+		dev_info(ph->dev, "Board\t\t= %s, attr=0x%08x\n",
+			 name, le32_to_cpu(out->attributes));
+	}
+
+	ph->xops->xfer_put(ph, t);
+
+	return ret;
+}
+
 static int scmi_imx_misc_cfg_info_get(const struct scmi_protocol_handle *ph)
 {
 	struct scmi_imx_misc_cfg_info_out *out;
@@ -371,6 +402,10 @@ static int scmi_imx_misc_protocol_init(const struct scmi_protocol_handle *ph)
 	if (ret && ret != -EOPNOTSUPP)
 		return ret;
 
+	ret = scmi_imx_misc_board_info(ph);
+	if (ret && ret != -EOPNOTSUPP)
+		return ret;
+
 	ret = scmi_imx_misc_cfg_info_get(ph);
 	if (ret && ret != -EOPNOTSUPP)
 		return ret;

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog of MISC protocol
  2025-09-04 10:40 [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Peng Fan
                   ` (3 preceding siblings ...)
  2025-09-04 10:40 ` [PATCH v4 4/6] firmware: arm_scmi: imx: Support getting board " Peng Fan
@ 2025-09-04 10:40 ` Peng Fan
  2025-09-08 11:04   ` Sudeep Holla
  2025-09-04 10:40 ` [PATCH v4 6/6] firmware: imx: sm-misc: Dump syslog info Peng Fan
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Peng Fan @ 2025-09-04 10:40 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: arm-scmi, imx, linux-arm-kernel, linux-kernel, Peng Fan

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                  | 23 ++++++
 2 files changed, 106 insertions(+)

diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
index 9055d3c848bd159c8133298de31d3dd5a8138ec3..95ef75de1843775dc60e4b6a597e155d4f5db227 100644
--- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
+++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
@@ -28,6 +28,7 @@ enum scmi_imx_misc_protocol_cmd {
 	SCMI_IMX_MISC_DISCOVER_BUILDINFO = 0x6,
 	SCMI_IMX_MISC_CTRL_NOTIFY = 0x8,
 	SCMI_IMX_MISC_CFG_INFO_GET = 0xC,
+	SCMI_IMX_MISC_SYSLOG_GET = 0xD,
 	SCMI_IMX_MISC_BOARD_INFO = 0xE,
 };
 
@@ -89,6 +90,19 @@ struct scmi_imx_misc_cfg_info_out {
 	u8 cfgname[MISC_MAX_CFGNAME];
 };
 
+struct scmi_imx_misc_syslog_in {
+	__le32 flags;
+	__le32 index;
+};
+
+#define REMAINING(x)	le32_get_bits((x), GENMASK(31, 20))
+#define RETURNED(x)	le32_get_bits((x), GENMASK(11, 0))
+
+struct scmi_imx_misc_syslog_out {
+	__le32 numlogflags;
+	__le32 syslog[];
+};
+
 static int scmi_imx_misc_attributes_get(const struct scmi_protocol_handle *ph,
 					struct scmi_imx_misc_info *mi)
 {
@@ -371,10 +385,79 @@ static int scmi_imx_misc_cfg_info_get(const struct scmi_protocol_handle *ph)
 	return ret;
 }
 
+struct scmi_imx_misc_syslog_ipriv {
+	u32 *array;
+	u16 *size;
+};
+
+static void iter_misc_syslog_prepare_message(void *message, u32 desc_index,
+					     const void *priv)
+{
+	struct scmi_imx_misc_syslog_in *msg = message;
+
+	msg->flags = cpu_to_le32(0);
+	msg->index = cpu_to_le32(desc_index);
+}
+
+static int iter_misc_syslog_update_state(struct scmi_iterator_state *st,
+					 const void *response, void *priv)
+{
+	const struct scmi_imx_misc_syslog_out *r = response;
+	struct scmi_imx_misc_syslog_ipriv *p = priv;
+
+	st->num_returned = RETURNED(r->numlogflags);
+	st->num_remaining = REMAINING(r->numlogflags);
+	*p->size = st->num_returned + st->num_remaining;
+
+	return 0;
+}
+
+static int
+iter_misc_syslog_process_response(const struct scmi_protocol_handle *ph,
+				  const void *response,
+				  struct scmi_iterator_state *st, void *priv)
+{
+	const struct scmi_imx_misc_syslog_out *r = response;
+	struct scmi_imx_misc_syslog_ipriv *p = priv;
+
+	p->array[st->desc_index + st->loop_idx] =
+		le32_to_cpu(r->syslog[st->loop_idx]);
+
+	return 0;
+}
+
+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,
+	};
+	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..ed78660d2f51c554e782b2f665e5bc5046678fd1 100644
--- a/include/linux/scmi_imx_protocol.h
+++ b/include/linux/scmi_imx_protocol.h
@@ -52,6 +52,27 @@ struct scmi_imx_misc_ctrl_notify_report {
 	unsigned int		flags;
 };
 
+/*
+ * For more detailed information, need check i.MX SM firmware file:
+ * devices/{SOC}/sm/dev_sm_system.h
+ */
+struct scmi_imx_misc_sys_sleep_rec {
+	u32 sleepentryusec;	/* System sleep entry latency */
+	u32 sleepexitusec;	/* System sleep exit latency */
+	u32 sleepcnt;		/* System sleep counter */
+	u32 wakesource;		/* IRQ/exception causing system wake */
+	u32 mixpwrstat;		/* MIX power status */
+	u32 mempwrstat;		/* MEM power status */
+	u32 pllpwrstat;		/* PLL power status */
+	u32 syssleepmode;	/* System sleep mode */
+	u32 syssleepflags;	/* System sleep flags */
+};
+
+struct scmi_imx_misc_syslog {
+	struct scmi_imx_misc_sys_sleep_rec syssleeprecord;
+	u32 deverrlog; /* device err log: timers, clocks, console and etc */
+};
+
 struct scmi_imx_misc_proto_ops {
 	int (*misc_ctrl_set)(const struct scmi_protocol_handle *ph, u32 id,
 			     u32 num, u32 *val);
@@ -59,6 +80,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



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 6/6] firmware: imx: sm-misc: Dump syslog info
  2025-09-04 10:40 [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Peng Fan
                   ` (4 preceding siblings ...)
  2025-09-04 10:40 ` [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog " Peng Fan
@ 2025-09-04 10:40 ` Peng Fan
  2025-09-08 11:07   ` Sudeep Holla
  2025-09-08 11:09 ` [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Sudeep Holla
  2025-09-09 10:32 ` (subset) " Sudeep Holla
  7 siblings, 1 reply; 17+ messages in thread
From: Peng Fan @ 2025-09-04 10:40 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: arm-scmi, imx, linux-arm-kernel, linux-kernel, Peng Fan

Add sysfs interface to read System Manager syslog info

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/firmware/imx/sm-misc.c | 232 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 232 insertions(+)

diff --git a/drivers/firmware/imx/sm-misc.c b/drivers/firmware/imx/sm-misc.c
index fc3ee12c2be878e0285183e3381c9514a63d5142..e742a2fff06b44ab7f07e9f97f723ef7ca1ff259 100644
--- a/drivers/firmware/imx/sm-misc.c
+++ b/drivers/firmware/imx/sm-misc.c
@@ -3,6 +3,7 @@
  * Copyright 2024 NXP
  */
 
+#include <linux/device/devres.h>
 #include <linux/firmware/imx/sm.h>
 #include <linux/module.h>
 #include <linux/of.h>
@@ -44,10 +45,232 @@ static int scmi_imx_misc_ctrl_notifier(struct notifier_block *nb,
 	return 0;
 }
 
+static ssize_t
+wakevector_show(struct device *device, struct device_attribute *attr, char *buf)
+{
+	struct scmi_imx_misc_syslog *syslog = dev_get_drvdata(device);
+	u16 size = sizeof(*syslog) / 4;
+	int ret;
+
+	if (!ph)
+		return 0;
+
+	ret = imx_misc_ctrl_ops->misc_syslog(ph, &size, syslog);
+	if (ret)
+		return ret;
+
+	if (size * 4 < offsetofend(struct scmi_imx_misc_sys_sleep_rec, wakesource)) {
+		dev_err(device, "%s: returned truncated data\n", __func__);
+		return -EINVAL;
+	}
+
+	return sysfs_emit(buf, "%u\n", syslog->syssleeprecord.wakesource);
+}
+static DEVICE_ATTR_RO(wakevector);
+
+static ssize_t
+syssleepmode_show(struct device *device, struct device_attribute *attr, char *buf)
+{
+	struct scmi_imx_misc_syslog *syslog = dev_get_drvdata(device);
+	u16 size = sizeof(*syslog) / 4;
+	int ret;
+
+	if (!ph)
+		return 0;
+
+	ret = imx_misc_ctrl_ops->misc_syslog(ph, &size, syslog);
+	if (ret)
+		return ret;
+
+	if (size * 4 < offsetofend(struct scmi_imx_misc_sys_sleep_rec, syssleepmode)) {
+		dev_err(device, "%s: returned truncated data\n", __func__);
+		return -EINVAL;
+	}
+
+	return sysfs_emit(buf, "%u\n", syslog->syssleeprecord.syssleepmode);
+}
+static DEVICE_ATTR_RO(syssleepmode);
+
+static ssize_t
+syssleepflags_show(struct device *device, struct device_attribute *attr, char *buf)
+{
+	struct scmi_imx_misc_syslog *syslog = dev_get_drvdata(device);
+	u16 size = sizeof(*syslog) / 4;
+	int ret;
+
+	if (!ph)
+		return 0;
+
+	ret = imx_misc_ctrl_ops->misc_syslog(ph, &size, syslog);
+	if (ret)
+		return ret;
+
+	if (size * 4 < offsetofend(struct scmi_imx_misc_sys_sleep_rec, syssleepflags)) {
+		dev_err(device, "%s: returned truncated data\n", __func__);
+		return -EINVAL;
+	}
+
+	return sysfs_emit(buf, "0x%08x\n", syslog->syssleeprecord.syssleepflags);
+}
+static DEVICE_ATTR_RO(syssleepflags);
+
+static ssize_t
+mixpwrstat_show(struct device *device, struct device_attribute *attr, char *buf)
+{
+	struct scmi_imx_misc_syslog *syslog = dev_get_drvdata(device);
+	u16 size = sizeof(*syslog) / 4;
+	int ret;
+
+	if (!ph)
+		return 0;
+
+	ret = imx_misc_ctrl_ops->misc_syslog(ph, &size, syslog);
+	if (ret)
+		return ret;
+
+	if (size * 4 < offsetofend(struct scmi_imx_misc_sys_sleep_rec, mixpwrstat)) {
+		dev_err(device, "%s: returned truncated data\n", __func__);
+		return -EINVAL;
+	}
+
+	return sysfs_emit(buf, "0x%08x\n", syslog->syssleeprecord.mixpwrstat);
+}
+static DEVICE_ATTR_RO(mixpwrstat);
+
+static ssize_t
+mempwrstat_show(struct device *device, struct device_attribute *attr, char *buf)
+{
+	struct scmi_imx_misc_syslog *syslog = dev_get_drvdata(device);
+	u16 size = sizeof(*syslog) / 4;
+	int ret;
+
+	if (!ph)
+		return 0;
+
+	ret = imx_misc_ctrl_ops->misc_syslog(ph, &size, syslog);
+	if (ret)
+		return ret;
+
+	if (size * 4 < offsetofend(struct scmi_imx_misc_sys_sleep_rec, mempwrstat)) {
+		dev_err(device, "%s: returned truncated data\n", __func__);
+		return -EINVAL;
+	}
+
+	return sysfs_emit(buf, "0x%08x\n", syslog->syssleeprecord.mempwrstat);
+}
+static DEVICE_ATTR_RO(mempwrstat);
+
+static ssize_t
+pllpwrstat_show(struct device *device, struct device_attribute *attr, char *buf)
+{
+	struct scmi_imx_misc_syslog *syslog = dev_get_drvdata(device);
+	u16 size = sizeof(*syslog) / 4;
+	int ret;
+
+	if (!ph)
+		return 0;
+
+	ret = imx_misc_ctrl_ops->misc_syslog(ph, &size, syslog);
+	if (ret)
+		return ret;
+
+	if (size * 4 < offsetofend(struct scmi_imx_misc_sys_sleep_rec, pllpwrstat)) {
+		dev_err(device, "%s: returned truncated data\n", __func__);
+		return -EINVAL;
+	}
+
+	return sysfs_emit(buf, "0x%08x\n", syslog->syssleeprecord.pllpwrstat);
+}
+static DEVICE_ATTR_RO(pllpwrstat);
+
+static ssize_t
+sleepentryusec_show(struct device *device, struct device_attribute *attr, char *buf)
+{
+	struct scmi_imx_misc_syslog *syslog = dev_get_drvdata(device);
+	u16 size = sizeof(*syslog) / 4;
+	int ret;
+
+	if (!ph)
+		return 0;
+
+	ret = imx_misc_ctrl_ops->misc_syslog(ph, &size, syslog);
+	if (ret)
+		return ret;
+
+	if (size * 4 < offsetofend(struct scmi_imx_misc_sys_sleep_rec, sleepentryusec)) {
+		dev_err(device, "%s: returned truncated data\n", __func__);
+		return -EINVAL;
+	}
+
+	return sysfs_emit(buf, "%u\n", syslog->syssleeprecord.sleepentryusec);
+}
+static DEVICE_ATTR_RO(sleepentryusec);
+
+static ssize_t
+sleepexitusec_show(struct device *device, struct device_attribute *attr, char *buf)
+{
+	struct scmi_imx_misc_syslog *syslog = dev_get_drvdata(device);
+	u16 size = sizeof(*syslog) / 4;
+	int ret;
+
+	if (!ph)
+		return 0;
+
+	ret = imx_misc_ctrl_ops->misc_syslog(ph, &size, syslog);
+	if (ret)
+		return ret;
+
+	if (size * 4 < offsetofend(struct scmi_imx_misc_sys_sleep_rec, sleepexitusec)) {
+		dev_err(device, "%s: returned truncated data\n", __func__);
+		return -EINVAL;
+	}
+
+	return sysfs_emit(buf, "%u\n", syslog->syssleeprecord.sleepexitusec);
+}
+static DEVICE_ATTR_RO(sleepexitusec);
+
+static ssize_t
+sleepcnt_show(struct device *device, struct device_attribute *attr, char *buf)
+{
+	struct scmi_imx_misc_syslog *syslog = dev_get_drvdata(device);
+	u16 size = sizeof(*syslog) / 4;
+	int ret;
+
+	if (!ph)
+		return 0;
+
+	ret = imx_misc_ctrl_ops->misc_syslog(ph, &size, syslog);
+	if (ret)
+		return ret;
+
+	if (size * 4 < offsetofend(struct scmi_imx_misc_sys_sleep_rec, sleepcnt)) {
+		dev_err(device, "%s: returned truncated data\n", __func__);
+		return -EINVAL;
+	}
+
+	return sysfs_emit(buf, "%u\n", syslog->syssleeprecord.sleepcnt);
+}
+static DEVICE_ATTR_RO(sleepcnt);
+
+static struct attribute *sm_misc_attrs[] = {
+	&dev_attr_wakevector.attr,
+	&dev_attr_syssleepmode.attr,
+	&dev_attr_syssleepflags.attr,
+	&dev_attr_mixpwrstat.attr,
+	&dev_attr_mempwrstat.attr,
+	&dev_attr_pllpwrstat.attr,
+	&dev_attr_sleepentryusec.attr,
+	&dev_attr_sleepexitusec.attr,
+	&dev_attr_sleepcnt.attr,
+	NULL,
+};
+ATTRIBUTE_GROUPS(sm_misc);
+
 static int scmi_imx_misc_ctrl_probe(struct scmi_device *sdev)
 {
 	const struct scmi_handle *handle = sdev->handle;
 	struct device_node *np = sdev->dev.of_node;
+	struct scmi_imx_misc_syslog *syslog;
 	u32 src_id, flags;
 	int ret, i, num;
 
@@ -63,6 +286,12 @@ static int scmi_imx_misc_ctrl_probe(struct scmi_device *sdev)
 	if (IS_ERR(imx_misc_ctrl_ops))
 		return PTR_ERR(imx_misc_ctrl_ops);
 
+	syslog = devm_kzalloc(&sdev->dev, sizeof(*syslog), GFP_KERNEL);
+	if (!syslog)
+		return -ENOMEM;
+
+	dev_set_drvdata(&sdev->dev, syslog);
+
 	num = of_property_count_u32_elems(np, "nxp,ctrl-ids");
 	if (num % 2) {
 		dev_err(&sdev->dev, "Invalid wakeup-sources\n");
@@ -108,6 +337,9 @@ static const struct scmi_device_id scmi_id_table[] = {
 MODULE_DEVICE_TABLE(scmi, scmi_id_table);
 
 static struct scmi_driver scmi_imx_misc_ctrl_driver = {
+	.driver = {
+		.dev_groups = sm_misc_groups,
+	},
 	.name = "scmi-imx-misc-ctrl",
 	.probe = scmi_imx_misc_ctrl_probe,
 	.id_table = scmi_id_table,

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog of MISC protocol
  2025-09-04 10:40 ` [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog " Peng Fan
@ 2025-09-08 11:04   ` Sudeep Holla
  2025-09-08 11:51     ` Peng Fan
  0 siblings, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2025-09-08 11:04 UTC (permalink / raw)
  To: Peng Fan
  Cc: Cristian Marussi, Shawn Guo, Sudeep Holla, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, arm-scmi, imx,
	linux-arm-kernel, linux-kernel

On Thu, Sep 04, 2025 at 06:40:46PM +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                  | 23 ++++++
>  2 files changed, 106 insertions(+)
> 

[...]

> diff --git a/include/linux/scmi_imx_protocol.h b/include/linux/scmi_imx_protocol.h
> index 27bd372cbfb142b6acb0b1cf4b82f061529d0d45..ed78660d2f51c554e782b2f665e5bc5046678fd1 100644
> --- a/include/linux/scmi_imx_protocol.h
> +++ b/include/linux/scmi_imx_protocol.h
> @@ -52,6 +52,27 @@ struct scmi_imx_misc_ctrl_notify_report {
>  	unsigned int		flags;
>  };
>  
> +/*
> + * For more detailed information, need check i.MX SM firmware file:
> + * devices/{SOC}/sm/dev_sm_system.h
> + */
> +struct scmi_imx_misc_sys_sleep_rec {
> +	u32 sleepentryusec;	/* System sleep entry latency */
> +	u32 sleepexitusec;	/* System sleep exit latency */
> +	u32 sleepcnt;		/* System sleep counter */
> +	u32 wakesource;		/* IRQ/exception causing system wake */
> +	u32 mixpwrstat;		/* MIX power status */
> +	u32 mempwrstat;		/* MEM power status */
> +	u32 pllpwrstat;		/* PLL power status */
> +	u32 syssleepmode;	/* System sleep mode */
> +	u32 syssleepflags;	/* System sleep flags */
> +};
> +

Much better now. But I am still thinking if this must go to the document to
make sure it remains ABI and firmware can't reorder the as we might have no
way to deal with that. That's the reason I was asking for raw dump so that
you need not put all these details in the spec/document.

> +struct scmi_imx_misc_syslog {
> +	struct scmi_imx_misc_sys_sleep_rec syssleeprecord;
> +	u32 deverrlog; /* device err log: timers, clocks, console and etc */

This is open ended, please add this to the document and make it more precise.

-- 
Regards,
Sudeep


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 6/6] firmware: imx: sm-misc: Dump syslog info
  2025-09-04 10:40 ` [PATCH v4 6/6] firmware: imx: sm-misc: Dump syslog info Peng Fan
@ 2025-09-08 11:07   ` Sudeep Holla
  0 siblings, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2025-09-08 11:07 UTC (permalink / raw)
  To: Peng Fan
  Cc: Cristian Marussi, Sudeep Holla, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, arm-scmi, imx,
	linux-arm-kernel, linux-kernel

On Thu, Sep 04, 2025 at 06:40:47PM +0800, Peng Fan wrote:
> Add sysfs interface to read System Manager syslog info
> 

Need Shawn's/Sascha's Ack if you want me to take it together with 5/6.
But I would wait for 5/6 discussions to settle first.

-- 
Regards,
Sudeep


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info
  2025-09-04 10:40 [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Peng Fan
                   ` (5 preceding siblings ...)
  2025-09-04 10:40 ` [PATCH v4 6/6] firmware: imx: sm-misc: Dump syslog info Peng Fan
@ 2025-09-08 11:09 ` Sudeep Holla
  2025-09-08 11:53   ` Peng Fan
  2025-09-09 10:32 ` (subset) " Sudeep Holla
  7 siblings, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2025-09-08 11:09 UTC (permalink / raw)
  To: Peng Fan
  Cc: Cristian Marussi, Shawn Guo, Sascha Hauer, Sudeep Holla,
	Pengutronix Kernel Team, Fabio Estevam, arm-scmi, imx,
	linux-arm-kernel, linux-kernel

On Thu, Sep 04, 2025 at 06:40:41PM +0800, Peng Fan wrote:
> System Manager firmware provides API to dump board, silicon, firmware
> information. It also provides API to dump system sleep, wakeup
> information. So add the interface for Linux to retrieve the information:
> 
> patch 1 is to add doc for board information which was missed before.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> Changes in v4:
> - Patch 1: Typo in commit log, state the attribute is set to 0 by firmware
>            add NOT SUPPORTED return value for syslog
> - Patch 2: rename to scmi_imx_misc_build_info_discover, add -EOPNOTSUPP check
> - Patch 3: rename to scmi_imx_misc_cfg_info_get, correct command order,
>            add -EOPNOTSUPP check.
> - Patch 4: correct command order, add -EOPNOTSUPP check.

I will queue 1-4/6 from this series as it is ready. So repost 5-6/6 when
ready. Also I notices some inconsistency with CONTROL vs CTRL in the code
and document. Please choose either CONTROL or CTRL and use the same
in both document and code for the command names and send a patch to fix
the inconsistency.

-- 
Regards,
Sudeep


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog of MISC protocol
  2025-09-08 11:04   ` Sudeep Holla
@ 2025-09-08 11:51     ` Peng Fan
  2025-09-09  4:01       ` Peng Fan
  0 siblings, 1 reply; 17+ messages in thread
From: Peng Fan @ 2025-09-08 11:51 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, arm-scmi@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

Hi Sudeep,

> Subject: Re: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting
> syslog of MISC protocol
[...]
> > +};
> > +
> 
> Much better now. But I am still thinking if this must go to the
> document to make sure it remains ABI and firmware can't reorder the
> as we might have no way to deal with that. That's the reason I was
> asking for raw dump so that you need not put all these details in the
> spec/document.

Let me check with firmware owner whether they would include this
into i.MX SM spec or not. 
If no, raw dump would be the choice.

Thanks,
Peng



^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info
  2025-09-08 11:09 ` [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Sudeep Holla
@ 2025-09-08 11:53   ` Peng Fan
  0 siblings, 0 replies; 17+ messages in thread
From: Peng Fan @ 2025-09-08 11:53 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, arm-scmi@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

> Subject: Re: [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog
> and system_info
> 
> 
> I will queue 1-4/6 from this series as it is ready. 

Thanks for picking up the patches.

So repost 5-6/6 when
> ready. Also I notices some inconsistency with CONTROL vs CTRL in the
> code and document. Please choose either CONTROL or CTRL and use
> the same in both document and code for the command names and
> send a patch to fix the inconsistency.

After the open discussion in patch 5 is done, I will fix all and post
patch 5 and patch 6 in a new patchset.

Thanks,
Peng 

> 
> --
> Regards,
> Sudeep


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog of MISC protocol
  2025-09-08 11:51     ` Peng Fan
@ 2025-09-09  4:01       ` Peng Fan
  2025-09-09  8:58         ` Sudeep Holla
  0 siblings, 1 reply; 17+ messages in thread
From: Peng Fan @ 2025-09-09  4:01 UTC (permalink / raw)
  To: Peng Fan, Sudeep Holla
  Cc: Sudeep Holla, Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, arm-scmi@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

Hi Sudeep,

On Mon, Sep 08, 2025 at 11:51:02AM +0000, Peng Fan wrote:
>Hi Sudeep,
>
>> Subject: Re: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting
>> syslog of MISC protocol
>[...]
>> > +};
>> > +
>> 
>> Much better now. But I am still thinking if this must go to the
>> document to make sure it remains ABI and firmware can't reorder the
>> as we might have no way to deal with that. That's the reason I was
>> asking for raw dump so that you need not put all these details in the
>> spec/document.
>
>Let me check with firmware owner whether they would include this
>into i.MX SM spec or not. 
>If no, raw dump would be the choice.

I checked with firmware owner, this should be using raw dump.
The layout would be changed for new platforms.

Since this is raw dump, I think debugfs might be preferred.

I will post out the patch for 5 an 6 later this week.

Thanks,
Peng

>
>Thanks,
>Peng
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog of MISC protocol
  2025-09-09  4:01       ` Peng Fan
@ 2025-09-09  8:58         ` Sudeep Holla
  2025-09-11 11:15           ` Peng Fan
  0 siblings, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2025-09-09  8:58 UTC (permalink / raw)
  To: Peng Fan
  Cc: Peng Fan, Sudeep Holla, Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, arm-scmi@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

On Tue, Sep 09, 2025 at 12:01:59PM +0800, Peng Fan wrote:
> Hi Sudeep,
> 
> On Mon, Sep 08, 2025 at 11:51:02AM +0000, Peng Fan wrote:
> >Hi Sudeep,
> >
> >> Subject: Re: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting
> >> syslog of MISC protocol
> >[...]
> >> > +};
> >> > +
> >> 
> >> Much better now. But I am still thinking if this must go to the
> >> document to make sure it remains ABI and firmware can't reorder the
> >> as we might have no way to deal with that. That's the reason I was
> >> asking for raw dump so that you need not put all these details in the
> >> spec/document.
> >
> >Let me check with firmware owner whether they would include this
> >into i.MX SM spec or not. 
> >If no, raw dump would be the choice.
> 
> I checked with firmware owner, this should be using raw dump.
> The layout would be changed for new platforms.
> 
> Since this is raw dump, I think debugfs might be preferred.
>

It can be sysfs, but it can be just one single 4K dump, no more details
from the kernel than just raw bytes.

-- 
Regards,
Sudeep


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: (subset) [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info
  2025-09-04 10:40 [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Peng Fan
                   ` (6 preceding siblings ...)
  2025-09-08 11:09 ` [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Sudeep Holla
@ 2025-09-09 10:32 ` Sudeep Holla
  7 siblings, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2025-09-09 10:32 UTC (permalink / raw)
  To: Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Peng Fan
  Cc: Sudeep Holla, arm-scmi, imx, linux-arm-kernel, linux-kernel

On Thu, 04 Sep 2025 18:40:41 +0800, Peng Fan wrote:
> System Manager firmware provides API to dump board, silicon, firmware
> information. It also provides API to dump system sleep, wakeup
> information. So add the interface for Linux to retrieve the information:
>
> patch 1 is to add doc for board information which was missed before.
>
> [...]

Applied to sudeep.holla/linux (for-next/scmi/updates), thanks!

[1/6] firmware: arm_scmi: imx: Add documentation for MISC_BOARD_INFO
      https://git.kernel.org/sudeep.holla/c/646c0c9e06a6
[2/6] firmware: arm_scmi: imx: Support discovering buildinfo of MISC protocol
      https://git.kernel.org/sudeep.holla/c/cc798b105070
[3/6] firmware: arm_scmi: imx: Support getting cfg info of MISC protocol
      https://git.kernel.org/sudeep.holla/c/d3e25c244d53
[4/6] firmware: arm_scmi: imx: Support getting board info of MISC protocol
      https://git.kernel.org/sudeep.holla/c/88d3671baf41
--
Regards,
Sudeep



^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog of MISC protocol
  2025-09-09  8:58         ` Sudeep Holla
@ 2025-09-11 11:15           ` Peng Fan
  2025-09-12 10:28             ` Sudeep Holla
  0 siblings, 1 reply; 17+ messages in thread
From: Peng Fan @ 2025-09-11 11:15 UTC (permalink / raw)
  To: Sudeep Holla, Peng Fan (OSS)
  Cc: Cristian Marussi, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, arm-scmi@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

Hi Sudeep,

> Subject: Re: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting
> syslog of MISC protocol
> 
> >
> > I checked with firmware owner, this should be using raw dump.
> > The layout would be changed for new platforms.
> >
> > Since this is raw dump, I think debugfs might be preferred.
> >
> 
> It can be sysfs, but it can be just one single 4K dump, no more details
> from the kernel than just raw bytes.

Thanks for approving the use of sysfs. However, I've already developed
a patchset based on debugfs, and following a recent internal discussion,
the consensus is to keep this functionality for debugging purposes.
Given that, I'm inclined to continue using debugfs unless there are
any objections.

Thanks,
Peng

> 
> --
> Regards,
> Sudeep


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog of MISC protocol
  2025-09-11 11:15           ` Peng Fan
@ 2025-09-12 10:28             ` Sudeep Holla
  0 siblings, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2025-09-12 10:28 UTC (permalink / raw)
  To: Peng Fan
  Cc: Peng Fan (OSS), Sudeep Holla, Cristian Marussi, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	arm-scmi@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

On Thu, Sep 11, 2025 at 11:15:37AM +0000, Peng Fan wrote:
> Hi Sudeep,
> 
> > Subject: Re: [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting
> > syslog of MISC protocol
> > 
> > >
> > > I checked with firmware owner, this should be using raw dump.
> > > The layout would be changed for new platforms.
> > >
> > > Since this is raw dump, I think debugfs might be preferred.
> > >
> > 
> > It can be sysfs, but it can be just one single 4K dump, no more details
> > from the kernel than just raw bytes.
> 
> Thanks for approving the use of sysfs. However, I've already developed
> a patchset based on debugfs, and following a recent internal discussion,
> the consensus is to keep this functionality for debugging purposes.
> Given that, I'm inclined to continue using debugfs unless there are
> any objections.
> 

No objections if this is for debug purposes only and you do understand
CONFIG_DEBUG_FS is disabled always in production images. Basically you
can't ask customers to share the info from there as it doesn't exist 😉.

-- 
Regards,
Sudeep


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-09-12 10:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04 10:40 [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Peng Fan
2025-09-04 10:40 ` [PATCH v4 1/6] firmware: arm_scmi: imx: Add documentation for MISC_BOARD_INFO Peng Fan
2025-09-04 10:40 ` [PATCH v4 2/6] firmware: arm_scmi: imx: Support discovering buildinfo of MISC protocol Peng Fan
2025-09-04 10:40 ` [PATCH v4 3/6] firmware: arm_scmi: imx: Support getting cfg info " Peng Fan
2025-09-04 10:40 ` [PATCH v4 4/6] firmware: arm_scmi: imx: Support getting board " Peng Fan
2025-09-04 10:40 ` [PATCH v4 5/6] firmware: arm_scmi: imx: Support getting syslog " Peng Fan
2025-09-08 11:04   ` Sudeep Holla
2025-09-08 11:51     ` Peng Fan
2025-09-09  4:01       ` Peng Fan
2025-09-09  8:58         ` Sudeep Holla
2025-09-11 11:15           ` Peng Fan
2025-09-12 10:28             ` Sudeep Holla
2025-09-04 10:40 ` [PATCH v4 6/6] firmware: imx: sm-misc: Dump syslog info Peng Fan
2025-09-08 11:07   ` Sudeep Holla
2025-09-08 11:09 ` [PATCH v4 0/6] firmware: arm_scmi: imx: Dump syslog and system_info Sudeep Holla
2025-09-08 11:53   ` Peng Fan
2025-09-09 10:32 ` (subset) " Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox