diff options
author | John Lin <john.lin@realtek.com> | 2015-05-17 22:34:03 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-05-19 08:10:26 -0400 |
commit | 345b0f50e74671fd8299e26c73ab50c5a0cf6ed9 (patch) | |
tree | faefaa8d06d752816c40eb98f1f6d6a354c3e04c | |
parent | 05a9b46a718f664fce5d236abe72bffb8200d616 (diff) |
ASoC: rt5645: fix kernel hang when call rt5645_set_jack_detect()
rt5645_set_jack_detect() is usually called from
snd_soc_dai_link.init() and it calls snd_soc_jack_report() from
rt5645_irq_detection() if jack is inserted. snd_soc_jack_report()
results in kernel hang if it is called from a context which cannot
sleep.
This patch makes sure snd_soc_jack_report() is called from
workqueue. It can fix the kernel hang issue.
Signed-off-by: John Lin <john.lin@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/rt5645.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 14b12c55580c..aaede45a2f4b 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c | |||
@@ -2876,6 +2876,7 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert) | |||
2876 | } | 2876 | } |
2877 | 2877 | ||
2878 | static int rt5645_irq_detection(struct rt5645_priv *rt5645); | 2878 | static int rt5645_irq_detection(struct rt5645_priv *rt5645); |
2879 | static irqreturn_t rt5645_irq(int irq, void *data); | ||
2879 | 2880 | ||
2880 | int rt5645_set_jack_detect(struct snd_soc_codec *codec, | 2881 | int rt5645_set_jack_detect(struct snd_soc_codec *codec, |
2881 | struct snd_soc_jack *hp_jack, struct snd_soc_jack *mic_jack, | 2882 | struct snd_soc_jack *hp_jack, struct snd_soc_jack *mic_jack, |
@@ -2895,7 +2896,7 @@ int rt5645_set_jack_detect(struct snd_soc_codec *codec, | |||
2895 | regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1, | 2896 | regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1, |
2896 | RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL); | 2897 | RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL); |
2897 | } | 2898 | } |
2898 | rt5645_irq_detection(rt5645); | 2899 | rt5645_irq(0, rt5645); |
2899 | 2900 | ||
2900 | return 0; | 2901 | return 0; |
2901 | } | 2902 | } |