Skip to contentSkip to conversation

firmware: arm_scmi: Minor cleanups and documentation fixes

PATCH In review Artem Shimko 2 participants 5 messages Sep 1, 2025 – Sep 5, 2025 System control & power/management interface (SCPI/SCMI) Message Protocol drivers

lore
Share & tools
lore
#0 lore raw

cover firmware: arm_scmi: Minor cleanups and documentation fixes

Hello maintainers,

This small patch series addresses some minor issues found in the SCMI driver:

Patch 1 fixes alignment and indentation inconsistencies in two files:

Adjusts function parameter alignment in protocol_id_show()

Fixes debugfs call alignment in raw_mode.c for better readability

Patch 2 adds missing documentation for the xfer_lock spinlock that protects access to xfer buffers and transfer allocation mechanism, making the code more maintainable and easier to understand.

These are straightforward cleanups that don't change any functionality but improve code quality and documentation.

Best regards,
Artem Shimko

Artem Shimko (2):
firmware: arm_scmi: fix alignment in protocol_id_show and debugfs calls
firmware: arm_scmi: add missing spinlock documentation

 drivers/firmware/arm_scmi/bus.c      | 2 +-
 drivers/firmware/arm_scmi/driver.c   | 1 +
 drivers/firmware/arm_scmi/raw_mode.c | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 firmware: arm_scmi: fix alignment in protocol_id_show and debugfs calls

This patch fixes minor alignment/indentation issues in the SCMI driver:
Adjusts indentation in protocol_id_show function to maintain consistency Fixes alignment in debugfs_create_file_aux_num calls in raw_mode.c

---
 drivers/firmware/arm_scmi/bus.c      | 2 +-
 drivers/firmware/arm_scmi/raw_mode.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/arm_scmi/bus.c +1 -1
index 24e59ddf85e7..e1e82139997c 100644
@@ -298,7 +298,7 @@ static ssize_t modalias_show(struct device *dev,
 static DEVICE_ATTR_RO(modalias);
 
 static ssize_t protocol_id_show(struct device *dev,
-				 struct device_attribute *attr, char *buf)
+				struct device_attribute *attr, char *buf)
 {
 	struct scmi_device *scmi_dev = to_scmi_dev(dev);
 
drivers/firmware/arm_scmi/raw_mode.c +2 -2
index 73db5492ab44..c85647562ba3 100644
@@ -1280,8 +1280,8 @@ void *scmi_raw_mode_init(const struct scmi_handle *handle,
 			chd = debugfs_create_dir(cdir, top_chans);
 
 			debugfs_create_file_aux_num("message", 0600, chd,
-					    raw, channels[i],
-					    &scmi_dbg_raw_mode_message_fops);
+						    raw, channels[i],
+						    &scmi_dbg_raw_mode_message_fops);
 
 			debugfs_create_file_aux_num("message_async", 0600, chd,
 					    raw, channels[i],
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/2 firmware: arm_scmi: add missing spinlock documentation

In reply to Artem Shimko

Adds a missing comment for xfer_lock spinlock in struct scmi_xfers_info. The spinlock protects access to the xfer buffers and transfer allocation mechanism, preventing race conditions in concurrent access scenarios.

---
 drivers/firmware/arm_scmi/driver.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firmware/arm_scmi/driver.c +1 -0
index bd56a877fdfc..6828392152f4 100644
@@ -76,6 +76,7 @@ static struct dentry *scmi_top_dentry;
  */
 struct scmi_xfers_info {
 	unsigned long *xfer_alloc_table;
+	/* Protects access to the xfer buffers */
 	spinlock_t xfer_lock;
 	int max_msg;
 	struct hlist_head free_xfers;
Signature · 1 line
2.43.0
#3 lore raw

Re: [PATCH 2/2] firmware: arm_scmi: add missing spinlock documentation

Quoted 14 lines · Artem Shimko

Adds a missing comment for xfer_lock spinlock in struct scmi_xfers_info. The spinlock protects access to the xfer buffers and transfer allocation mechanism, preventing race conditions in concurrent access scenarios.

---
 drivers/firmware/arm_scmi/driver.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firmware/arm_scmi/driver.c +0 -0
index bd56a877fdfc..6828392152f4 100644

drivers/firmware/arm_scmi/driver.c static struct dentry *scmi_top_dentry; · line 79

Quoted 4 lines
drivers/firmware/arm_scmi/driver.c +1 -0
@@ -76,6 +76,7 @@ static struct dentry *scmi_top_dentry;
  */
 struct scmi_xfers_info {
 	unsigned long *xfer_alloc_table;
+	/* Protects access to the xfer buffers */

Thanks for your patch but this is quite obvious and I see no point in just adding this comment.

Signature · 2 lines
Regards,
Sudeep
#4 lore raw

Re: [PATCH 2/2] firmware: arm_scmi: add missing spinlock documentation

Hi Sudeep,

Thank you for the review and your feedback on my SCMI patch! I really appreciate you taking the time to look at it.

Best regards,
Artem Shimko