firmware: tegra: bpmp: Add support for multi-socket platforms
Jon Hunter
maintainerPATCH 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
@@ -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
Jon Hunter
maintainerQuoted 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.
Signed-off-by Jon Hunter <[email protected]>--- drivers/firmware/tegra/bpmp-debugfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/firmware/tegra/bpmp-debugfs.c +1
-0@@ -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
-1return 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