You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
provide interface to query loaded firmware and topology to userspace via debugfs #3867
As the logic has got more complicated to select the SOF firmware and topology filenames to load, it is getting more and more difficult to write robust test-cases that need to match test-content with the topology and firmware loaded.
To make test case development easier and more robust, the kernel should expose the firmware and topologies that have been loaded via debugfs or sysfs.
So i was thinking we can either
(a) We get FW and TPLG path if we enable debug logs, the same print can be made dev_info - this might be easier but prone to extra log ( Also during long duration automation, the log might have been overwritten
Better solution is to provide as debugfs
So the FW and TPLG path gets recorded ( we can pick the path when its about to load) to ensure we have all the suffix covered.
@sathyap-chrome the Chrome case is inextricable, since you have overlays the name of the files can be ambiguous and point to different topologies or firmware files. You will need a MD5 signature to identify the files I am afraid....
@plbossart The place where we request the final FW or TPLG to load has all the path information including the overlay names to be added. I can do some experiments and share more insights tomorrow.
This seems like a very basic security requirement to me (even more basic that "Tainted!") but what do I know. Right now it does not even log the names by default.
The kernel simply needs to tell userspace whether it loaded sof-tgl.ri or community/sof-tgl.ri or cavs-whatever.dsp. Same for the topology file. That's all, no need to read any sof-test pull request.
The kernel simply needs to tell userspace whether it loaded sof-tgl.ri or community/sof-tgl.ri or cavs-whatever.dsp. Same for the topology file. That's all, no need to read any sof-test pull request.
Anything still unclear?
@marc-hb dmesg already has this information doesnt it?
dmesg is a ring buffer in non-persistent RAM. So it wraps around and loses any information very quickly. dmesg is convenient in interactive use but totally useless in scripts (it's also missing userspace logs, timestamps,... I digress). Let's forget dmesg. Rephrasing your question:
@marc-hbjournalctl -b already has this information doesnt it?
Yes and as I just mentioned above (we posted at almost the same time) we already have code in some sof-test places that tries to parse journalctl. However this parsing has bugs and limitations (e.g: switching ipc_type, not failing after unloading the driver, dependency on the log level, lack of test developers and shell expertise, ...), hence this request.
However this parsing has bugs and limitations (e.g: switching ipc_type, not failing after unloading the driver, dependency on the log level, lack of test developers and shell expertise, ...), hence this request.
I am not aware of any bugs or request to fix the existing solution. Seriously we've provided this firmware name forever and there's been no ask for any change for a very long time, and now we need a TDB interface to fix everything. Allow me to be reasonably suspicious on this one. We have to prioritize and that feels like a low low priority to me.
I'd still like to do (some of) this and I think it's more needed than ever (see all backlinks above) but I'm soon going away for a long vacation until Sept 2023. Unassigning myself.
Activity
sathyap-chrome commentedon Sep 19, 2022
Thanks @kv2019i for initiating. This helps in case of Chrome too as we have multiple diffferent path for FW and TPLG as below
eg1 : intel/sof/community/
eg2 : intel/sof/<board_name>/
We have multiple topology for same board name too:
eg1: intel/sof/board1/board1_2mic.tplg
eg2: intel/sof/board1/board1_4mic.tplg
So i was thinking we can either
(a) We get FW and TPLG path if we enable debug logs, the same print can be made dev_info - this might be easier but prone to extra log ( Also during long duration automation, the log might have been overwritten
Better solution is to provide as debugfs
So the FW and TPLG path gets recorded ( we can pick the path when its about to load) to ensure we have all the suffix covered.
plbossart commentedon Sep 19, 2022
@sathyap-chrome the Chrome case is inextricable, since you have overlays the name of the files can be ambiguous and point to different topologies or firmware files. You will need a MD5 signature to identify the files I am afraid....
sathyap-chrome commentedon Sep 19, 2022
@plbossart The place where we request the final FW or TPLG to load has all the path information including the overlay names to be added. I can do some experiments and share more insights tomorrow.
marc-hb commentedon Sep 23, 2022
Hopefully short digression: the https://www.kernel.org/doc/html/latest/driver-api/firmware/request_firmware.html API should really provide a list of all firmware names (not just audio FW and tplg) that were requested and successfully loaded somewhere in
/sys/. A checksum would be ideal. Unlike the audio (or other) driver it could also report about/lib/firmware/updates/etc.This seems like a very basic security requirement to me (even more basic that "Tainted!") but what do I know. Right now it does not even log the names by default.
I typically add a hack like this:
plbossart commentedon Sep 28, 2022
this enhancement request will be parked until we have more clarity on the ask.
kv2019i commentedon Sep 28, 2022
@plbossart Isn't the sof-test need quite clear -> thesofproject/sof-test#956 (comment)
plbossart commentedon Sep 28, 2022
no it's not @kv2019i. I have no context and no desire to read pages of mtrace-related threads.
kv2019i commentedon Sep 28, 2022
Let me retry then @plbossart . Maybe we need to also deepdive into the generic request_firmware() and why the information is not logged.
marc-hb commentedon Sep 28, 2022
The kernel simply needs to tell userspace whether it loaded
sof-tgl.riorcommunity/sof-tgl.riorcavs-whatever.dsp. Same for the topology file. That's all, no need to read any sof-test pull request.Anything still unclear?
marc-hb commentedon Sep 28, 2022
No, parsing logs is slow and unreliable when switching
ipc_typeor using some overrides (sof-test already does it in some places).ranj063 commentedon Sep 28, 2022
@marc-hb dmesg already has this information doesnt it?
marc-hb commentedon Sep 28, 2022
dmesgis a ring buffer in non-persistent RAM. So it wraps around and loses any information very quickly.dmesgis convenient in interactive use but totally useless in scripts (it's also missing userspace logs, timestamps,... I digress). Let's forgetdmesg. Rephrasing your question:Yes and as I just mentioned above (we posted at almost the same time) we already have code in some sof-test places that tries to parse
journalctl. However this parsing has bugs and limitations (e.g: switchingipc_type, not failing after unloading the driver, dependency on the log level, lack of test developers and shell expertise, ...), hence this request.plbossart commentedon Sep 29, 2022
I am not aware of any bugs or request to fix the existing solution. Seriously we've provided this firmware name forever and there's been no ask for any change for a very long time, and now we need a TDB interface to fix everything. Allow me to be reasonably suspicious on this one. We have to prioritize and that feels like a low low priority to me.
marc-hb commentedon Oct 20, 2022
Here's the latest example of how brittle and hard to maintain is the current solution:
There are many others in the sof-test git log and there will be more.
The brittleness of parsing debug logs seems pretty obvious to me (while 973 does something different, I can't even remember why. Good luck)
I'm lost sorry: who provided what?
IPC4 /
dsp_basefw.binis the straw that breaks the camel's back.8 remaining items
marc-hb commentedon Jul 17, 2023
I'd still like to do (some of) this and I think it's more needed than ever (see all backlinks above) but I'm soon going away for a long vacation until Sept 2023. Unassigning myself.
ASoC: SOF: debug: show firmware/topology prefix/names
ASoC: SOF: debug: show firmware/topology prefix/names
ASoC: SOF: debug: show firmware/topology prefix/names
ASoC: SOF: debug: show firmware/topology prefix/names
ASoC: SOF: debug: show firmware/topology prefix/names
ASoC: SOF: debug: show firmware/topology prefix/names
ASoC: SOF: debug: show firmware/topology prefix/names
ASoC: SOF: debug: show firmware/topology prefix/names
marc-hb commentedon Apr 23, 2024
fw_profileis brand new and still a bit buggy (e.g. thesofproject/sof-test#1178) bit it's there and it works.UPSTREAM: ASoC: SOF: debug: show firmware/topology prefix/names