summaryrefslogtreecommitdiff
path: root/sound/soc/sof/ipc.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2019-04-30 18:09:17 -0500
committerMark Brown <broonie@kernel.org>2019-05-03 14:56:06 +0900
commit4acb1c2ea42e19101eae4ac9f002853553b8b721 (patch)
treeff34b852e565acc90d2f9fab8ad3145ba73e49ee /sound/soc/sof/ipc.c
parent73affae222ec0ffe44d870e0085e55cdbe85d30d (diff)
ASOC: SOF: ipc: add support for stricter ABI checks
Fail early if firmware is more recent than kernel and Kconfig is selected. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ipc.c')
-rw-r--r--sound/soc/sof/ipc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
index d00373ceca12..bf58d58e7379 100644
--- a/sound/soc/sof/ipc.c
+++ b/sound/soc/sof/ipc.c
@@ -762,6 +762,15 @@ int snd_sof_ipc_valid(struct snd_sof_dev *sdev)
return -EINVAL;
}
+ if (v->abi_version > SOF_ABI_VERSION) {
+ if (!IS_ENABLED(CONFIG_SND_SOC_SOF_STRICT_ABI_CHECKS)) {
+ dev_warn(sdev->dev, "warn: FW ABI is more recent than kernel\n");
+ } else {
+ dev_err(sdev->dev, "error: FW ABI is more recent than kernel\n");
+ return -EINVAL;
+ }
+ }
+
if (ready->debug.bits.build) {
dev_info(sdev->dev,
"Firmware debug build %d on %s-%s - options:\n"