Skip to content

Commit d674223

Browse files
morimotoDinh Nguyen
authored andcommitted
ASoC: rsnd: revert lock for calls to rsnd_dai_call
This reverts commit 'e9c390df671f ("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: Geert Uytterhoeven <[email protected]> Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]> (cherry picked from commit ae11a9b) Signed-off-by: Simon Horman <[email protected]>
1 parent 6f08482 commit d674223

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

sound/soc/sh/rcar/core.c

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -731,15 +731,10 @@ static int rsnd_hw_params(struct snd_pcm_substream *substream,
731731
{
732732
struct snd_soc_dai *dai = rsnd_substream_to_dai(substream);
733733
struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
734-
struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
735734
struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
736-
unsigned long flags;
737735
int ret;
738736

739-
rsnd_lock(priv, flags);
740737
ret = rsnd_dai_call(hw_params, io, substream, hw_params);
741-
rsnd_unlock(priv, flags);
742-
743738
if (ret)
744739
return ret;
745740

@@ -926,16 +921,14 @@ int rsnd_kctrl_new_e(struct rsnd_mod *mod,
926921
static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd)
927922
{
928923
struct snd_soc_dai *dai = rtd->cpu_dai;
929-
struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
930924
struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
931-
unsigned long flags;
932-
int ret = 0;
925+
int ret;
933926

934-
rsnd_lock(priv, flags);
935-
ret |= rsnd_dai_call(pcm_new, &rdai->playback, rtd);
936-
ret |= rsnd_dai_call(pcm_new, &rdai->capture, rtd);
937-
rsnd_unlock(priv, flags);
927+
ret = rsnd_dai_call(pcm_new, &rdai->playback, rtd);
928+
if (ret)
929+
return ret;
938930

931+
ret = rsnd_dai_call(pcm_new, &rdai->capture, rtd);
939932
if (ret)
940933
return ret;
941934

@@ -958,11 +951,8 @@ static const struct snd_soc_component_driver rsnd_soc_component = {
958951
static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
959952
struct rsnd_dai_stream *io)
960953
{
961-
unsigned long flags;
962954
int ret;
963955

964-
rsnd_lock(priv, flags);
965-
966956
ret = rsnd_dai_call(probe, io, priv);
967957
if (ret == -EAGAIN) {
968958
/*
@@ -995,7 +985,6 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
995985
*/
996986
ret = rsnd_dai_call(probe, io, priv);
997987
}
998-
rsnd_unlock(priv, flags);
999988

1000989
return ret;
1001990
}
@@ -1011,7 +1000,6 @@ static int rsnd_probe(struct platform_device *pdev)
10111000
struct rsnd_dai *rdai;
10121001
const struct of_device_id *of_id = of_match_device(rsnd_of_match, dev);
10131002
const struct rsnd_of_data *of_data;
1014-
unsigned long flags;
10151003
int (*probe_func[])(struct platform_device *pdev,
10161004
const struct rsnd_of_data *of_data,
10171005
struct rsnd_priv *priv) = {
@@ -1098,12 +1086,10 @@ static int rsnd_probe(struct platform_device *pdev)
10981086
exit_snd_soc:
10991087
snd_soc_unregister_platform(dev);
11001088
exit_snd_probe:
1101-
rsnd_lock(priv, flags);
11021089
for_each_rsnd_dai(rdai, priv, i) {
11031090
rsnd_dai_call(remove, &rdai->playback, priv);
11041091
rsnd_dai_call(remove, &rdai->capture, priv);
11051092
}
1106-
rsnd_unlock(priv, flags);
11071093

11081094
return ret;
11091095
}
@@ -1112,7 +1098,6 @@ static int rsnd_remove(struct platform_device *pdev)
11121098
{
11131099
struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev);
11141100
struct rsnd_dai *rdai;
1115-
unsigned long flags;
11161101
void (*remove_func[])(struct platform_device *pdev,
11171102
struct rsnd_priv *priv) = {
11181103
rsnd_ssi_remove,
@@ -1123,12 +1108,10 @@ static int rsnd_remove(struct platform_device *pdev)
11231108

11241109
pm_runtime_disable(&pdev->dev);
11251110

1126-
rsnd_lock(priv, flags);
11271111
for_each_rsnd_dai(rdai, priv, i) {
11281112
ret |= rsnd_dai_call(remove, &rdai->playback, priv);
11291113
ret |= rsnd_dai_call(remove, &rdai->capture, priv);
11301114
}
1131-
rsnd_unlock(priv, flags);
11321115

11331116
for (i = 0; i < ARRAY_SIZE(remove_func); i++)
11341117
remove_func[i](pdev, priv);

0 commit comments

Comments
 (0)