Skip to content

Commit 0f52513

Browse files
committed
drm/vc4: hdmi: Make sure the controller is powered in detect
If the HPD GPIO is not available and drm_probe_ddc fails, we end up reading the HDMI_HOTPLUG register, but the controller might be powered off resulting in a CPU hang. Make sure we have the power domain and the HSM clock powered during the detect cycle to prevent the hang from happening. Fixes: 4f6e3d6 ("drm/vc4: Add runtime PM support to the HDMI encoder driver") Signed-off-by: Maxime Ripard <maxime@cerno.tech> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org> Tested-by: Nicolas Saenz Julienne <nsaenz@kernel.org> Tested-by: Michael Stapelberg <michael@stapelberg.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210922125419.4125779-6-maxime@cerno.tech
1 parent c86b412 commit 0f52513

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
168168
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
169169
bool connected = false;
170170

171+
WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
172+
171173
if (vc4_hdmi->hpd_gpio &&
172174
gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) {
173175
connected = true;
@@ -188,10 +190,12 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
188190
}
189191
}
190192

193+
pm_runtime_put(&vc4_hdmi->pdev->dev);
191194
return connector_status_connected;
192195
}
193196

194197
cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
198+
pm_runtime_put(&vc4_hdmi->pdev->dev);
195199
return connector_status_disconnected;
196200
}
197201

0 commit comments

Comments
 (0)