dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Eric Anholt <eric@anholt.net>, Maxime Ripard <mripard@kernel.org>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>, dri-devel@lists.freedesktop.org
Subject: [PATCH RFC] drm/vc4: hdmi: Avoid ASoC error messages on startup
Date: Tue, 29 Dec 2020 16:36:50 +0100	[thread overview]
Message-ID: <1609256210-19863-1-git-send-email-stefan.wahren@i2se.com> (raw)

During startup of Raspberry Pi 4 there seems to be a race between
VC4 probing and Pulseaudio trying to open its PCM device:

    ASoC: error at snd_soc_dai_startup on fef05700.hdmi: -19

Avoid these errors by returning EPROBE_DEFER in this situation.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 5551062..e0f9357 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -909,12 +909,14 @@ static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream,
 
 	vc4_hdmi->audio.substream = substream;
 
+	if (!encoder->crtc)
+		return -EPROBE_DEFER;
+
 	/*
-	 * If the HDMI encoder hasn't probed, or the encoder is
-	 * currently in DVI mode, treat the codec dai as missing.
+	 * If the HDMI encoder is currently in DVI mode,
+	 * treat the codec dai as missing.
 	 */
-	if (!encoder->crtc || !(HDMI_READ(HDMI_RAM_PACKET_CONFIG) &
-				VC4_HDMI_RAM_PACKET_ENABLE))
+	if (!(HDMI_READ(HDMI_RAM_PACKET_CONFIG) & VC4_HDMI_RAM_PACKET_ENABLE))
 		return -ENODEV;
 
 	ret = snd_pcm_hw_constraint_eld(substream->runtime, connector->eld);
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2020-12-29 15:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29 15:36 Stefan Wahren [this message]
2021-01-09 11:41 ` [PATCH RFC] drm/vc4: hdmi: Avoid ASoC error messages on startup Stefan Wahren
2021-01-13  9:19   ` Maxime Ripard
2021-01-13 11:42     ` Mark Brown
2021-01-15 18:14       ` Maxime Ripard
2021-01-15 18:39         ` Mark Brown
2021-01-18 11:28           ` Stefan Wahren
2021-01-18 12:10             ` Nicolas Saenz Julienne
2021-01-18 14:06               ` Maxime Ripard
2021-01-15 17:21 ` Nicolas Saenz Julienne

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=1609256210-19863-1-git-send-email-stefan.wahren@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=airlied@linux.ie \
    --cc=broonie@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=lgirdwood@gmail.com \
    --cc=mripard@kernel.org \
    --cc=nsaenzjulienne@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).