NVIDIA: SAUCE: firmware: tegra: bpmp: add die specific debugfs nodes
BugLink: https://bugs.launchpad.net/bugs/2080908 In a multidie environment, bpmp debugfs nodes have to be created in separate directories for each die. Create directories with the die number as a suffix. Create a symlink without suffix to die zero directory, for backwards compatibility. http://nvbugs/4466065 Signed-off-by: Stefan Kristiansson <stefank@nvidia.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Noah Wager <noah.wager@canonical.com> Acked-by: Jacob Martin <jacob.martin@canonical.com> Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
committed by
Noah Wager
parent
2dcd8893f2
commit
95386b72f2
@@ -772,6 +772,8 @@ free:
|
||||
int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
|
||||
{
|
||||
struct dentry *root;
|
||||
struct dentry *symlink = NULL;
|
||||
char tmp[10];
|
||||
bool inband;
|
||||
int err;
|
||||
|
||||
@@ -780,10 +782,19 @@ 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) {
|
||||
root = debugfs_create_dir("bpmp", NULL);
|
||||
} else {
|
||||
snprintf(tmp, sizeof(tmp), "bpmp%d", dev_to_node(bpmp->dev));
|
||||
root = debugfs_create_dir(tmp, NULL);
|
||||
}
|
||||
|
||||
if (IS_ERR(root))
|
||||
return -ENOMEM;
|
||||
|
||||
if (dev_to_node(bpmp->dev) == 0)
|
||||
symlink = debugfs_create_symlink("bpmp", NULL, "bpmp0");
|
||||
|
||||
bpmp->debugfs_mirror = debugfs_create_dir("debug", root);
|
||||
if (IS_ERR(bpmp->debugfs_mirror)) {
|
||||
err = -ENOMEM;
|
||||
@@ -797,8 +808,10 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
|
||||
err = bpmp_populate_debugfs_shmem(bpmp);
|
||||
|
||||
out:
|
||||
if (err < 0)
|
||||
if (err < 0) {
|
||||
debugfs_remove(symlink);
|
||||
debugfs_remove_recursive(root);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user