Repository navigation
Conversation
…cy fallback Add support for runtime IPC4 SOF info discovery via SOF_IPC4_FW_PARAM_SOF_INFO_GET (37) gated by the SOF_IPC4_SOF_CAPS capability bit SOF_IPC4_SOF_CAP_RUNTIME_SOF_INFO: - Protect cached firmware codec_info with codec_info_mutex across loader updates and compress capability queries. - Query SOF info TLVs after firmware boot, on LLEXT library load/reload, and before compress capability/parameter checks when the firmware advertises SOF_IPC4_SOF_CAP_RUNTIME_SOF_INFO. - Preserve boot-time FW_CONFIG SOF_IPC4_SOF_CODEC_INFO parsing so newer kernels work seamlessly with older firmware that does not implement runtime SOF_INFO queries. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
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.
Summary
Upgrade IPC4 firmware codec capability discovery in the Linux SOF host driver to query runtime codec information via
SOF_IPC4_FW_PARAM_SOF_INFO_GET(37) as LLEXT libraries are loaded or reloaded, while retaining boot-timeFW_CONFIG(SOF_IPC4_SOF_CODEC_INFO) fallback for backwards compatibility with older firmware.Companion SOF firmware PR: thesofproject/sof#11472
Changes
include/sound/sof/ipc4/header.h: AddedSOF_IPC4_FW_PARAM_SOF_INFO_GET = 37,SOF_IPC4_SOF_CAPS = 1, andSOF_IPC4_SOF_CAP_RUNTIME_SOF_INFO.sound/soc/sof/ipc4-priv.h&sound/soc/sof/ipc4.c: Addedcodec_info_mutex(protecting runtime replacement and compress reads ofipc4_data->codec_info, freed insof_ipc4_exit()) andsof_info_runtime_supported.sound/soc/sof/ipc4-loader.c:sof_ipc4_parse_sof_info()with TLV bounds validation,SOF_IPC4_SOF_CAPScapability parsing, and mutex-protected replacement ofipc4_data->codec_info.sof_ipc4_query_sof_info()to fetch updated TLVs viaSOF_IPC4_FW_PARAM_SOF_INFO_GETwhensof_info_runtime_supportedis advertised, invoked fromsof_ipc4_query_fw_configuration(),sof_ipc4_load_library(), andsof_ipc4_reload_fw_libraries().sound/soc/sof/ipc4-compress.c:sof_ipc4_compr_refresh_codec_info()and called it insof_ipc4_compr_get_caps()and beforesof_ipc4_compr_codec_supported()insof_ipc4_compr_set_params().codec_infoaccesses withcodec_info_mutexand removed the redundant secondsnd_sof_boot_dsp_firmware()call insof_ipc4_compr_set_params().Backwards Compatibility
SOF_IPC4_SOF_CAP_RUNTIME_SOF_INFOskipsSOF_IPC4_FW_PARAM_SOF_INFO_GETIPCs and uses theSOF_IPC4_SOF_CODEC_INFOtuple parsed from boot-timeFW_CONFIG.SOF_IPC4_SOF_CODEC_INFOduringFW_CONFIG, and older kernels ignoreSOF_IPC4_SOF_CAPS.Verification
scripts/checkpatch.plon the commit: 0 errors, 0 warnings.make M=sound/soc/sofcompiled cleanly with 0 warnings/errors.