diff options
| author | Gabriel Dalimonte <[email protected]> | 2025-06-01 16:45:36 +0000 |
|---|---|---|
| committer | Maxime Ripard <[email protected]> | 2025-06-10 08:47:04 +0000 |
| commit | c0317ad44f45b3c1f0ff46a4e28d14c7bccdedf4 (patch) | |
| tree | bd1fef518b511e5175e0999c68f0e8bec0657e26 | |
| parent | accel/amdxdna: Fix incorrect PSP firmware size (diff) | |
| download | kernel-c0317ad44f45b3c1f0ff46a4e28d14c7bccdedf4.tar.gz kernel-c0317ad44f45b3c1f0ff46a4e28d14c7bccdedf4.zip | |
drm/vc4: fix infinite EPROBE_DEFER loop
`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: 9640f1437a88 ("drm/vc4: hdmi: switch to using generic HDMI Codec infrastructure")
Signed-off-by: Gabriel Dalimonte <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
| -rw-r--r-- | drivers/gpu/drm/vc4/vc4_hdmi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index a29a6ef266f9..163d092bd973 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -560,12 +560,6 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, if (ret) return ret; - ret = drm_connector_hdmi_audio_init(connector, dev->dev, - &vc4_hdmi_audio_funcs, - 8, false, -1); - if (ret) - return ret; - drm_connector_helper_add(connector, &vc4_hdmi_connector_helper_funcs); /* @@ -2291,6 +2285,12 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) return ret; } + ret = drm_connector_hdmi_audio_init(&vc4_hdmi->connector, dev, + &vc4_hdmi_audio_funcs, 8, false, + -1); + if (ret) + return ret; + dai_link->cpus = &vc4_hdmi->audio.cpu; dai_link->codecs = &vc4_hdmi->audio.codec; dai_link->platforms = &vc4_hdmi->audio.platform; |
