Commit ae11a9be authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: revert lock for calls to rsnd_dai_call

This reverts commit 'e9c390df ("ASoC: rsnd: make sure it uses lock when
it calls rsnd_dai_call)' The additional locks make 1") lock issue when boot
2) lock issue when unbind/rmmod. And there is no problem without these
locks. This patch revert it.
Reported-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 596f74ec
...@@ -731,15 +731,10 @@ static int rsnd_hw_params(struct snd_pcm_substream *substream, ...@@ -731,15 +731,10 @@ static int rsnd_hw_params(struct snd_pcm_substream *substream,
{ {
struct snd_soc_dai *dai = rsnd_substream_to_dai(substream); struct snd_soc_dai *dai = rsnd_substream_to_dai(substream);
struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai); struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream); struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
unsigned long flags;
int ret; int ret;
rsnd_lock(priv, flags);
ret = rsnd_dai_call(hw_params, io, substream, hw_params); ret = rsnd_dai_call(hw_params, io, substream, hw_params);
rsnd_unlock(priv, flags);
if (ret) if (ret)
return ret; return ret;
...@@ -926,16 +921,14 @@ int rsnd_kctrl_new_e(struct rsnd_mod *mod, ...@@ -926,16 +921,14 @@ int rsnd_kctrl_new_e(struct rsnd_mod *mod,
static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd) static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_dai *dai = rtd->cpu_dai; struct snd_soc_dai *dai = rtd->cpu_dai;
struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai); struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
unsigned long flags; int ret;
int ret = 0;
rsnd_lock(priv, flags); ret = rsnd_dai_call(pcm_new, &rdai->playback, rtd);
ret |= rsnd_dai_call(pcm_new, &rdai->playback, rtd); if (ret)
ret |= rsnd_dai_call(pcm_new, &rdai->capture, rtd); return ret;
rsnd_unlock(priv, flags);
ret = rsnd_dai_call(pcm_new, &rdai->capture, rtd);
if (ret) if (ret)
return ret; return ret;
...@@ -958,11 +951,8 @@ static const struct snd_soc_component_driver rsnd_soc_component = { ...@@ -958,11 +951,8 @@ static const struct snd_soc_component_driver rsnd_soc_component = {
static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv, static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
struct rsnd_dai_stream *io) struct rsnd_dai_stream *io)
{ {
unsigned long flags;
int ret; int ret;
rsnd_lock(priv, flags);
ret = rsnd_dai_call(probe, io, priv); ret = rsnd_dai_call(probe, io, priv);
if (ret == -EAGAIN) { if (ret == -EAGAIN) {
/* /*
...@@ -995,7 +985,6 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv, ...@@ -995,7 +985,6 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
*/ */
ret = rsnd_dai_call(probe, io, priv); ret = rsnd_dai_call(probe, io, priv);
} }
rsnd_unlock(priv, flags);
return ret; return ret;
} }
...@@ -1011,7 +1000,6 @@ static int rsnd_probe(struct platform_device *pdev) ...@@ -1011,7 +1000,6 @@ static int rsnd_probe(struct platform_device *pdev)
struct rsnd_dai *rdai; struct rsnd_dai *rdai;
const struct of_device_id *of_id = of_match_device(rsnd_of_match, dev); const struct of_device_id *of_id = of_match_device(rsnd_of_match, dev);
const struct rsnd_of_data *of_data; const struct rsnd_of_data *of_data;
unsigned long flags;
int (*probe_func[])(struct platform_device *pdev, int (*probe_func[])(struct platform_device *pdev,
const struct rsnd_of_data *of_data, const struct rsnd_of_data *of_data,
struct rsnd_priv *priv) = { struct rsnd_priv *priv) = {
...@@ -1098,12 +1086,10 @@ static int rsnd_probe(struct platform_device *pdev) ...@@ -1098,12 +1086,10 @@ static int rsnd_probe(struct platform_device *pdev)
exit_snd_soc: exit_snd_soc:
snd_soc_unregister_platform(dev); snd_soc_unregister_platform(dev);
exit_snd_probe: exit_snd_probe:
rsnd_lock(priv, flags);
for_each_rsnd_dai(rdai, priv, i) { for_each_rsnd_dai(rdai, priv, i) {
rsnd_dai_call(remove, &rdai->playback, priv); rsnd_dai_call(remove, &rdai->playback, priv);
rsnd_dai_call(remove, &rdai->capture, priv); rsnd_dai_call(remove, &rdai->capture, priv);
} }
rsnd_unlock(priv, flags);
return ret; return ret;
} }
...@@ -1112,7 +1098,6 @@ static int rsnd_remove(struct platform_device *pdev) ...@@ -1112,7 +1098,6 @@ static int rsnd_remove(struct platform_device *pdev)
{ {
struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev); struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev);
struct rsnd_dai *rdai; struct rsnd_dai *rdai;
unsigned long flags;
void (*remove_func[])(struct platform_device *pdev, void (*remove_func[])(struct platform_device *pdev,
struct rsnd_priv *priv) = { struct rsnd_priv *priv) = {
rsnd_ssi_remove, rsnd_ssi_remove,
...@@ -1123,12 +1108,10 @@ static int rsnd_remove(struct platform_device *pdev) ...@@ -1123,12 +1108,10 @@ static int rsnd_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
rsnd_lock(priv, flags);
for_each_rsnd_dai(rdai, priv, i) { for_each_rsnd_dai(rdai, priv, i) {
ret |= rsnd_dai_call(remove, &rdai->playback, priv); ret |= rsnd_dai_call(remove, &rdai->playback, priv);
ret |= rsnd_dai_call(remove, &rdai->capture, priv); ret |= rsnd_dai_call(remove, &rdai->capture, priv);
} }
rsnd_unlock(priv, flags);
for (i = 0; i < ARRAY_SIZE(remove_func); i++) for (i = 0; i < ARRAY_SIZE(remove_func); i++)
remove_func[i](pdev, priv); remove_func[i](pdev, priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment