Skip to content

Commit f1a54e8

Browse files
lategoodbyemairacanal
authored andcommitted
drm/vc4: hdmi: Handle error case of pm_runtime_resume_and_get
The commit 0f52513 ("drm/vc4: hdmi: Make sure the controller is powered in detect") introduced the necessary power management handling to avoid register access while controller is powered down. Unfortunately it just print a warning if pm_runtime_resume_and_get() fails and proceed anyway. This could happen during suspend to idle. So we must assume it is unsafe to access the HDMI register. So bail out properly. Fixes: 0f52513 ("drm/vc4: hdmi: Make sure the controller is powered in detect") Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5e9c0d1 commit f1a54e8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
429429
{
430430
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
431431
enum drm_connector_status status = connector_status_disconnected;
432+
int ret;
432433

433434
/*
434435
* NOTE: This function should really take vc4_hdmi->mutex, but
@@ -441,7 +442,12 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
441442
* the lock for now.
442443
*/
443444

444-
WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
445+
ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev);
446+
if (ret) {
447+
drm_err_once(connector->dev, "Failed to retain HDMI power domain: %d\n",
448+
ret);
449+
return connector_status_unknown;
450+
}
445451

446452
if (vc4_hdmi->hpd_gpio) {
447453
if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))

0 commit comments

Comments
 (0)