linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pmdomain: arm: Fix debugfs node creation failure
@ 2024-07-03 11:07 Sibi Sankar
  2024-07-04 10:32 ` Sudeep Holla
  2024-09-04  7:21 ` Johan Hovold
  0 siblings, 2 replies; 12+ messages in thread
From: Sibi Sankar @ 2024-07-03 11:07 UTC (permalink / raw)
  To: ulf.hansson, sudeep.holla, cristian.marussi
  Cc: linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm, linux-pm,
	quic_rgottimu, quic_kshivnan, quic_sibis, johan

The domain attributes returned by the perf protocol can end up
reporting identical names across domains, resulting in debugfs
node creation failure. Fix this duplication by appending the
domain-id to the domain name.

Logs:
debugfs: Directory 'NCC' with parent 'pm_genpd' already present!
debugfs: Directory 'NCC' with parent 'pm_genpd' already present!

Fixes: 2af23ceb8624 ("pmdomain: arm: Add the SCMI performance domain")
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
---
 drivers/pmdomain/arm/scmi_perf_domain.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/pmdomain/arm/scmi_perf_domain.c b/drivers/pmdomain/arm/scmi_perf_domain.c
index d7ef46ccd9b8..0af5dc941349 100644
--- a/drivers/pmdomain/arm/scmi_perf_domain.c
+++ b/drivers/pmdomain/arm/scmi_perf_domain.c
@@ -18,6 +18,7 @@ struct scmi_perf_domain {
 	const struct scmi_perf_proto_ops *perf_ops;
 	const struct scmi_protocol_handle *ph;
 	const struct scmi_perf_domain_info *info;
+	char domain_name[SCMI_MAX_STR_SIZE];
 	u32 domain_id;
 };
 
@@ -123,7 +124,12 @@ static int scmi_perf_domain_probe(struct scmi_device *sdev)
 		scmi_pd->domain_id = i;
 		scmi_pd->perf_ops = perf_ops;
 		scmi_pd->ph = ph;
-		scmi_pd->genpd.name = scmi_pd->info->name;
+
+		/* Domain attributes can report identical names across domains */
+		snprintf(scmi_pd->domain_name, sizeof(scmi_pd->domain_name), "%s-%d",
+			 scmi_pd->info->name, scmi_pd->domain_id);
+
+		scmi_pd->genpd.name = scmi_pd->domain_name;
 		scmi_pd->genpd.flags = GENPD_FLAG_ALWAYS_ON |
 				       GENPD_FLAG_OPP_TABLE_FW;
 		scmi_pd->genpd.set_performance_state = scmi_pd_set_perf_state;
-- 
2.34.1



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

end of thread, other threads:[~2024-10-07  7:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03 11:07 [PATCH] pmdomain: arm: Fix debugfs node creation failure Sibi Sankar
2024-07-04 10:32 ` Sudeep Holla
2024-07-05  3:46   ` Sibi Sankar
2024-07-05 13:04     ` Sudeep Holla
2024-07-08 10:07       ` Sibi Sankar
2024-08-07  0:51         ` Peng Fan
2024-08-14 12:38       ` Ulf Hansson
2024-08-14 13:31         ` Sudeep Holla
2024-08-15 10:46           ` Ulf Hansson
2024-08-15 13:46             ` Sudeep Holla
2024-10-07  7:08               ` Sibi Sankar
2024-09-04  7:21 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).