Skip to contentSkip to conversation

ASoC: SOF: relax ABI checks and avoid unnecessary warnings

PATCH In review Kai Vehmanen 3 participants 4 messages Feb 11, 2021 – Feb 12, 2021

Subsystems (3)
lore
Share & tools
lore

Kai Vehmanen

author reviewer
#0 lore raw

PATCH 1/1 ASoC: SOF: relax ABI checks and avoid unnecessary warnings

With recent SOF 1.7 pre-releases, kernel has been emitting following warnings at probe:

[10006.645216] sof-audio-pci 0000:00:1f.3: warn: FW ABI is more recent than kernel
[10006.652137] sof-audio-pci 0000:00:1f.3: warn: topology ABI is more recent than kernel

The warnings are emitted due to increase of the patch-level in firmware mainline (to 3.17.1). But the patch level should not be considered even in the strict ABI check, so modify the kernel side logic that makes the check and only consider the major.minor components.

---
 sound/soc/sof/ipc.c      | 2 +-
 sound/soc/sof/topology.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/sof/ipc.c +1 -1
index 1bc3d6282f16..c2d07b783f60 100644
@@ -798,7 +798,7 @@ int snd_sof_ipc_valid(struct snd_sof_dev *sdev)
 		return -EINVAL;
 	}
 
-	if (v->abi_version > SOF_ABI_VERSION) {
+	if (SOF_ABI_VERSION_MINOR(v->abi_version) > SOF_ABI_MINOR) {
 		if (!IS_ENABLED(CONFIG_SND_SOC_SOF_STRICT_ABI_CHECKS)) {
 			dev_warn(sdev->dev, "warn: FW ABI is more recent than kernel\n");
 		} else {
sound/soc/sof/topology.c +1 -1
index d6e1f33eb1e9..10f99620eb31 100644
@@ -3658,7 +3658,7 @@ static int sof_manifest(struct snd_soc_component *scomp, int index,
 		return -EINVAL;
 	}
 
-	if (abi_version > SOF_ABI_VERSION) {
+	if (SOF_ABI_VERSION_MINOR(abi_version) > SOF_ABI_MINOR) {
 		if (!IS_ENABLED(CONFIG_SND_SOC_SOF_STRICT_ABI_CHECKS)) {
 			dev_warn(scomp->dev, "warn: topology ABI is more recent than kernel\n");
 		} else {

base-commit: ec9d68508ff65df1dc24cf8100eb40ddd196c2fd

Signature · 1 line
2.29.2
maintainer
#1 lore raw
Quoted 10 lines · Kai Vehmanen

With recent SOF 1.7 pre-releases, kernel has been emitting following warnings at probe:

[10006.645216] sof-audio-pci 0000:00:1f.3: warn: FW ABI is more recent than kernel
[10006.652137] sof-audio-pci 0000:00:1f.3: warn: topology ABI is more recent than kernel

The warnings are emitted due to increase of the patch-level in firmware mainline (to 3.17.1). But the patch level should not be considered even in the strict ABI check, so modify the kernel side logic that makes the check and only consider the major.minor components.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: relax ABI checks and avoid unnecessary warnings

      commit: 53129e66e4b716ea7cffa4477a96ccb48f78e7ac

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

#2 lore raw
In reply to Kai Vehmanen
Quoted 47 lines · Kai Vehmanen

With recent SOF 1.7 pre-releases, kernel has been emitting following warnings at probe:

[10006.645216] sof-audio-pci 0000:00:1f.3: warn: FW ABI is more recent than kernel
[10006.652137] sof-audio-pci 0000:00:1f.3: warn: topology ABI is more recent than kernel

The warnings are emitted due to increase of the patch-level in firmware mainline (to 3.17.1). But the patch level should not be considered even in the strict ABI check, so modify the kernel side logic that makes the check and only consider the major.minor components.

---
  sound/soc/sof/ipc.c      | 2 +-
  sound/soc/sof/topology.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/sof/ipc.c +1 -1
index 1bc3d6282f16..c2d07b783f60 100644
@@ -798,7 +798,7 @@ int snd_sof_ipc_valid(struct snd_sof_dev *sdev)
  		return -EINVAL;
  	}
 
-	if (v->abi_version > SOF_ABI_VERSION) {
+	if (SOF_ABI_VERSION_MINOR(v->abi_version) > SOF_ABI_MINOR) {
  		if (!IS_ENABLED(CONFIG_SND_SOC_SOF_STRICT_ABI_CHECKS)) {
  			dev_warn(sdev->dev, "warn: FW ABI is more recent than kernel\n");
  		} else {
sound/soc/sof/topology.c +1 -1
index d6e1f33eb1e9..10f99620eb31 100644
@@ -3658,7 +3658,7 @@ static int sof_manifest(struct snd_soc_component *scomp, int index,
  		return -EINVAL;
  	}
 
-	if (abi_version > SOF_ABI_VERSION) {
+	if (SOF_ABI_VERSION_MINOR(abi_version) > SOF_ABI_MINOR) {
  		if (!IS_ENABLED(CONFIG_SND_SOC_SOF_STRICT_ABI_CHECKS)) {
  			dev_warn(scomp->dev, "warn: topology ABI is more recent than kernel\n");
  		} else {
Quoted 2 lines

base-commit: ec9d68508ff65df1dc24cf8100eb40ddd196c2fd

Shouldn't you also look at major version?
Seems to me like with this check for example 2.1.0 compared to 3.0.0 will compare 1 and 0 and tell you that you have too new version. Even if 2 is less than 3.

author reviewer
#3 lore raw

Hi,

Quoted 8 lines · Amadeusz Sławiński
Quoted 7 lines · Kai Vehmanen

With recent SOF 1.7 pre-releases, kernel has been emitting following warnings at probe:

[10006.645216] sof-audio-pci 0000:00:1f.3: warn: FW ABI is more recent than
kernel
[10006.652137] sof-audio-pci 0000:00:1f.3: warn: topology ABI is more recent

than kernel

[...]

Quoted 13 lines
Quoted 13 lines
sound/soc/sof/topology.c +1 -0
@@ -3658,7 +3658,7 @@ static int sof_manifest(struct snd_soc_component
 *scomp, int index,
  		return -EINVAL;
  	}
  -	if (abi_version > SOF_ABI_VERSION) {
+	if (SOF_ABI_VERSION_MINOR(abi_version) > SOF_ABI_MINOR) {
  		if (!IS_ENABLED(CONFIG_SND_SOC_SOF_STRICT_ABI_CHECKS)) {
  			dev_warn(scomp->dev, "warn: topology ABI is more

recent than kernel\n");
} else {

Quoted 7 lines
Quoted 2 lines

base-commit: ec9d68508ff65df1dc24cf8100eb40ddd196c2fd

Shouldn't you also look at major version?
Seems to me like with this check for example 2.1.0 compared to 3.0.0 will compare 1 and 0 and tell you that you have too new version. Even if 2 is less than 3.

ack on that. The diff is a bit hard to follow as the checks I modify here, in topology.c and ipc.c, are both preceded by a check with SOF_ABI_VERSION_INCOMPATIBLE(). If major version doens't match, we return an error earlier. So thus we only need to check the minor version here.

Br, Kai