Repository navigation
Conversation
ujfalusi
requested review from
bardliao,
lyakh,
ranj063 and
singalsu
as code owners
October 22, 2026 11:33
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent debugfs reads can access freed memory, and unchecked allocation failures can publish incomplete topology lists.
2 open issues
What changed in this PR
This PR updates SOF’s fw_profile/tplg_name debugfs entry to report loaded topology files rather than a placeholder when function topologies are used.
Changes:
- Collect loaded topology filenames, separated by newlines and without the shared path prefix.
- Publish the collected list after successful topology completion, retaining the selected name as the initial value.
| File | Description |
|---|---|
| sound/soc/sof/topology.c | Collects filenames and publishes the loaded topology list. |
| sound/soc/sof/sof-priv.h | Adds storage for the loaded topology names. |
| sound/soc/sof/debug.c | Initializes the name storage and exposes it through debugfs. |
Review effort: Balanced
Comment on lines
+2684
to
+2685
| devm_kfree(sdev->dev, sdev->loaded_tplg_names); | ||
| sdev->loaded_tplg_names = tplg_names; |
bardliao
previously approved these changes
Oct 22, 2026
ujfalusi
force-pushed
the
peter/sof/pr/show-all-loaded-topologies
branch
from
October 23, 2026 06:09
a50e45e to
fde6d64
Compare
The fw_profile/tplg_name debugfs file exposes the topology file name selected for the platform. When function topologies are used, the selected name is a placeholder (sof-<platform>-dummy.tplg) which does not tell which topology files have actually been loaded. Replace the static name with a list of the loaded topology files, one per line, set by snd_sof_load_topology() after a successful load and cleared again when the topology is removed in sof_pcm_remove(). The topology path prefix is dropped from the names as it is exposed separately via fw_profile/tplg_path. The file is backed by a seq_file reader instead of debugfs_create_str() so that the list can be replaced under a mutex without racing with concurrent readers. While no topology is loaded the selected topology name is shown. For monolithic topologies the content of the file is unchanged. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Comment on lines
+2630
to
+2631
| if (ret < 0) | ||
| goto out; |
Comment on lines
+2682
to
+2683
| if (ret < 0) | ||
| goto out; |
Collaborator
Author
|
Changes since v1:
@harajend , this might impact CI as now with function (and feature) topologies the tplg_name will contain all the loaded topology files in the order they were loaded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


The fw_profile/tplg_name debugfs file exposes the topology file name selected for the platform. When function topologies are used, the selected name is a placeholder (sof--dummy.tplg) which does not tell which topology files have actually been loaded.
Replace the static name with a list of the loaded topology files, one per line, updated by snd_sof_load_topology() after a successful load. The topology path prefix is dropped from the names as it is exposed separately via fw_profile/tplg_path.
For monolithic topologies the content of the file is unchanged.