From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
<patches@opensource.cirrus.com>,
Simon Trimmer <simont@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>
Subject: [PATCH 3/5] ASoC: cs35l56: Wait for init_complete in cs35l56_component_probe()
Date: Fri, 14 Apr 2023 14:37:51 +0100 [thread overview]
Message-ID: <20230414133753.653139-4-rf@opensource.cirrus.com> (raw)
In-Reply-To: <20230414133753.653139-1-rf@opensource.cirrus.com>
From: Simon Trimmer <simont@opensource.cirrus.com>
Moving the wait from the beginning of the cs35l56_dsp_work() into
cs35l56_component_probe() will prevent the limbo situation that is an
artifact of the two stage SoundWire driver probe and initialisation
where the card is all registered and shows in ALSA but doesn't actually
work because the hardware didn't enumerate.
The other bus drivers perform the probe and init sequentially and are
not susceptible to this issue.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
sound/soc/codecs/cs35l56.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index d60095162bfa..ab2e663af6c2 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -875,13 +875,6 @@ static void cs35l56_dsp_work(struct work_struct *work)
unsigned int val;
int ret = 0;
- if (!cs35l56->init_done &&
- !wait_for_completion_timeout(&cs35l56->init_completion,
- msecs_to_jiffies(5000))) {
- dev_err(cs35l56->dev, "%s: init_completion timed out\n", __func__);
- goto complete;
- }
-
if (!cs35l56->init_done)
goto complete;
@@ -980,6 +973,12 @@ static int cs35l56_component_probe(struct snd_soc_component *component)
BUILD_BUG_ON(ARRAY_SIZE(cs35l56_tx_input_texts) != ARRAY_SIZE(cs35l56_tx_input_values));
+ if (!wait_for_completion_timeout(&cs35l56->init_completion,
+ msecs_to_jiffies(5000))) {
+ dev_err(cs35l56->dev, "%s: init_completion timed out\n", __func__);
+ return -ENODEV;
+ }
+
cs35l56->component = component;
wm_adsp2_component_probe(&cs35l56->dsp, component);
--
2.30.2
next prev parent reply other threads:[~2023-04-14 13:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 13:37 [PATCH 0/5] ASoC: cs35l56: Code improvements Richard Fitzgerald
2023-04-14 13:37 ` [PATCH 1/5] ASoC: cs35l56: Rework IRQ allocation Richard Fitzgerald
2023-04-14 13:37 ` [PATCH 2/5] ASoC: cs35l56: Allow a wider range for reset pulse width Richard Fitzgerald
2023-04-14 13:37 ` Richard Fitzgerald [this message]
2023-04-14 13:37 ` [PATCH 4/5] ASoC: cs35l56: Remove redundant dsp_ready_completion Richard Fitzgerald
2023-04-14 13:37 ` [PATCH 5/5] ASoC: cs35l56: Don't return a value from cs35l56_remove() Richard Fitzgerald
2023-04-17 20:27 ` [PATCH 0/5] ASoC: cs35l56: Code improvements Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230414133753.653139-4-rf@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=simont@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox