[PATCH v5 18/23] firmware: arm_scmi: Expose per-instance identifier
Cristian Marussi
cristian.marussi at arm.com
Fri Jul 3 05:35:56 PDT 2026
When multiple SCMI instances are configured, the SCMI stack probes and
it is initialized multiple times: one core stack for each defined instance.
Each istance is simply identified internally with a number and such number
is already exposed to the user to name the root of the per-instance debugfs
subtree, if enabled.
Expose such unique identifier to the SCMI drivers so that they can use
that same identifier when in need to name their per-instance resources.
Signed-off-by: Cristian Marussi <cristian.marussi at arm.com>
---
drivers/firmware/arm_scmi/driver.c | 1 +
include/linux/scmi_protocol.h | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index d54d155e69a8..619d01523729 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -3297,6 +3297,7 @@ static int scmi_probe(struct platform_device *pdev)
idr_init(&info->rx_idr);
handle = &info->handle;
+ handle->id = info->id;
handle->dev = info->dev;
handle->version = &info->version;
handle->devm_protocol_acquire = scmi_devm_protocol_acquire;
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index c932390b9a09..b90913235225 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -1109,6 +1109,10 @@ struct scmi_notify_ops {
/**
* struct scmi_handle - Handle returned to ARM SCMI clients for usage.
*
+ * @id: A unique positive natural integer identifying the SCMI Instance
+ * associated with this handle to be used across all drivers for
+ * naming purposes: same identifier used internally as the root for
+ * the debugfs per-instance tree.
* @dev: pointer to the SCMI device
* @version: pointer to the structure containing SCMI version information
* @devm_protocol_acquire: devres managed method to get hold of a protocol,
@@ -1135,6 +1139,7 @@ struct scmi_notify_ops {
* @notify_ops: pointer to set of notifications related operations
*/
struct scmi_handle {
+ unsigned int id;
struct device *dev;
struct scmi_base_info *version;
--
2.54.0
More information about the linux-arm-kernel
mailing list