All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware
@ 2021-05-18 17:41 Ranjani Sridharan
  2021-05-18 19:01 ` Mark Brown
  2021-05-19 16:10 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Ranjani Sridharan @ 2021-05-18 17:41 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Ranjani Sridharan, Kai Vehmanen, Yong Zhi

BE hw_params op was recently added for SSP type DAIs.
But sending the DAI_CONFIG IPC during hw_params
is not supported with older firmware. So add an ABI check
to avoid sending the IPC if the firmware ABI is older than
3.18.

Fixes: e12be9fbfb91 ('ASoC: SOF: Intel: HDA: add hw params callback for SSP DAIs')
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/intel/hda-dai.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c
index 8d7bab433fb3..c1f9f0f58464 100644
--- a/sound/soc/sof/intel/hda-dai.c
+++ b/sound/soc/sof/intel/hda-dai.c
@@ -421,11 +421,16 @@ static int ssp_dai_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, SOF_AUDIO_PCM_DRV_NAME);
 	struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component);
+	struct sof_ipc_fw_version *v = &sdev->fw_ready.version;
 	struct sof_ipc_dai_config *config;
 	struct snd_sof_dai *sof_dai;
 	struct sof_ipc_reply reply;
 	int ret;
 
+	/* DAI_CONFIG IPC during hw_params is not supported in older firmware */
+	if (v->abi_version < SOF_ABI_VER(3, 18, 0))
+		return 0;
+
 	list_for_each_entry(sof_dai, &sdev->dai_list, list) {
 		if (!sof_dai->cpu_dai_name || !sof_dai->dai_config)
 			continue;
-- 
2.25.1


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

* Re: [PATCH] ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware
  2021-05-18 17:41 [PATCH] ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware Ranjani Sridharan
@ 2021-05-18 19:01 ` Mark Brown
  2021-05-18 19:30   ` Ranjani Sridharan
  2021-05-19 16:10 ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2021-05-18 19:01 UTC (permalink / raw)
  To: Ranjani Sridharan; +Cc: tiwai, alsa-devel, Kai Vehmanen, Yong Zhi

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

On Tue, May 18, 2021 at 10:41:21AM -0700, Ranjani Sridharan wrote:

> BE hw_params op was recently added for SSP type DAIs.
> But sending the DAI_CONFIG IPC during hw_params
> is not supported with older firmware. So add an ABI check
> to avoid sending the IPC if the firmware ABI is older than
> 3.18.

Should we warn if we were trying to configure something but weren't able
to?  Seems like something has got out of sync if we're trying to do so.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware
  2021-05-18 19:01 ` Mark Brown
@ 2021-05-18 19:30   ` Ranjani Sridharan
  0 siblings, 0 replies; 5+ messages in thread
From: Ranjani Sridharan @ 2021-05-18 19:30 UTC (permalink / raw)
  To: Mark Brown; +Cc: tiwai, alsa-devel, Kai Vehmanen, Yong Zhi

On Tue, 2021-05-18 at 20:01 +0100, Mark Brown wrote:
> On Tue, May 18, 2021 at 10:41:21AM -0700, Ranjani Sridharan wrote:
> 
> > BE hw_params op was recently added for SSP type DAIs.
> > But sending the DAI_CONFIG IPC during hw_params
> > is not supported with older firmware. So add an ABI check
> > to avoid sending the IPC if the firmware ABI is older than
> > 3.18.
> 
> Should we warn if we were trying to configure something but weren't
> able
> to?  Seems like something has got out of sync if we're trying to do
> so.
Hi Mark,

A warning would be a bit misleading here. We added the BE hw_params for
the SSP DAIs to be able to choose the right config based on runtime
hw_params. But this is relevant only if there are multiple configs in
the topology.

With the older firmware, we do not support multiple config in topology,
so what this would really end up doing is sending the same DAI config
that was sent to the DSP during topology parsing again during BE
hw_params. So it is safe to simply ignore it here.

Thanks,
Ranjani


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

* Re: [PATCH] ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware
  2021-05-18 17:41 [PATCH] ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware Ranjani Sridharan
  2021-05-18 19:01 ` Mark Brown
@ 2021-05-19 16:10 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2021-05-19 16:10 UTC (permalink / raw)
  To: alsa-devel, Ranjani Sridharan; +Cc: tiwai, Mark Brown, Kai Vehmanen, Yong Zhi

On Tue, 18 May 2021 10:41:21 -0700, Ranjani Sridharan wrote:
> BE hw_params op was recently added for SSP type DAIs.
> But sending the DAI_CONFIG IPC during hw_params
> is not supported with older firmware. So add an ABI check
> to avoid sending the IPC if the firmware ABI is older than
> 3.18.

Applied to

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

Thanks!

[1/1] ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware
      commit: 8c08652614cb7468620a6328b37ca2965cd48283

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] 5+ messages in thread

* [PATCH] ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware
@ 2021-05-13 17:06 Ranjani Sridharan
  0 siblings, 0 replies; 5+ messages in thread
From: Ranjani Sridharan @ 2021-05-13 17:06 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, =broonie, Ranjani Sridharan, Kai Vehmanen, Yong Zhi

BE hw_params op was recently added for SSP type DAIs.
But sending the DAI_CONFIG IPC during hw_params
is not supported with older firmware. So add an ABI check
to avoid sending the IPC if the firmware ABI is older than
3.18.

Fixes: e12be9fbfb91 ('ASoC: SOF: Intel: HDA: add hw params callback for SSP DAIs')
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/intel/hda-dai.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c
index 8d7bab433fb3..c1f9f0f58464 100644
--- a/sound/soc/sof/intel/hda-dai.c
+++ b/sound/soc/sof/intel/hda-dai.c
@@ -421,11 +421,16 @@ static int ssp_dai_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, SOF_AUDIO_PCM_DRV_NAME);
 	struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component);
+	struct sof_ipc_fw_version *v = &sdev->fw_ready.version;
 	struct sof_ipc_dai_config *config;
 	struct snd_sof_dai *sof_dai;
 	struct sof_ipc_reply reply;
 	int ret;
 
+	/* DAI_CONFIG IPC during hw_params is not supported in older firmware */
+	if (v->abi_version < SOF_ABI_VER(3, 18, 0))
+		return 0;
+
 	list_for_each_entry(sof_dai, &sdev->dai_list, list) {
 		if (!sof_dai->cpu_dai_name || !sof_dai->dai_config)
 			continue;
-- 
2.25.1


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

end of thread, other threads:[~2021-05-19 16:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 17:41 [PATCH] ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware Ranjani Sridharan
2021-05-18 19:01 ` Mark Brown
2021-05-18 19:30   ` Ranjani Sridharan
2021-05-19 16:10 ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2021-05-13 17:06 Ranjani Sridharan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.