[PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice
Hi,
There is no need to decouple a decoupled stream twice. Keep the decoupling in hda_link_stream_assign() only as it is going to be executed in all cases.
Drop the outdated comment from hda_link_dma_hw_params() as well since the code has changed around it.
Regards, Peter --- Peter Ujfalusi (2): ASoC: SOF: Intel: hda-dai: Drop misleading comment regarding dma_data ASoC: SOF: Intel: hda-dai: Do snd_hdac_ext_stream_decouple() only once
sound/soc/sof/intel/hda-dai.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
The comment in hda_link_dma_hw_params() is no longer valid as the dma_data is set to NULL at system suspend as well.
Instead of rewording the comment to state the obvious: try to take the hext_stream from the dma_data and if it is not set then assign a new one and store it as dma_data.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- sound/soc/sof/intel/hda-dai.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c index ed74a1f264e8..9015ca2024bc 100644 --- a/sound/soc/sof/intel/hda-dai.c +++ b/sound/soc/sof/intel/hda-dai.c @@ -221,7 +221,6 @@ static int hda_link_dma_hw_params(struct snd_pcm_substream *substream, struct hdac_bus *bus = hstream->bus; struct hdac_ext_link *link;
- /* get stored dma data if resuming from system suspend */ hext_stream = snd_soc_dai_get_dma_data(cpu_dai, substream); if (!hext_stream) { hext_stream = hda_link_stream_assign(bus, substream);
Call snd_hdac_ext_stream_decouple_locked() unconditionally in hda_link_stream_assign(), the snd_hdac_ext_stream_decouple_locked() have internal checks to avoid re-configuring.
There is no need to call snd_hdac_ext_stream_decouple() via hda_link_dma_params() as the stream must have been set to decoupled when it got assigned (even if it used local condition to call snd_hdac_ext_stream_decouple_locked()).
Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- sound/soc/sof/intel/hda-dai.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c index 9015ca2024bc..c5b65e4a06be 100644 --- a/sound/soc/sof/intel/hda-dai.c +++ b/sound/soc/sof/intel/hda-dai.c @@ -126,12 +126,8 @@ hda_link_stream_assign(struct hdac_bus *bus, }
if (res) { - /* - * Decouple host and link DMA. The decoupled flag - * is updated in snd_hdac_ext_stream_decouple(). - */ - if (!res->decoupled) - snd_hdac_ext_stream_decouple_locked(bus, res, true); + /* Make sure that host and link DMA is decoupled. */ + snd_hdac_ext_stream_decouple_locked(bus, res, true);
res->link_locked = 1; res->link_substream = substream; @@ -184,7 +180,6 @@ static int hda_link_dma_params(struct hdac_ext_stream *hext_stream, struct hdac_ext_link *link; unsigned int format_val;
- snd_hdac_ext_stream_decouple(bus, hext_stream, true); snd_hdac_ext_link_stream_reset(hext_stream);
format_val = snd_hdac_calc_stream_format(params->s_freq, params->ch,
On Tue, 12 Jul 2022 16:16:18 +0300, Peter Ujfalusi wrote:
There is no need to decouple a decoupled stream twice. Keep the decoupling in hda_link_stream_assign() only as it is going to be executed in all cases.
Drop the outdated comment from hda_link_dma_hw_params() as well since the code has changed around it.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: SOF: Intel: hda-dai: Drop misleading comment regarding dma_data commit: 402355e6cdbebf15f2c40cd9469b924c97b94b32 [2/2] ASoC: SOF: Intel: hda-dai: Do snd_hdac_ext_stream_decouple() only once commit: fbabebfb26a8130c10fd91cca687bac87944580d
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
participants (2)
-
Mark Brown
-
Peter Ujfalusi