linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/vc4: hdmi: Fix error path of hpd-gpios
@ 2021-05-24 13:18 Maxime Ripard
  2021-05-24 13:18 ` [PATCH 2/2] drm/vc4: hdmi: Convert to gpiod Maxime Ripard
  2021-06-04 21:44 ` [PATCH 1/2] drm/vc4: hdmi: Fix error path of hpd-gpios Linus Walleij
  0 siblings, 2 replies; 10+ messages in thread
From: Maxime Ripard @ 2021-05-24 13:18 UTC (permalink / raw)
  To: dri-devel, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann, Maxime Ripard
  Cc: Eric Anholt, linux-kernel, Linus Wallei, Dave Stevenson,
	Phil Elwell, Tim Gover, Dom Cobley, Daniel Vetter, Hans Verkuil,
	Maxime Ripard

If the of_get_named_gpio_flags call fails in vc4_hdmi_bind, we jump to
the err_unprepare_hsm label. That label will then call
pm_runtime_disable and put_device on the DDC device.

We just retrieved the DDC device, so the latter is definitely justified.
However at that point we still haven't called pm_runtime_enable, so the
call to pm_runtime_disable is not supposed to be there.

Fixes: 10ee275cb12f ("drm/vc4: prepare for CEC support")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index c27b287d2053..ccc6c8079dc6 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -2039,7 +2039,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
 							     &hpd_gpio_flags);
 		if (vc4_hdmi->hpd_gpio < 0) {
 			ret = vc4_hdmi->hpd_gpio;
-			goto err_unprepare_hsm;
+			goto err_put_ddc;
 		}
 
 		vc4_hdmi->hpd_active_low = hpd_gpio_flags & OF_GPIO_ACTIVE_LOW;
@@ -2080,8 +2080,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
 	vc4_hdmi_connector_destroy(&vc4_hdmi->connector);
 err_destroy_encoder:
 	drm_encoder_cleanup(encoder);
-err_unprepare_hsm:
 	pm_runtime_disable(dev);
+err_put_ddc:
 	put_device(&vc4_hdmi->ddc->dev);
 
 	return ret;
-- 
2.31.1


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

end of thread, other threads:[~2021-07-03  5:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 13:18 [PATCH 1/2] drm/vc4: hdmi: Fix error path of hpd-gpios Maxime Ripard
2021-05-24 13:18 ` [PATCH 2/2] drm/vc4: hdmi: Convert to gpiod Maxime Ripard
2021-05-27 23:57   ` Linus Walleij
2021-06-04  8:01     ` Maxime Ripard
2021-06-04 21:45       ` Linus Walleij
2021-06-07  7:32         ` Maxime Ripard
2021-07-02  3:29   ` Nathan Chancellor
2021-07-02 13:16     ` Maxime Ripard
2021-07-03  5:01       ` Nathan Chancellor
2021-06-04 21:44 ` [PATCH 1/2] drm/vc4: hdmi: Fix error path of hpd-gpios Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).