linux/sound/soc
Pierre-Louis Bossart 848aedfdc6
ASoC: soc-pcm: test refcount before triggering
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 <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211207173745.15850-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-14 17:15:47 +00:00
..
adi ASoC: axi-i2s: Use devm_platform_get_and_ioremap_resource() 2021-06-14 15:01:03 +01:00
amd ASoC: amd: Convert to new style DAI format definitions 2021-12-08 16:47:31 +00:00
atmel ASoC: atmel: Convert to new style DAI format definitions 2021-09-16 14:11:30 +01:00
au1x ASoC: au1x: Convert to modern terminology for DAI clocking 2021-09-16 14:11:37 +01:00
bcm ASoC: bcm: Convert to modern clocking terminology 2021-09-27 13:01:09 +01:00
cirrus ARM: SoC drivers for 5.16 2021-11-03 17:00:52 -07:00
codecs ASoC: rt5682s: add delay time to fix pop sound issue 2021-12-08 13:07:58 +00:00
dwc ASoC: dwc-i2s: Update to modern clocking terminology 2021-09-27 13:01:12 +01:00
fsl ASoC: fsl-asoc-card: Add missing Kconfig option for tlv320aic31xx 2021-12-06 13:49:19 +00:00
generic ASoC: test-component: fix null pointer dereference. 2021-12-09 12:31:50 +00:00
hisilicon ASoC: hisilicon: Use devm_platform_get_and_ioremap_resource() 2021-06-15 16:39:49 +01:00
img ASoC: img-spdif-out: Use devm_platform_get_and_ioremap_resource() 2021-06-15 16:39:47 +01:00
intel ASoC: Intel: sof_rt5682: Move rt1015 speaker amp to common file 2021-12-08 13:07:59 +00:00
jz4740 ASoC: jz4740-i2s: Use devm_platform_get_and_ioremap_resource() 2021-06-15 16:39:48 +01:00
kirkwood ASoC: kirkwood: Fix reference to PCM buffer address 2021-07-30 17:20:51 +01:00
mediatek ASoC: mediatek: assign correct type to argument 2021-12-14 13:22:18 +00:00
meson ASoC: meson: axg-tdm-interface: manage formatters in trigger 2021-10-22 13:25:48 +01:00
mxs
pxa ALSA: pxa2xx: Use managed PCM buffer allocation 2021-08-04 08:08:21 +02:00
qcom ASoC: qcom: apq8016_sbc: Allow routing audio through QDSP6 2021-12-13 22:44:02 +00:00
rockchip ASoC: rockchip: i2s_tdm: Dup static DAI template 2021-11-30 13:08:01 +00:00
samsung ASoC: samsung: add missing "fallthrough;" 2021-09-27 13:00:53 +01:00
sh ASoC: rsnd: fixup DMAEngine API 2021-11-12 21:25:19 +00:00
sof ASoC: SOF: sof-probes: Constify sof_probe_compr_ops 2021-12-14 13:22:16 +00:00
spear ASoC: spear: spdif_out: Use devm_platform_get_and_ioremap_resource() 2021-06-17 13:47:06 +01:00
sprd ASoC: sprd: Use managed buffer allocation 2021-08-04 08:10:27 +02:00
sti ASoC: sti: sti_uniperif: Use devm_platform_get_and_ioremap_resource() 2021-06-17 13:47:03 +01:00
stm Merge branch 'for-5.16' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.17 so we can apply new Tegra work 2021-12-01 14:15:12 +00:00
sunxi ASoC: sunxi: sun4i-spdif: Implement IEC958 control 2021-11-29 12:19:49 +00:00
tegra ASoC: tegra: Add master volume/mute control support 2021-12-01 14:15:39 +00:00
ti ASoC: ti: davinci-mcasp: Remove unnecessary conditional 2021-12-06 13:49:29 +00:00
uniphier ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA 2021-11-25 11:54:30 +00:00
ux500 ASoC: ux500: mop500: Constify static snd_soc_ops 2021-09-29 13:06:38 +01:00
xilinx ASoC: xilinx: Fix reference to PCM buffer address 2021-07-30 17:20:50 +01:00
xtensa
Kconfig ASoC: topology: Select SND_DYNAMIC_MINORS 2021-07-27 13:13:04 +01:00
Makefile ASoC: topology: adhere to KUNIT formatting standard 2021-04-14 15:26:24 +01:00
soc-ac97.c ASoC: soc-ac97: cleanup cppcheck warning 2021-08-16 13:29:36 +01:00
soc-acpi.c ASoC: soc-acpi: Set mach->id field on comp_ids matches 2021-11-22 15:40:01 +00:00
soc-card.c
soc-component.c ASoC: soc-component: add snd_soc_pcm_component_delay() 2021-11-29 12:19:41 +00:00
soc-compress.c ASoC: compress/component: Use module_get_when_open/put_when_close for cstream 2021-09-20 13:30:18 +01:00
soc-core.c ASoC: soc-pcm: Fix and cleanup DPCM locking 2021-12-14 17:15:45 +00:00
soc-dai.c ASoC: soc-dai: update snd_soc_dai_delay() to snd_soc_pcm_dai_delay() 2021-11-29 12:19:40 +00:00
soc-dapm.c ASoC: DAPM: Cover regression by kctl change notification fix 2021-11-05 12:58:12 +00:00
soc-devres.c
soc-generic-dmaengine-pcm.c ASoC: dmaengine: Introduce module option prealloc_buffer_size_kbytes 2021-09-27 13:01:13 +01:00
soc-jack.c ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB 2021-08-16 13:29:34 +01:00
soc-link.c
soc-ops.c ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_xr_sx() 2021-08-03 18:27:14 +01:00
soc-pcm.c ASoC: soc-pcm: test refcount before triggering 2021-12-14 17:15:47 +00:00
soc-topology-test.c
soc-topology.c ASoC: topology: Add missing rwsem around snd_ctl_remove() calls 2021-11-16 14:29:50 +00:00
soc-utils.c ASoC: Stop dummy from overriding hwparams 2021-10-29 16:49:45 +01:00