Skip to content

Commit 64cf922

Browse files
Mornixsmb49
authored andcommitted
drm/vc4: fix infinite EPROBE_DEFER loop
BugLink: https://bugs.launchpad.net/bugs/2119603 [ Upstream commit c0317ad ] `vc4_hdmi_audio_init` calls `devm_snd_dmaengine_pcm_register` which may return EPROBE_DEFER. Calling `drm_connector_hdmi_audio_init` adds a child device. The driver model docs[1] state that adding a child device prior to returning EPROBE_DEFER may result in an infinite loop. [1] https://www.kernel.org/doc/html/v6.14/driver-api/driver-model/driver.html Fixes: 9640f14 ("drm/vc4: hdmi: switch to using generic HDMI Codec infrastructure") Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com> Link: https://lore.kernel.org/r/20250601-vc4-audio-inf-probe-v2-1-9ad43c7b6147@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent 5af2c86 commit 64cf922

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,6 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
587587
if (ret)
588588
return ret;
589589

590-
ret = drm_connector_hdmi_audio_init(connector, dev->dev,
591-
&vc4_hdmi_audio_funcs,
592-
8, false, -1);
593-
if (ret)
594-
return ret;
595-
596590
drm_connector_helper_add(connector, &vc4_hdmi_connector_helper_funcs);
597591

598592
/*
@@ -2302,6 +2296,12 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi)
23022296
return ret;
23032297
}
23042298

2299+
ret = drm_connector_hdmi_audio_init(&vc4_hdmi->connector, dev,
2300+
&vc4_hdmi_audio_funcs, 8, false,
2301+
-1);
2302+
if (ret)
2303+
return ret;
2304+
23052305
dai_link->cpus = &vc4_hdmi->audio.cpu;
23062306
dai_link->codecs = &vc4_hdmi->audio.codec;
23072307
dai_link->platforms = &vc4_hdmi->audio.platform;

0 commit comments

Comments
 (0)