* [PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice
@ 2022-07-12 13:16 Peter Ujfalusi
2022-07-12 13:16 ` [PATCH 1/2] ASoC: SOF: Intel: hda-dai: Drop misleading comment regarding dma_data Peter Ujfalusi
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2022-07-12 13:16 UTC (permalink / raw)
To: lgirdwood, broonie, pierre-louis.bossart
Cc: alsa-devel, ranjani.sridharan, kai.vehmanen, rander.wang
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(-)
--
2.37.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ASoC: SOF: Intel: hda-dai: Drop misleading comment regarding dma_data
2022-07-12 13:16 [PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice Peter Ujfalusi
@ 2022-07-12 13:16 ` Peter Ujfalusi
2022-07-12 13:16 ` [PATCH 2/2] ASoC: SOF: Intel: hda-dai: Do snd_hdac_ext_stream_decouple() only once Peter Ujfalusi
2022-07-12 18:22 ` [PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2022-07-12 13:16 UTC (permalink / raw)
To: lgirdwood, broonie, pierre-louis.bossart
Cc: alsa-devel, ranjani.sridharan, kai.vehmanen, rander.wang
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);
--
2.37.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ASoC: SOF: Intel: hda-dai: Do snd_hdac_ext_stream_decouple() only once
2022-07-12 13:16 [PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice Peter Ujfalusi
2022-07-12 13:16 ` [PATCH 1/2] ASoC: SOF: Intel: hda-dai: Drop misleading comment regarding dma_data Peter Ujfalusi
@ 2022-07-12 13:16 ` Peter Ujfalusi
2022-07-12 18:22 ` [PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2022-07-12 13:16 UTC (permalink / raw)
To: lgirdwood, broonie, pierre-louis.bossart
Cc: alsa-devel, ranjani.sridharan, kai.vehmanen, rander.wang
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,
--
2.37.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice
2022-07-12 13:16 [PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice Peter Ujfalusi
2022-07-12 13:16 ` [PATCH 1/2] ASoC: SOF: Intel: hda-dai: Drop misleading comment regarding dma_data Peter Ujfalusi
2022-07-12 13:16 ` [PATCH 2/2] ASoC: SOF: Intel: hda-dai: Do snd_hdac_ext_stream_decouple() only once Peter Ujfalusi
@ 2022-07-12 18:22 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-07-12 18:22 UTC (permalink / raw)
To: peter.ujfalusi, pierre-louis.bossart, lgirdwood
Cc: alsa-devel, ranjani.sridharan, kai.vehmanen, rander.wang
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-12 18:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-12 13:16 [PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice Peter Ujfalusi
2022-07-12 13:16 ` [PATCH 1/2] ASoC: SOF: Intel: hda-dai: Drop misleading comment regarding dma_data Peter Ujfalusi
2022-07-12 13:16 ` [PATCH 2/2] ASoC: SOF: Intel: hda-dai: Do snd_hdac_ext_stream_decouple() only once Peter Ujfalusi
2022-07-12 18:22 ` [PATCH 0/2] ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox