Skip to contentSkip to conversation

OMAP: DSS: ensure clocks are disabled on failed init

PATCH In review Kevin Hilman 3 participants 4 messages Apr 26, 2010 – Apr 27, 2010 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP: DSS: ensure clocks are disabled on failed init

Currently, if init fails for whatever reason, various DSS related clocks will be left enabled and prevent the chip from hitting retention or off-mode.

This patch ensures the clocks are disabled on a failed init.

For this to work, a check had to be added to dispc_save_context() to not save context if it has not yet been initialized.

---
Patch against v2.6.34-rc5.

Discovered when testing n900 with current PM branch + Roger's series for the LCC panel. DPI init fails since it can't find VDDS_DSI regulator, and as a result init fails out and leaves clocks enabled.

 drivers/video/omap2/dss/core.c  |    1 +
 drivers/video/omap2/dss/dispc.c |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/video/omap2/dss/core.c +1 -0
index 7ebe50b..62f7ee2 100644
@@ -584,6 +584,7 @@ static int omap_dss_probe(struct platform_device *pdev)
 
 	/* XXX fail correctly */
 fail0:
+	dss_clk_disable_all();
 	return r;
 }
 
drivers/video/omap2/dss/dispc.c +3 -0
index e777e35..4cc54ef 100644
@@ -195,6 +195,9 @@ void dispc_save_context(void)
 	if (cpu_is_omap24xx())
 		return;
 
+	if (!dispc.base)
+		return;
+
 	SR(SYSCONFIG);
 	SR(IRQENABLE);
 	SR(CONTROL);
Signature · 1 line
1.7.0.2
#1 lore raw

CC Tomi in case he missed this.

Quoted 51 lines · Kevin Hilman

Currently, if init fails for whatever reason, various DSS related clocks will be left enabled and prevent the chip from hitting retention or off-mode.

This patch ensures the clocks are disabled on a failed init.

For this to work, a check had to be added to dispc_save_context() to not save context if it has not yet been initialized.

---
Patch against v2.6.34-rc5.

Discovered when testing n900 with current PM branch + Roger's series for the LCC panel.  DPI init fails since it can't find VDDS_DSI regulator, and as a result init fails out and leaves clocks enabled.

 drivers/video/omap2/dss/core.c  |    1 +
 drivers/video/omap2/dss/dispc.c |    3 +++

 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/video/omap2/dss/core.c +0 -0
index 7ebe50b..62f7ee2 100644
@@ -584,6 +584,7 @@ static int omap_dss_probe(struct platform_device *pdev)
 
        /* XXX fail correctly */

 fail0:
+       dss_clk_disable_all();
       return r;
 }

drivers/video/omap2/dss/dispc.c +3 -1
index e777e35..4cc54ef 100644
@@ -195,6 +195,9 @@ void dispc_save_context(void)
        if (cpu_is_omap24xx())
                return;
 
+       if (!dispc.base)
+               return;
+
        SR(SYSCONFIG);
        SR(IRQENABLE);
        SR(CONTROL);
--

1.7.0.2

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Hi,

Quoted 1 line · ext Grazvydas Ignotas

CC Tomi in case he missed this.

Thanks =)

Quoted 11 lines
Quoted 8 lines · Kevin Hilman

Currently, if init fails for whatever reason, various DSS related clocks will be left enabled and prevent the chip from hitting retention or off-mode.

This patch ensures the clocks are disabled on a failed init.

For this to work, a check had to be added to dispc_save_context() to not save context if it has not yet been initialized.

The code in omap_dss_probe() is actually quite broken, as the /* XXX fail correctly */ hints... At least clocks should be put(), debugfs should be uninitialized etc. So this patch is ok quick fix, but I'll try to find time to fix the fail path properly.

Tom

Quoted 48 lines
Quoted 48 lines

---
Patch against v2.6.34-rc5.

Discovered when testing n900 with current PM branch + Roger's series for the LCC panel. DPI init fails since it can't find VDDS_DSI regulator, and as a result init fails out and leaves clocks enabled.

 drivers/video/omap2/dss/core.c  |    1 +
 drivers/video/omap2/dss/dispc.c |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/video/omap2/dss/core.c +1 -0
index 7ebe50b..62f7ee2 100644
@@ -584,6 +584,7 @@ static int omap_dss_probe(struct platform_device *pdev)
 
       /* XXX fail correctly */
 fail0:
+       dss_clk_disable_all();
       return r;
 }
 
drivers/video/omap2/dss/dispc.c +3 -1
index e777e35..4cc54ef 100644
@@ -195,6 +195,9 @@ void dispc_save_context(void)
       if (cpu_is_omap24xx())
               return;
 
+       if (!dispc.base)
+               return;
+
       SR(SYSCONFIG);
       SR(IRQENABLE);
       SR(CONTROL);
--

1.7.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 16 lines · Tomi Valkeinen

Hi,

Quoted 1 line · ext Grazvydas Ignotas

CC Tomi in case he missed this.

Thanks =)

Quoted 9 lines
Quoted 6 lines · Kevin Hilman

Currently, if init fails for whatever reason, various DSS related clocks will be left enabled and prevent the chip from hitting retention or off-mode.

This patch ensures the clocks are disabled on a failed init.

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

For this to work, a check had to be added to dispc_save_context() to not save context if it has not yet been initialized.

The code in omap_dss_probe() is actually quite broken, as the /* XXX fail correctly */ hints... At least clocks should be put(), debugfs should be uninitialized etc. So this patch is ok quick fix, but I'll try to find time to fix the fail path properly.

Thanks. My main concern of course is that any failed init will ensure clocks are disabled and the modules are able to idle.

Kevin