Commit 246b135f authored by Daniel Baluta's avatar Daniel Baluta Committed by Mark Brown

ASoC: SOF: compress: Prevent current kernel running with older FW

After introducing extended parameters we need to forbid older firmware
versions to run with the current and future kernel versions.

Although in theory the communication protocol will still work the
semantics at application level are undefined. So, prevent this by
disallowing older firmwares to run with newer kernels.
Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220712141531.14599-4-daniel.baluta@oss.nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3f70c360
...@@ -167,12 +167,23 @@ static int sof_compr_set_params(struct snd_soc_component *component, ...@@ -167,12 +167,23 @@ static int sof_compr_set_params(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_compr_runtime *crtd = cstream->runtime; struct snd_compr_runtime *crtd = cstream->runtime;
struct sof_ipc_pcm_params_reply ipc_params_reply; struct sof_ipc_pcm_params_reply ipc_params_reply;
struct sof_ipc_fw_ready *ready = &sdev->fw_ready;
struct sof_ipc_fw_version *v = &ready->version;
struct snd_compr_tstamp *tstamp; struct snd_compr_tstamp *tstamp;
struct sof_ipc_pcm_params *pcm; struct sof_ipc_pcm_params *pcm;
struct snd_sof_pcm *spcm; struct snd_sof_pcm *spcm;
size_t ext_data_size; size_t ext_data_size;
int ret; int ret;
if (v->abi_version < SOF_ABI_VER(3, 22, 0)) {
dev_err(component->dev,
"Compress params not supported with FW ABI version %d:%d:%d\n",
SOF_ABI_VERSION_MAJOR(v->abi_version),
SOF_ABI_VERSION_MINOR(v->abi_version),
SOF_ABI_VERSION_PATCH(v->abi_version));
return -EINVAL;
}
tstamp = crtd->private_data; tstamp = crtd->private_data;
spcm = snd_sof_find_spcm_dai(component, rtd); spcm = snd_sof_find_spcm_dai(component, rtd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment