<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/sound/soc-dpcm.h, branch v6.1.181</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.181</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.181'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-06-21T14:00:53+00:00</updated>
<entry>
<title>ASoC: soc-pcm: test if a BE can be prepared</title>
<updated>2023-06-21T14:00:53+00:00</updated>
<author>
<name>Ranjani Sridharan</name>
<email>ranjani.sridharan@linux.intel.com</email>
</author>
<published>2023-05-17T18:57:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c33fded7f17f6102a4d7d77f826d0eba5da9b986'/>
<id>urn:sha1:c33fded7f17f6102a4d7d77f826d0eba5da9b986</id>
<content type='text'>
[ Upstream commit e123036be377ddf628226a7c6d4f9af5efd113d3 ]

In the BE hw_params configuration, the existing code checks if any of the
existing FEs are prepared, running, paused or suspended - and skips the
configuration in those cases. This allows multiple calls of hw_params
which the ALSA state machine supports.

This check is not handled for the prepare stage, which can lead to the
same BE being prepared multiple times. This patch adds a check similar to
that of the hw_params, with the main difference being that the suspended
state is allowed: the ALSA state machine allows a transition from
suspended to prepared with hw_params skipped.

This problem was detected on Intel IPC4/SoundWire devices, where the BE
dailink .prepare stage is used to configure the SoundWire stream with a
bank switch. Multiple .prepare calls lead to conflicts with the .trigger
operation with IPC4 configurations. This problem was not detected earlier
on Intel devices, HDaudio BE dailinks detect that the link is already
prepared and skip the configuration, and for IPC3 devices there is no BE
trigger.

Link: https://github.com/thesofproject/sof/issues/7596
Signed-off-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com
Signed-off-by: Bard Liao &lt;yung-chuan.liao@linux.intel.com
Signed-off-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230517185731.487124-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: improve BE transition for PAUSE_RELEASE</title>
<updated>2022-04-19T15:33:51+00:00</updated>
<author>
<name>Pierre-Louis Bossart</name>
<email>pierre-louis.bossart@linux.intel.com</email>
</author>
<published>2022-04-06T19:00:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9995c1d096c8ab1b5f1edc4141257719f6a53524'/>
<id>urn:sha1:9995c1d096c8ab1b5f1edc4141257719f6a53524</id>
<content type='text'>
Commit 3aa1e96a2b95 ("ASoC: soc-pcm: fix BE handling of PAUSE_RELEASE")
did not modify the existing logic and kept the same logic for the following
transition

    play FE1    -&gt; BE state is START
    pause FE1   -&gt; BE state is PAUSED
    play FE2    -&gt; BE state is START
    stop FE2    -&gt; BE state is STOP &lt;&lt;&lt; !!
    release FE1 -&gt; BE state is START
    stop FE1    -&gt; BE state is STOP

At the time it was identified by reviewers that a better solution
might consist in

    play FE1    -&gt; BE state is START
    pause FE1   -&gt; BE state is PAUSED
    play FE2    -&gt; BE state is START
    stop FE2    -&gt; BE state is PAUSE &lt;&lt;&lt; !!
    release FE1 -&gt; BE state is START
    stop FE1    -&gt; BE state is STOP

This patch suggest a transition to PAUSE when all the 'active' streams
are paused. This would allow for a more consistent resource management
for platforms where PAUSE and STOP are handled differently.

To track the special case of an FE going from PAUSE_PUSH to STOP, we
add a state variable for each FE context. This 'fe_pause' boolean is
set on PAUSE_PUSH and cleared on either PAUSE_RELEASE and STOP
triggers.

Signed-off-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Reviewed-by: Rander Wang &lt;rander.wang@intel.com&gt;
Reviewed-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com&gt;
Reviewed-by: Péter Ujfalusi &lt;peter.ujfalusi@linux.intel.com&gt;
Reviewed-by: Bard Liao &lt;yung-chuan.liao@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220406190056.233481-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: test refcount before triggering</title>
<updated>2021-12-14T17:15:47+00:00</updated>
<author>
<name>Pierre-Louis Bossart</name>
<email>pierre-louis.bossart@linux.intel.com</email>
</author>
<published>2021-12-07T17:37:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=848aedfdc6ba25ad5652797db9266007773e44dd'/>
<id>urn:sha1:848aedfdc6ba25ad5652797db9266007773e44dd</id>
<content type='text'>
On start/pause_release/resume, when more than one FE is connected to
the same BE, it's possible that the trigger is sent more than
once. This is not desirable, we only want to trigger a BE once, which
is straightforward to implement with a refcount.

For stop/pause/suspend, the problem is more complicated: the check
implemented in snd_soc_dpcm_can_be_free_stop() may fail due to a
conceptual deadlock when we trigger the BE before the FE. In this
case, the FE states have not yet changed, so there are corner cases
where the TRIGGER_STOP is never sent - the dual case of start where
multiple triggers might be sent.

This patch suggests an unconditional trigger in all cases, without
checking the FE states, using a refcount protected by the BE PCM
stream lock.

Signed-off-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Reviewed-by: Kai Vehmanen &lt;kai.vehmanen@linux.intel.com&gt;
Reviewed-by: Bard Liao &lt;yung-chuan.liao@linux.intel.com&gt;
Reviewed-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20211207173745.15850-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>AsoC: dapm: export a couple of functions</title>
<updated>2021-10-01T19:48:23+00:00</updated>
<author>
<name>Ranjani Sridharan</name>
<email>ranjani.sridharan@linux.intel.com</email>
</author>
<published>2021-09-27T12:05:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d1a7af0979292b187bde0d556d26fe21bd64b832'/>
<id>urn:sha1:d1a7af0979292b187bde0d556d26fe21bd64b832</id>
<content type='text'>
Export a couple of DAPM functions that can be used by
ASoC drivers to determine connected widgets when a PCM
is started.

