未验证 提交 901af18b 编写于 作者: J Jerome Brunet 提交者: Mark Brown

ASoC: hdmi-codec: drop mutex locking again

This reverts commit eb1ecadb.

This fixes the following warning reported by lockdep and a potential
issue with hibernation

====================================
WARNING: pulseaudio/1297 still has locks held!
5.3.0+ #1826 Not tainted
------------------------------------
1 lock held by pulseaudio/1297:
 #0: ee815308 (&hcp->lock){....}, at: hdmi_codec_startup+0x20/0x130

stack backtrace:
CPU: 0 PID: 1297 Comm: pulseaudio Not tainted 5.3.0+ #1826
Hardware name: Marvell Dove (Cubox)
[<c0017b4c>] (unwind_backtrace) from [<c0014d10>] (show_stack+0x10/0x14)
[<c0014d10>] (show_stack) from [<c00a2d18>] (futex_wait_queue_me+0x13c/0x19c)
[<c00a2d18>] (futex_wait_queue_me) from [<c00a3630>] (futex_wait+0x184/0x24c)
[<c00a3630>] (futex_wait) from [<c00a5e1c>] (do_futex+0x334/0x598)
[<c00a5e1c>] (do_futex) from [<c00a62e8>] (sys_futex_time32+0x118/0x180)
[<c00a62e8>] (sys_futex_time32) from [<c0009000>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xebd31fa8 to 0xebd31ff0)
1fa0:                   00000000 ffffffff 000c8748 00000189 00000001 00000000
1fc0: 00000000 ffffffff 00000000 000000f0 00000000 00000000 00000000 00056200
1fe0: 000000f0 beac03a8 b6d6c835 b6d6f456

Fixes: eb1ecadb ("ASoC: hdmi-codec: re-introduce mutex locking")
Reported-by: NRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: NJerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20191023161203.28955-2-jbrunet@baylibre.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 4523817d
...@@ -274,7 +274,7 @@ struct hdmi_codec_priv { ...@@ -274,7 +274,7 @@ struct hdmi_codec_priv {
uint8_t eld[MAX_ELD_BYTES]; uint8_t eld[MAX_ELD_BYTES];
struct snd_pcm_chmap *chmap_info; struct snd_pcm_chmap *chmap_info;
unsigned int chmap_idx; unsigned int chmap_idx;
struct mutex lock; unsigned long busy;
struct snd_soc_jack *jack; struct snd_soc_jack *jack;
unsigned int jack_status; unsigned int jack_status;
}; };
...@@ -390,8 +390,8 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream, ...@@ -390,8 +390,8 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
int ret = 0; int ret = 0;
ret = mutex_trylock(&hcp->lock); ret = test_and_set_bit(0, &hcp->busy);
if (!ret) { if (ret) {
dev_err(dai->dev, "Only one simultaneous stream supported!\n"); dev_err(dai->dev, "Only one simultaneous stream supported!\n");
return -EINVAL; return -EINVAL;
} }
...@@ -419,7 +419,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream, ...@@ -419,7 +419,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
err: err:
/* Release the exclusive lock on error */ /* Release the exclusive lock on error */
mutex_unlock(&hcp->lock); clear_bit(0, &hcp->busy);
return ret; return ret;
} }
...@@ -431,7 +431,7 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream, ...@@ -431,7 +431,7 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream,
hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data); hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data);
mutex_unlock(&hcp->lock); clear_bit(0, &hcp->busy);
} }
static int hdmi_codec_hw_params(struct snd_pcm_substream *substream, static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
...@@ -811,8 +811,6 @@ static int hdmi_codec_probe(struct platform_device *pdev) ...@@ -811,8 +811,6 @@ static int hdmi_codec_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
hcp->hcd = *hcd; hcp->hcd = *hcd;
mutex_init(&hcp->lock);
daidrv = devm_kcalloc(dev, dai_count, sizeof(*daidrv), GFP_KERNEL); daidrv = devm_kcalloc(dev, dai_count, sizeof(*daidrv), GFP_KERNEL);
if (!daidrv) if (!daidrv)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册