All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/mcde: Fix unbalanced regulator
@ 2020-11-08 11:35 ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2020-11-08 11:35 UTC (permalink / raw)
  To: dri-devel, Maarten Lankhorst, Maxime Ripard, Sean Paul
  Cc: Linus Walleij, 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] drm/mcde: Fix unbalanced regulator
@ 2020-11-08 11:35 ` Linus Walleij
  0 siblings, 0 replies; 4+ 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] 4+ messages in thread

* Re: [PATCH] drm/mcde: Fix unbalanced regulator
  2020-11-08 11:35 ` Linus Walleij
@ 2020-11-08 14:19   ` Sam Ravnborg
  -1 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2020-11-08 14:19 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Stephan Gerhold, Maarten Lankhorst, Maxime Ripard, 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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] drm/mcde: Fix unbalanced regulator
@ 2020-11-08 14:19   ` Sam Ravnborg
  0 siblings, 0 replies; 4+ 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] 4+ messages in thread

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

Thread overview: 4+ 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 11:35 ` Linus Walleij
2020-11-08 14:19 ` Sam Ravnborg
2020-11-08 14:19   ` Sam Ravnborg

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.