Signed-off-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com&gt;
Reviewed-by: Guennadi Liakhovetski &lt;guennadi.liakhovetski@linux.intel.com&gt;
Reviewed-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Reviewed-by: Kai Vehmanen &lt;kai.vehmanen@linux.intel.com&gt;
Signed-off-by: Daniel Baluta &lt;daniel.baluta@nxp.com&gt;
Signed-off-by: Peter Ujfalusi &lt;peter.ujfalusi@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20210927120517.20505-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: don't indicate error message for dpcm_be_dai_hw_free()</title>
<updated>2021-03-19T12:24:03+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2021-03-15T00:58:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f52366e6831ecb2da133b6ecfc7c69266086660c'/>
<id>urn:sha1:f52366e6831ecb2da133b6ecfc7c69266086660c</id>
<content type='text'>
dpcm_be_dai_hw_free() never fail, error message is not needed.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87blblutaf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: share DPCM BE DAI stop operation</title>
<updated>2021-03-12T14:26:32+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2021-03-09T01:08:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=531590bb40f827fb3c4398148af0797f95bbaee2'/>
<id>urn:sha1:531590bb40f827fb3c4398148af0797f95bbaee2</id>
<content type='text'>
soc-pcm has very similar but different DPCM BE DAI stop operation at
	1) dpcm_be_dai_startup() error case rollback
	2) dpcm_be_dai_startup_unwind()
	3) dpcm_be_dai_shutdown()

The differences are
	1) for rollback
	2) Doesn't check by snd_soc_dpcm_be_can_update() (Is this bug ?)
	3) Do soc_pcm_hw_free() if it was not !OPENed and !HW_FREEed,
	   and call soc_pcm_close().

We can share same code by
	1) hw_free is not needed. Needs last dpcm as rollback.
	2) hw_free is not needed.
	3) hw_free is     needed.

This patch adds new dpcm_be_dai_stop() and share these 3.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87a6rduoam.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: export DPCM runtime update functions</title>
<updated>2020-03-12T13:30:38+00:00</updated>
<author>
<name>Guennadi Liakhovetski</name>
<email>guennadi.liakhovetski@linux.intel.com</email>
</author>
<published>2020-03-12T09:52:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f17a14789e55f45514d1d72a4e51dcc6bdd8d463'/>
<id>urn:sha1:f17a14789e55f45514d1d72a4e51dcc6bdd8d463</id>
<content type='text'>
This makes DPCM runtime update functions available for external
calling. As an example, virtualised ASoC component drivers may need
to call these when managing shared DAPM routes that are used by more
than one driver (i.e. when host driver and guest drivers have a DAPM
path from guest PCM to host DAI where some parts are owned by host
driver and others by guest driver).

Signed-off-by: Guennadi Liakhovetski &lt;guennadi.liakhovetski@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200312095214.15126-3-guennadi.liakhovetski@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: move dpcm_path_put() to soc-pcm.c</title>
<updated>2020-02-24T21:18:32+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-02-19T06:56:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=52645e332d227a3d3cd345e97a10d99b7e80fae4'/>
<id>urn:sha1:52645e332d227a3d3cd345e97a10d99b7e80fae4</id>
<content type='text'>
dpcm_path_put() (A) is calling kfree(*list).
The freed list is created by dapm_widget_list_create() (B) which is called
from snd_soc_dapm_dai_get_connected_widgets() (C) which is called from
dpcm_path_get() (D).

(B)	dapm_widget_list_create(**list, ...)
	{
		...
=&gt;		*list = kzalloc();
		...
	}

(C)	snd_soc_dapm_dai_get_connected_widgets(..., **list, ...)
	{
		...
		dapm_widget_list_create(list, ...);
		...
	}

(D)	dpcm_path_get(..., **list)
	{
		...
		snd_soc_dapm_dai_get_connected_widgets(..., list, ...);
		...
	}

(A)	dpcm_path_put(**list)
	{
=&gt;		kfree(*list);
	}

This kind of unbalance code is very difficult to read/understand.
To avoid this issue, this patch adds each missing paired function
dapm_widget_list_free()         for dapm_widget_list_create() (B), and
snd_soc_dapm_dai_free_widgets() for snd_soc_dapm_dai_get_connected_widgets() (C).

This patch uses these, and moves dpcm_path_put() next to dpcm_path_get().

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87a75fjc9q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: remove snd_soc_dpcm_be_get/set_state()</title>
<updated>2020-02-18T23:37:02+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-02-17T08:28:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=289a7e64f8583aaa45847c7fa3b7fabf8d48fd6b'/>
<id>urn:sha1:289a7e64f8583aaa45847c7fa3b7fabf8d48fd6b</id>
<content type='text'>
No one is using snd_soc_dpcm_be_get/set_state().
If it exists only by assumption that "it may be necessary someday",
let's remove it now. Otherwise code maintenance will be difficult.
We can revive it when we really needed it.
Let's remove it, so far.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Reviewed-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com&gt;
Reviewed-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Link: https://lore.kernel.org/r/87a75hbou7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: remove soc_dpcm_be_digital_mute()</title>
<updated>2020-02-18T23:37:01+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-02-17T08:27:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c9645d2a952b7925b6708b24242cd5ed04975648'/>
<id>urn:sha1:c9645d2a952b7925b6708b24242cd5ed04975648</id>
<content type='text'>
No one is using soc_dpcm_be_digital_mute().
If it exists only by assumption that "it may be necessary someday",
let's remove it now. Otherwise code maintenance will be difficult.
We can revive it when we really needed it.
Let's remove it, so far.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Reviewed-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com&gt;
Reviewed-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Link: https://lore.kernel.org/r/87blpxbouc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
