diff options
author | Mark Brown <broonie@kernel.org> | 2023-12-15 17:56:07 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-12-15 17:56:07 +0000 |
commit | c27032b402a10d9f258224685322f121de0808e5 (patch) | |
tree | 7a1bfe60ded0745bed314f51670ccc63864ebe43 /sound/soc/sof | |
parent | e7a4a2fd9a4116286a1523ea1a5cbabd2c36f5b9 (diff) | |
parent | 3a0e7bb86f8728d94d55c56fb73e86be7976c163 (diff) |
ASoC: SOF: query FW config to reload library
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:
We should query FW config if context save is supported, and no need
to reload FW if hda->booted_from_imr and ipc4_data->fw_context_save
are true.
Diffstat (limited to 'sound/soc/sof')
-rw-r--r-- | sound/soc/sof/intel/hda-loader.c | 5 | ||||
-rw-r--r-- | sound/soc/sof/intel/lnl.c | 2 | ||||
-rw-r--r-- | sound/soc/sof/intel/mtl.c | 2 | ||||
-rw-r--r-- | sound/soc/sof/intel/tgl.c | 2 | ||||
-rw-r--r-- | sound/soc/sof/ipc4-loader.c | 3 | ||||
-rw-r--r-- | sound/soc/sof/ipc4-priv.h | 1 |
6 files changed, 13 insertions, 2 deletions
diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c index 1805cf754beb..b81f231abee3 100644 --- a/sound/soc/sof/intel/hda-loader.c +++ b/sound/soc/sof/intel/hda-loader.c @@ -519,14 +519,15 @@ int hda_dsp_ipc4_load_library(struct snd_sof_dev *sdev, struct sof_ipc4_fw_library *fw_lib, bool reload) { struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; + struct sof_ipc4_fw_data *ipc4_data = sdev->private; struct hdac_ext_stream *hext_stream; struct firmware stripped_firmware; struct sof_ipc4_msg msg = {}; struct snd_dma_buffer dmab; int ret, ret1; - /* IMR booting will restore the libraries as well, skip the loading */ - if (reload && hda->booted_from_imr) + /* if IMR booting is enabled and fw context is saved for D3 state, skip the loading */ + if (reload && hda->booted_from_imr && ipc4_data->fw_context_save) return 0; /* the fw_lib has been verified during loading, we can trust the validity here */ diff --git a/sound/soc/sof/intel/lnl.c b/sound/soc/sof/intel/lnl.c index a095f5bcf50d..30712ea05a7a 100644 --- a/sound/soc/sof/intel/lnl.c +++ b/sound/soc/sof/intel/lnl.c @@ -133,6 +133,8 @@ int sof_lnl_ops_init(struct snd_sof_dev *sdev) ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2; + ipc4_data->fw_context_save = true; + /* External library loading support */ ipc4_data->load_library = hda_dsp_ipc4_load_library; diff --git a/sound/soc/sof/intel/mtl.c b/sound/soc/sof/intel/mtl.c index 3121a89219dd..c14a80dd90fd 100644 --- a/sound/soc/sof/intel/mtl.c +++ b/sound/soc/sof/intel/mtl.c @@ -718,6 +718,8 @@ int sof_mtl_ops_init(struct snd_sof_dev *sdev) ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2; + ipc4_data->fw_context_save = true; + /* External library loading support */ ipc4_data->load_library = hda_dsp_ipc4_load_library; diff --git a/sound/soc/sof/intel/tgl.c b/sound/soc/sof/intel/tgl.c index d890cac6cb01..c2bb04c89b9d 100644 --- a/sound/soc/sof/intel/tgl.c +++ b/sound/soc/sof/intel/tgl.c @@ -91,6 +91,8 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev) ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2; + ipc4_data->fw_context_save = true; + /* External library loading support */ ipc4_data->load_library = hda_dsp_ipc4_load_library; diff --git a/sound/soc/sof/ipc4-loader.c b/sound/soc/sof/ipc4-loader.c index eaa04762eb11..3539b0a66e1b 100644 --- a/sound/soc/sof/ipc4-loader.c +++ b/sound/soc/sof/ipc4-loader.c @@ -391,6 +391,9 @@ int sof_ipc4_query_fw_configuration(struct snd_sof_dev *sdev) goto out; } break; + case SOF_IPC4_FW_CONTEXT_SAVE: + ipc4_data->fw_context_save = *tuple->value; + break; default: break; } diff --git a/sound/soc/sof/ipc4-priv.h b/sound/soc/sof/ipc4-priv.h index fea93b693f4d..1d39836d5efa 100644 --- a/sound/soc/sof/ipc4-priv.h +++ b/sound/soc/sof/ipc4-priv.h @@ -81,6 +81,7 @@ struct sof_ipc4_fw_data { u32 mtrace_log_bytes; int max_num_pipelines; u32 max_libs_count; + bool fw_context_save; int (*load_library)(struct snd_sof_dev *sdev, struct sof_ipc4_fw_library *fw_lib, bool reload); |