Skip to content

Commit d1c0b7d

Browse files
committed
drm/vc4: Add module dependency on hdmi-codec
The VC4 HDMI controller driver relies on the HDMI codec ASoC driver. In order to set it up properly, in vc4_hdmi_audio_init(), our HDMI driver will register a device matching the HDMI codec driver, and then register an ASoC card using that codec. However, if vc4 is compiled as a module, chances are that the hdmi-codec driver will be too. In such a case, the module loader will have a very narrow window to load the module between the device registration and the card registration. If it fails to load the module in time, the card registration will fail with EPROBE_DEFER, and we'll abort the audio initialisation, unregistering the HDMI codec device in the process. The next time the bind callback will be run, it's likely that we end up missing that window again, effectively preventing vc4 to probe entirely. In order to prevent this, we can create a soft dependency of the vc4 driver on the HDMI codec one so that we're sure the HDMI codec will be loaded before the VC4 module is, and thus we'll never end up in the previous situation. Fixes: 91e99e1 ("drm/vc4: hdmi: Register HDMI codec") Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent cc62d98 commit d1c0b7d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/vc4/vc4_drv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ module_init(vc4_drm_register);
480480
module_exit(vc4_drm_unregister);
481481

482482
MODULE_ALIAS("platform:vc4-drm");
483+
MODULE_SOFTDEP("pre: snd-soc-hdmi-codec");
483484
MODULE_DESCRIPTION("Broadcom VC4 DRM Driver");
484485
MODULE_AUTHOR("Eric Anholt <[email protected]>");
485486
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)