All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: tegra: Support unique names for multi-socket platforms
@ 2026-05-22 16:30 Jon Hunter
  2026-05-26 17:26 ` Brian Masney
  2026-05-29 15:30 ` Jon Hunter
  0 siblings, 2 replies; 3+ messages in thread
From: Jon Hunter @ 2026-05-22 16:30 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Thierry Reding
  Cc: linux-clk, linux-tegra, Jon Hunter, Timo Alho

On multi-socket platforms each socket has its own BPMP which exposes the
same clock names. Fix this by appending the NUMA ID as suffix to the
clock names for multi-socket platforms.

Use 'sizeof(info->name)' in the strscpy() and snprintf() functions to
future proof against anyone changing the size of the 'name' array.

Co-developed-by: Timo Alho <talho@nvidia.com>
Signed-off-by: Timo Alho <talho@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/clk/tegra/clk-bpmp.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/tegra/clk-bpmp.c b/drivers/clk/tegra/clk-bpmp.c
index f6d2b934228b..428e776561c5 100644
--- a/drivers/clk/tegra/clk-bpmp.c
+++ b/drivers/clk/tegra/clk-bpmp.c
@@ -367,7 +367,15 @@ static int tegra_bpmp_clk_get_info(struct tegra_bpmp *bpmp, unsigned int id,
 	if (err < 0)
 		return err;
 
-	strscpy(info->name, response.name, MRQ_CLK_NAME_MAXLEN);
+	if (dev_to_node(bpmp->dev) == NUMA_NO_NODE) {
+		strscpy(info->name, response.name, sizeof(info->name));
+	} else {
+		err = snprintf(info->name, sizeof(info->name), "%s.%d",
+			       response.name, dev_to_node(bpmp->dev));
+		if (WARN_ON(err >= sizeof(info->name)))
+			return -E2BIG;
+	}
+
 	info->num_parents = response.num_parents;
 
 	for (i = 0; i < info->num_parents; i++)
-- 
2.43.0


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

end of thread, other threads:[~2026-05-29 15:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 16:30 [PATCH] clk: tegra: Support unique names for multi-socket platforms Jon Hunter
2026-05-26 17:26 ` Brian Masney
2026-05-29 15:30 ` Jon Hunter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.