dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/mcde: Fix unbalanced regulator
@ 2020-11-08 11:35 Linus Walleij
  2020-11-08 14:19 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2020-11-08 11:35 UTC (permalink / raw)
  To: dri-devel, Maarten Lankhorst, Maxime Ripard, Sean Paul
  Cc: Stephan Gerhold, linux-arm-kernel

Since we now turn off the EPOD regulator to reset the
hardware, we need to balance the regulators after that
point. If registering the master fails we only need
to disable one regulator. Fix this by open-coding
this leg of the error path.

Cc: Stephan Gerhold <stephan@gerhold.net>
Fixes: c4842d4d0f74 ("drm/mcde: Fix display pipeline restart")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpu/drm/mcde/mcde_drv.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index c592957ed07f..92f8bd907193 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -413,7 +413,13 @@ static int mcde_probe(struct platform_device *pdev)
 					      match);
 	if (ret) {
 		dev_err(dev, "failed to add component master\n");
-		goto clk_disable;
+		/*
+		 * The EPOD regulator is already disabled at this point so some
+		 * special errorpath code is needed
+		 */
+		clk_disable_unprepare(mcde->mcde_clk);
+		regulator_disable(mcde->vana);
+		return ret;
 	}
 
 	return 0;
-- 
2.26.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/mcde: Fix unbalanced regulator
  2020-11-08 11:35 [PATCH] drm/mcde: Fix unbalanced regulator Linus Walleij
@ 2020-11-08 14:19 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2020-11-08 14:19 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Stephan Gerhold, dri-devel, Sean Paul, linux-arm-kernel

On Sun, Nov 08, 2020 at 12:35:35PM +0100, Linus Walleij wrote:
> Since we now turn off the EPOD regulator to reset the
> hardware, we need to balance the regulators after that
> point. If registering the master fails we only need
> to disable one regulator. Fix this by open-coding
> this leg of the error path.
> 
> Cc: Stephan Gerhold <stephan@gerhold.net>
> Fixes: c4842d4d0f74 ("drm/mcde: Fix display pipeline restart")
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Looked for a devm variant of regulator_enable() but they do not seem to
exist. So the way the patch does it seems the best way.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

	Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2020-11-08 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-08 11:35 [PATCH] drm/mcde: Fix unbalanced regulator Linus Walleij
2020-11-08 14:19 ` Sam Ravnborg

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).