linux/sound/soc
Pierre-Louis Bossart 0c75fc7193
ASoC: soc-pcm: protect BE dailink state changes in trigger
When more than one FE is connected to a BE, e.g. in a mixing use case,
the BE can be triggered multiple times when the FE are opened/started
concurrently. This race condition is problematic in the case of
SoundWire BE dailinks, and this is not desirable in a general
case. The code carefully checks when the BE can be stopped or
hw_free'ed, but the trigger code does not use any mutual exclusion.

Fix by using the same spinlock already used to check FE states, and
set the state before the trigger. In case of errors,  the initial
state will be restored.

This patch does not change how the triggers are handled, it only makes
sure the states are handled in critical sections.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20210817164054.250028-2-pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-26 17:42:07 +01:00
..
adi ASoC: axi-i2s: Use devm_platform_get_and_ioremap_resource() 2021-06-14 15:01:03 +01:00
amd Merge some cs42l42 patches into asoc-5.15 2021-08-06 01:46:24 +01:00
atmel ASoC: atmel: ATMEL drivers don't need HAS_DMA 2021-07-11 23:48:35 +01:00
au1x
bcm ASoC: bcm: cygnus-pcm: Fix unused assignment about 'rc' 2021-07-28 16:39:28 +01:00
cirrus
codecs ASoC: rt5682: Fix the vol+ button detection issue 2021-08-25 14:15:46 +01:00
dwc ASoC: dwc: Get IRQ optionally 2021-08-26 12:07:23 +01:00
fsl ASoC: imx-rpmsg: change dev_err to dev_err_probe for -EPROBE_DEFER 2021-08-25 14:15:47 +01:00
generic ASoC: simple-card-utils: Avoid over-allocating DLCs 2021-08-05 15:38:56 +01: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: bytcr_rt5640: Make rt5640_jack_gpio/rt5640_jack2_gpio static 2021-08-25 14:15:45 +01: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: mt8195: Fix spelling mistake "bitwiedh" -> "bitwidth" 2021-08-26 13:42:42 +01:00
meson ASoC: meson: switch to use snd_soc_daifmt_parse_format/clock_provider() 2021-06-21 13:05:20 +01:00
mxs
pxa spi: pxa2xx: Use pxa_ssp_enable()/pxa_ssp_disable() in the driver 2021-05-11 09:35:06 +01:00
qcom ASoC: qdsp6: q6adm: fix cppcheck warnings for unnecessary initialization 2021-08-09 13:49:13 +01:00
rockchip Merge series "Patches to update for rockchip i2s" from Sugar Zhang <sugar.zhang@rock-chips.com>: 2021-08-26 15:08:30 +01:00
samsung ASoC: samsung: Constify static snd_soc_ops 2021-07-29 15:35:48 +01:00
sh ASoC: rsnd: adg: clearly handle clock error / NULL case 2021-08-20 13:07:26 +01:00
sof ASoC: SOF: intel: remove duplicate include 2021-08-24 19:15:02 +01: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 devm_platform_get_and_ioremap_resource() 2021-06-17 13:47:05 +01:00
sti ASoC: sti: sti_uniperif: Use devm_platform_get_and_ioremap_resource() 2021-06-17 13:47:03 +01:00
stm ASoC: stm32: spdifrx: Use devm_platform_get_and_ioremap_resource() 2021-06-17 13:47:02 +01:00
sunxi ASoC: sunxi: sun4i-spdif: Use devm_platform_get_and_ioremap_resource() 2021-06-21 13:04:18 +01:00
tegra ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data 2021-08-17 13:35:00 +01:00
ti Merge some cs42l42 patches into asoc-5.15 2021-08-06 01:46:24 +01:00
uniphier ASoC: uniphier: make arrays mul and div static const, makes object smaller 2021-08-19 18:21:23 +01:00
ux500
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: remove useless initialization 2021-04-19 14:03:29 +01:00
soc-card.c
soc-component.c ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get() 2021-08-16 13:29:35 +01:00
soc-compress.c ASoC: soc-compress: lock pcm_mutex to resolve lockdep error 2021-04-09 13:39:44 +01:00
soc-core.c ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_routing() 2021-07-29 15:35:45 +01:00
soc-dai.c ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new() 2021-08-16 13:29:32 +01:00
soc-dapm.c ASoC: soc-dapm: cleanup cppcheck warning at soc_dapm_dai_stream_event() 2021-08-05 15:37:40 +01:00
soc-devres.c
soc-generic-dmaengine-pcm.c ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user() 2021-08-16 13:29:30 +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: protect BE dailink state changes in trigger 2021-08-26 17:42:07 +01:00
soc-topology-test.c
soc-topology.c ASoC: soc-topology: cleanup cppcheck warning at snd_soc_find_dai_link() 2021-08-02 12:21:31 +01:00
soc-utils.c ASoC: soc-core: add snd_soc_runtime_get_dai_fmt() 2021-06-07 15:55:12 +01:00