History log of /linux-master/sound/soc/sti/uniperif_player.c
Revision Date Author Comments
# 455c5653 15-Mar-2022 Takashi Iwai <tiwai@suse.de>

ASoC: sti: Fix deadlock via snd_pcm_stop_xrun() call

This is essentially a revert of the commit dc865fb9e7c2 ("ASoC: sti:
Use snd_pcm_stop_xrun() helper"), which converted the manual
snd_pcm_stop() calls with snd_pcm_stop_xrun().

The commit above introduced a deadlock as snd_pcm_stop_xrun() itself
takes the PCM stream lock while the caller already holds it. Since
the conversion was done only for consistency reason and the open-call
with snd_pcm_stop() to the XRUN state is a correct usage, let's revert
the commit back as the fix.

Fixes: dc865fb9e7c2 ("ASoC: sti: Use snd_pcm_stop_xrun() helper")
Reported-by: Daniel Palmer <daniel@0x0f.com>
Cc: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220315091319.3351522-1-daniel@0x0f.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Link: https://lore.kernel.org/r/20220315164158.19804-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>


# ce780a47 13-Jan-2020 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: fix possible sleep-in-atomic

Change mutex and spinlock management to avoid sleep
in atomic issue.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Link: https://lore.kernel.org/r/20200113100400.30472-1-arnaud.pouliquen@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# af873fce 28-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194

Based on 1 normalized pattern(s):

license terms gnu general public license gpl version 2

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 161 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Steve Winslow <swinslow@gmail.com>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170027.447718015@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dc865fb9 04-Jul-2018 Takashi Iwai <tiwai@suse.de>

ASoC: sti: Use snd_pcm_stop_xrun() helper

The XRUN trigger from the driver should be done via
snd_pcm_stop_xrun(). It fixes the missing stream locking as a gratis,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 65ed0a8d 28-Apr-2017 Dan Carpenter <dan.carpenter@oracle.com>

ASoC: sti: Fix error handling if of_clk_get() fails

We intended to return here. The current code has a static checker
warning because we set "ret" but don't use it.

Fixes: 76c2145ded6b ("ASoC: sti: Add CPU DAI driver for playback")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# d05d862e 28-Mar-2017 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: STI: Fix null ptr deference in IRQ handler

With RTlinux a race condition has been found that leads to NULL ptr crash:
- On CPU 0: uni_player_irq_handler is called to treat XRUN
"(player->state == UNIPERIF_STATE_STOPPED)" is FALSE so status is checked,
dev_err(player->dev, "FIFO underflow error detected") is printed
and then snd_pcm_stream_lock should be called to lock stream for stopping.
- On CPU 1: application stop and close the stream.
Issue is that the stop and shutdown functions are executed while
"FIFO underflow error detected" is printed.
So when CPU 0 calls snd_pcm_stream_lock, player->substream is already null.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1e6d3044 24-Oct-2016 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: fix channel status update after playback start

If 'IEC958 Playback Default' control is updated during playback,
Channel status needs to be set according to the runtime structure.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 4db61af0 24-Oct-2016 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: clean unused include

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 4c88f89f 24-Oct-2016 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: reset refactoring

Reset is common to player and reader, migrate function in sti_uniperif.c

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 748abba8 24-Oct-2016 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: fix errors management

Add missing error messages.
Propagate error of uni_reader_init and uni_reader_init.
Add return at end of dev_err strings.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# b7c8c5d6 16-Sep-2016 Wei Yongjun <weiyongjun1@huawei.com>

ASoC: sti: fix missing clk_disable_unprepare() on error in uni_player_start()

Fix the missing clk_disable_unprepare() before return
from uni_player_start() in the error handling case.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5a4326d1 13-Sep-2016 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: suppress inappropriate DT fields

Update to suppress some DT nodes that can be handled in driver
using compatible string.
"dai-name", "st,version"and "st,mode" are suppressed
"st,tdm-mode" is added to handle TDM mode.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 7d267ddf 13-Jun-2016 Wei Yongjun <yongjun_wei@trendmicro.com.cn>

ASoC: sti: fix return value check in uni_player_parse_dt_audio_glue()

In case of error, the function syscon_regmap_lookup_by_phandle() returns
ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3ee15cac 14-Apr-2016 Moise Gergaud <moise.gergaud@st.com>

ASoC: sti: select player for I2S/TDM TX bus

By default, player#0 is connected to I2S/TDM TX bus.
This patch connects player#1 to I2S/TDM TX bus.

Signed-off-by: Moise Gergaud <moise.gergaud@st.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8d8b1e2e 07-Apr-2016 Moise Gergaud <moise.gergaud@st.com>

ASoC: sti: unip player tdm mode

here are the changes to enable player tdm mode:
- When TDM_ENABLE is set to 1, the i2s format should be automatically
configured. Unfortunately this is not the case (HW bug). Then, we shall
force DATA_SIZE setting.
- Compute the transfer size for tdm mode: transfer size = user frame size
- Manage tdm slots configuration given in DT.
- Don't use mclk-fs when unip in tdm mode; use tdm slot config to compute
frame size and to set mclk rate.
- Refine the hw param (channels & format) according to tdm slot config.

Signed-off-by: Moise Gergaud <moise.gergaud@st.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5295a0dc 07-Apr-2016 Moise Gergaud <moise.gergaud@st.com>

ASoC: sti: rename unip player type into common player & reader type

Signed-off-by: Moise Gergaud <moise.gergaud@st.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0d3f3c9a 24-Nov-2015 Moise Gergaud <moise.gergaud@st.com>

ASoC: sti: set iec958 channel status sampling freq

Previously, the iec958 channels status sampling freq was set only if not
already set. It means that it is not updated for next PCM sessions.
With this patch, we ensure the iec958 channels status sampling freq is set
to the runtime rate for each PCM session.

Signed-off-by: Moise Gergaud <moise.gergaud@st.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 36a65e20 19-Nov-2015 Moise Gergaud <moise.gergaud@st.com>

ASoC: sti: set player private data

Set substream player private data.
substream player private data is used in uni_player_irq_handler to lock,
stop & unlock the stream when interrupt indicates underflow/overflow.
If not set, then segmentation fault occurs.

Signed-off-by: Moise Gergaud <moise.gergaud@st.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f9f51973 19-Nov-2015 Moise Gergaud <moise.gergaud@st.com>

ASoC: sti: rename ST proprietary DT properties

"st," prefix has been added for ST proprietary DT properties.

Signed-off-by: Moise Gergaud <moise.gergaud@st.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3a0e27d8 10-Sep-2015 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: check return of of_property_read

Add check on of_property_read to return error when
DT required property is not defined.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 36cc0935 16-Jul-2015 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: Add IEC control

Add control to configure IEC60958 settings.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 85cf604e 27-Jul-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: uniperf: Staticise local symbols

uni_player_dai_ops is not used outside of this file so it should be static.
Fixes the following sparse warning:

sound/soc/sti/uniperif_player.c:959:30: warning: symbol
'uni_player_dai_ops' was not declared. Should it be static?

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f2da4542 16-Jul-2015 kbuild test robot <fengguang.wu@intel.com>

ASoC: sti: sti_uniperiph_dai_create_ctrl() can be static

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# fa050796 16-Jul-2015 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: Add clock adjustement control

Add capability to adjust player clock, for clocks drift management.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# ed6c75f2 16-Jul-2015 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: minor corrections for uniplayer

Minor corrections after code review.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 76c2145d 22-Jun-2015 Arnaud Pouliquen <arnaud.pouliquen@st.com>

ASoC: sti: Add CPU DAI driver for playback

Add code to manage Uniperipheral player IP instances.
These DAIs are dedicated to playback and support I2S and IEC modes.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>