alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: relax ABI checks and avoid unnecessary warnings
@ 2021-02-11 17:24 Kai Vehmanen
  2021-02-11 17:51 ` Mark Brown
  2021-02-12  8:10 ` Amadeusz Sławiński
  0 siblings, 2 replies; 4+ messages in thread
From: Kai Vehmanen @ 2021-02-11 17:24 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: kai.vehmanen, yung-chuan.liao, lgirdwood, pierre-louis.bossart,
	ranjani.sridharan, daniel.baluta

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.

BugLink: https://github.com/thesofproject/linux/issues/2647
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/ipc.c      | 2 +-
 sound/soc/sof/topology.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
index 1bc3d6282f16..c2d07b783f60 100644
--- a/sound/soc/sof/ipc.c
+++ b/sound/soc/sof/ipc.c
@@ -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 {
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index d6e1f33eb1e9..10f99620eb31 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -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
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: SOF: relax ABI checks and avoid unnecessary warnings
  2021-02-11 17:24 [PATCH] ASoC: SOF: relax ABI checks and avoid unnecessary warnings Kai Vehmanen
@ 2021-02-11 17:51 ` Mark Brown
  2021-02-12  8:10 ` Amadeusz Sławiński
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2021-02-11 17:51 UTC (permalink / raw)
  To: alsa-devel, Kai Vehmanen
  Cc: yung-chuan.liao, ranjani.sridharan, daniel.baluta,
	pierre-louis.bossart, lgirdwood

On Thu, 11 Feb 2021 19:24:40 +0200, Kai Vehmanen wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: SOF: relax ABI checks and avoid unnecessary warnings
  2021-02-11 17:24 [PATCH] ASoC: SOF: relax ABI checks and avoid unnecessary warnings Kai Vehmanen
  2021-02-11 17:51 ` Mark Brown
@ 2021-02-12  8:10 ` Amadeusz Sławiński
  2021-02-12  9:53   ` Kai Vehmanen
  1 sibling, 1 reply; 4+ messages in thread
From: Amadeusz Sławiński @ 2021-02-12  8:10 UTC (permalink / raw)
  To: Kai Vehmanen, alsa-devel, broonie
  Cc: daniel.baluta, ranjani.sridharan, yung-chuan.liao, lgirdwood,
	pierre-louis.bossart

On 2/11/2021 6:24 PM, Kai Vehmanen wrote:
> 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.
> 
> BugLink: https://github.com/thesofproject/linux/issues/2647
> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> ---
>   sound/soc/sof/ipc.c      | 2 +-
>   sound/soc/sof/topology.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
> index 1bc3d6282f16..c2d07b783f60 100644
> --- a/sound/soc/sof/ipc.c
> +++ b/sound/soc/sof/ipc.c
> @@ -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 {
> diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
> index d6e1f33eb1e9..10f99620eb31 100644
> --- a/sound/soc/sof/topology.c
> +++ b/sound/soc/sof/topology.c
> @@ -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
> 

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: SOF: relax ABI checks and avoid unnecessary warnings
  2021-02-12  8:10 ` Amadeusz Sławiński
@ 2021-02-12  9:53   ` Kai Vehmanen
  0 siblings, 0 replies; 4+ messages in thread
From: Kai Vehmanen @ 2021-02-12  9:53 UTC (permalink / raw)
  To: Amadeusz Sławiński
  Cc: alsa-devel, Kai Vehmanen, daniel.baluta, lgirdwood,
	pierre-louis.bossart, broonie, ranjani.sridharan,
	yung-chuan.liao

Hi,

On Fri, 12 Feb 2021, Amadeusz Sławiński wrote:

> On 2/11/2021 6:24 PM, Kai Vehmanen wrote:
> > 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
[...]
> > --- a/sound/soc/sof/topology.c
> > +++ b/sound/soc/sof/topology.c
> > @@ -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
> > 
> 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-12  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11 17:24 [PATCH] ASoC: SOF: relax ABI checks and avoid unnecessary warnings Kai Vehmanen
2021-02-11 17:51 ` Mark Brown
2021-02-12  8:10 ` Amadeusz Sławiński
2021-02-12  9:53   ` Kai Vehmanen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).