All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] drm/vc4: hdmi: Fix connector detect logic
@ 2021-07-05 21:36 Stefan Wahren
  2021-07-06  9:58 ` Maxime Ripard
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Wahren @ 2021-07-05 21:36 UTC (permalink / raw)
  To: Emma Anholt, Maxime Ripard, David Airlie, Daniel Vetter,
	Linus Walleij, Nathan Chancellor
  Cc: Stefan Wahren, Nicolas Saenz Julienne, dri-devel

Commit "drm/vc4: hdmi: Convert to gpiod" changes the behavior of
vc4_hdmi_connector_detect() which results into CPU hangs in case there
is no HDMI connected. Let's restore the old behavior.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Reported-by: Ojaswin Mujoo <ojaswin98@gmail.com>
Fixes: 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index aab1b36..cf8339c 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -168,9 +168,9 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
 
 	WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
 
-	if (vc4_hdmi->hpd_gpio &&
-	    gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) {
-		connected = true;
+	if (vc4_hdmi->hpd_gpio) {
+		if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
+			connected = true;
 	} else if (drm_probe_ddc(vc4_hdmi->ddc)) {
 		connected = true;
 	} else if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-16 15:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 21:36 [PATCH RFC] drm/vc4: hdmi: Fix connector detect logic Stefan Wahren
2021-07-06  9:58 ` Maxime Ripard
2021-07-06 10:48   ` Stefan Wahren
2021-07-06 13:21     ` Maxime Ripard
2021-07-06 15:45       ` Stefan Wahren
2021-07-07 13:11         ` Maxime Ripard
2021-07-07 18:01           ` Stefan Wahren
2021-07-16 15:49             ` Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.