Skip to contentSkip to conversation

firmware: tegra: bpmp: Add support for multi-socket platforms

PATCH In review Jon Hunter 1 participant 2 messages May 22 – May 29 Tegra architecture support

lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

PATCH 1/1 firmware: tegra: bpmp: Add support for multi-socket platforms

On multi-socket platforms each socket has its own BPMP that is registered with the kernel. For such platforms append the NUMA ID for each socket to the BPMP debugfs directory name to ensure there is a unique name for each BPMP. Note that a 32 byte array is more than large enough for storing the name.

---
 drivers/firmware/tegra/bpmp-debugfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/firmware/tegra/bpmp-debugfs.c +5 -1
index 4221fed70ad4..4f15aae5f124 100644
@@ -772,6 +772,7 @@ static int bpmp_populate_debugfs_shmem(struct tegra_bpmp *bpmp)
 int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
 {
 	struct dentry *root;
+	char name[32] = "bpmp";
 	bool inband;
 	int err;
 
@@ -780,7 +781,10 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
 	if (!inband && !tegra_bpmp_mrq_is_supported(bpmp, MRQ_DEBUGFS))
 		return 0;
 
-	root = debugfs_create_dir("bpmp", NULL);
+	if (dev_to_node(bpmp->dev) != NUMA_NO_NODE)
+		snprintf(name, sizeof(name), "bpmp.%d", dev_to_node(bpmp->dev));
+
+	root = debugfs_create_dir(name, NULL);
 	if (IS_ERR(root))
 		return -ENOMEM;
 
Signature · 1 line
2.43.0
author maintainer
#1 lore raw
Quoted 25 lines · Jon Hunter

On multi-socket platforms each socket has its own BPMP that is registered with the kernel. For such platforms append the NUMA ID for each socket to the BPMP debugfs directory name to ensure there is a unique name for each BPMP. Note that a 32 byte array is more than large enough for storing the name.

---
  drivers/firmware/tegra/bpmp-debugfs.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
drivers/firmware/tegra/bpmp-debugfs.c +1 -0
index 4221fed70ad4..4f15aae5f124 100644
@@ -772,6 +772,7 @@ static int bpmp_populate_debugfs_shmem(struct tegra_bpmp *bpmp)
  int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
  {
  	struct dentry *root;
+	char name[32] = "bpmp";
  	bool inband;
  	int err;
 
@@ -780,7 +781,10 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
  	if (!inband && !tegra_bpmp_mrq_is_supported(bpmp, MRQ_DEBUGFS))

drivers/firmware/tegra/bpmp-debugfs.c int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp) · line 790

Quoted 10 lines
drivers/firmware/tegra/bpmp-debugfs.c +4 -1
  		return 0;
 
-	root = debugfs_create_dir("bpmp", NULL);
+	if (dev_to_node(bpmp->dev) != NUMA_NO_NODE)
+		snprintf(name, sizeof(name), "bpmp.%d", dev_to_node(bpmp->dev));
+
+	root = debugfs_create_dir(name, NULL);
  	if (IS_ERR(root))
  		return -ENOMEM;
 

On further review, for multi-socket platforms, I think it would be best if we put the 'bpmp.X' under a top level 'bpmp' directory. I will send out an updated patch to do this.

Jon

Signature · 1 line
nvpublic