All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix
@ 2011-08-24  9:39 Magnus Damm
  2011-08-24 20:43 ` Rafael J. Wysocki
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Magnus Damm @ 2011-08-24  9:39 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@opensource.se>

Associate the HDMI clock together with LCDC1 on sh7372.

Without this patch Suspend-to-RAM hangs on the boards
AP4EVB and Mackerel. The code hangs in the LCDC driver
where the software is waiting forever for the hardware to
power down. By explicitly associating the HDMI clock with
LCDC1 we can make sure the HDMI clock is enabled using
Runtime PM whenever the driver is accessing the hardware.

This HDMI and LCDC1 dependency is documented in the sh7372
data sheet. Older kernels did work as expected but the
recently merged (3.1-rc)

 794d78f drivers: sh: late disabling of clocks V2

introduced code to turn off clocks lacking software reference
which happens to include the HDMI clock that is needed by
LCDC1 to operate as expected.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Rafael, since this patch is Suspend-to-RAM related, can you
 please merge this with your other 3.1-rc fixes?

 arch/arm/mach-shmobile/board-ap4evb.c   |    1 +
 arch/arm/mach-shmobile/board-mackerel.c |    1 +
 arch/arm/mach-shmobile/clock-sh7372.c   |    2 ++
 3 files changed, 4 insertions(+)

--- 0001/arch/arm/mach-shmobile/board-ap4evb.c
+++ work/arch/arm/mach-shmobile/board-ap4evb.c	2011-08-24 08:50:18.000000000 +0900
@@ -1412,6 +1412,7 @@ static void __init ap4evb_init(void)
 	fsi_init_pm_clock();
 	sh7372_pm_init();
 	pm_clk_add(&fsi_device.dev, "spu2");
+	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
 }
 
 static void __init ap4evb_timer_init(void)
--- 0001/arch/arm/mach-shmobile/board-mackerel.c
+++ work/arch/arm/mach-shmobile/board-mackerel.c	2011-08-24 08:50:09.000000000 +0900
@@ -1588,6 +1588,7 @@ static void __init mackerel_init(void)
 	hdmi_init_pm_clock();
 	sh7372_pm_init();
 	pm_clk_add(&fsi_device.dev, "spu2");
+	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
 }
 
 static void __init mackerel_timer_init(void)
--- 0001/arch/arm/mach-shmobile/clock-sh7372.c
+++ work/arch/arm/mach-shmobile/clock-sh7372.c	2011-08-24 08:49:58.000000000 +0900
@@ -655,6 +655,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */
 	CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
 
+	CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1",
+		      &div6_reparent_clks[DIV6_HDMI]),
 	CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
 	CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
 	CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),

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

* Re: [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix
  2011-08-24  9:39 [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix Magnus Damm
@ 2011-08-24 20:43 ` Rafael J. Wysocki
  2011-08-26  4:47 ` [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2 Magnus Damm
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2011-08-24 20:43 UTC (permalink / raw)
  To: linux-sh

Hi,

On Wednesday, August 24, 2011, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Associate the HDMI clock together with LCDC1 on sh7372.
> 
> Without this patch Suspend-to-RAM hangs on the boards
> AP4EVB and Mackerel. The code hangs in the LCDC driver
> where the software is waiting forever for the hardware to
> power down. By explicitly associating the HDMI clock with
> LCDC1 we can make sure the HDMI clock is enabled using
> Runtime PM whenever the driver is accessing the hardware.
> 
> This HDMI and LCDC1 dependency is documented in the sh7372
> data sheet. Older kernels did work as expected but the
> recently merged (3.1-rc)
> 
>  794d78f drivers: sh: late disabling of clocks V2
> 
> introduced code to turn off clocks lacking software reference
> which happens to include the HDMI clock that is needed by
> LCDC1 to operate as expected.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  Rafael, since this patch is Suspend-to-RAM related, can you
>  please merge this with your other 3.1-rc fixes?

Yes, I'll do that.  Applied to linux-pm/pm-fixes and will be
pushed to Linus later this week.

Thanks,
Rafael


>  arch/arm/mach-shmobile/board-ap4evb.c   |    1 +
>  arch/arm/mach-shmobile/board-mackerel.c |    1 +
>  arch/arm/mach-shmobile/clock-sh7372.c   |    2 ++
>  3 files changed, 4 insertions(+)
> 
> --- 0001/arch/arm/mach-shmobile/board-ap4evb.c
> +++ work/arch/arm/mach-shmobile/board-ap4evb.c	2011-08-24 08:50:18.000000000 +0900
> @@ -1412,6 +1412,7 @@ static void __init ap4evb_init(void)
>  	fsi_init_pm_clock();
>  	sh7372_pm_init();
>  	pm_clk_add(&fsi_device.dev, "spu2");
> +	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
>  }
>  
>  static void __init ap4evb_timer_init(void)
> --- 0001/arch/arm/mach-shmobile/board-mackerel.c
> +++ work/arch/arm/mach-shmobile/board-mackerel.c	2011-08-24 08:50:09.000000000 +0900
> @@ -1588,6 +1588,7 @@ static void __init mackerel_init(void)
>  	hdmi_init_pm_clock();
>  	sh7372_pm_init();
>  	pm_clk_add(&fsi_device.dev, "spu2");
> +	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
>  }
>  
>  static void __init mackerel_timer_init(void)
> --- 0001/arch/arm/mach-shmobile/clock-sh7372.c
> +++ work/arch/arm/mach-shmobile/clock-sh7372.c	2011-08-24 08:49:58.000000000 +0900
> @@ -655,6 +655,8 @@ static struct clk_lookup lookups[] = {
>  	CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */
>  	CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
>  
> +	CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1",
> +		      &div6_reparent_clks[DIV6_HDMI]),
>  	CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
>  	CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
>  	CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
> 
> 


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

* [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2
  2011-08-24  9:39 [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix Magnus Damm
  2011-08-24 20:43 ` Rafael J. Wysocki
@ 2011-08-26  4:47 ` Magnus Damm
  2011-08-26 20:47 ` Rafael J. Wysocki
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Magnus Damm @ 2011-08-26  4:47 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@opensource.se>

Associate the HDMI clock together with LCDC1 on sh7372 V2.

Without this patch Suspend-to-RAM hangs on the boards
AP4EVB and Mackerel. The code hangs in the LCDC driver
where the software is waiting forever for the hardware to
power down. By explicitly associating the HDMI clock with
LCDC1 we can make sure the HDMI clock is enabled using
Runtime PM whenever the driver is accessing the hardware.

This HDMI and LCDC1 dependency is documented in the sh7372
data sheet. Older kernels did work as expected but the
recently merged (3.1-rc)

 794d78f drivers: sh: late disabling of clocks V2

introduced code to turn off clocks lacking software reference
which happens to include the HDMI clock that is needed by
LCDC1 to operate as expected.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Changes V1 -> V2:
 - Use lcdc1_device on AP4EVB to build properly.

 arch/arm/mach-shmobile/board-ap4evb.c   |    1 +
 arch/arm/mach-shmobile/board-mackerel.c |    1 +
 arch/arm/mach-shmobile/clock-sh7372.c   |    2 ++
 3 files changed, 4 insertions(+)

--- 0001/arch/arm/mach-shmobile/board-ap4evb.c
+++ work/arch/arm/mach-shmobile/board-ap4evb.c	2011-08-26 13:41:24.000000000 +0900
@@ -1412,6 +1412,7 @@ static void __init ap4evb_init(void)
 	fsi_init_pm_clock();
 	sh7372_pm_init();
 	pm_clk_add(&fsi_device.dev, "spu2");
+	pm_clk_add(&lcdc1_device.dev, "hdmi");
 }
 
 static void __init ap4evb_timer_init(void)
--- 0004/arch/arm/mach-shmobile/board-mackerel.c
+++ work/arch/arm/mach-shmobile/board-mackerel.c	2011-08-26 13:33:36.000000000 +0900
@@ -1592,6 +1592,7 @@ static void __init mackerel_init(void)
 	hdmi_init_pm_clock();
 	sh7372_pm_init();
 	pm_clk_add(&fsi_device.dev, "spu2");
+	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
 }
 
 static void __init mackerel_timer_init(void)
--- 0005/arch/arm/mach-shmobile/clock-sh7372.c
+++ work/arch/arm/mach-shmobile/clock-sh7372.c	2011-08-26 13:33:36.000000000 +0900
@@ -659,6 +659,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */
 	CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
 
+	CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1",
+		      &div6_reparent_clks[DIV6_HDMI]),
 	CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
 	CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
 	CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),

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

* Re: [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2
  2011-08-24  9:39 [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix Magnus Damm
  2011-08-24 20:43 ` Rafael J. Wysocki
  2011-08-26  4:47 ` [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2 Magnus Damm
@ 2011-08-26 20:47 ` Rafael J. Wysocki
  2011-08-27 12:04 ` [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2 (incremental) Magnus Damm
  2011-08-27 12:27 ` Rafael J. Wysocki
  4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2011-08-26 20:47 UTC (permalink / raw)
  To: linux-sh

Hi,

On Friday, August 26, 2011, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Associate the HDMI clock together with LCDC1 on sh7372 V2.
> 
> Without this patch Suspend-to-RAM hangs on the boards
> AP4EVB and Mackerel. The code hangs in the LCDC driver
> where the software is waiting forever for the hardware to
> power down. By explicitly associating the HDMI clock with
> LCDC1 we can make sure the HDMI clock is enabled using
> Runtime PM whenever the driver is accessing the hardware.
> 
> This HDMI and LCDC1 dependency is documented in the sh7372
> data sheet. Older kernels did work as expected but the
> recently merged (3.1-rc)
> 
>  794d78f drivers: sh: late disabling of clocks V2
> 
> introduced code to turn off clocks lacking software reference
> which happens to include the HDMI clock that is needed by
> LCDC1 to operate as expected.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>

Since the v1 alread sits in my pm-fixes branch which I _really_
wouldn't like to rebase (and in fact I was planning to push it
to Linus today) can you please create an incremental v1->v2
patch on top of it?

Rafael


> ---
> 
>  Changes V1 -> V2:
>  - Use lcdc1_device on AP4EVB to build properly.
> 
>  arch/arm/mach-shmobile/board-ap4evb.c   |    1 +
>  arch/arm/mach-shmobile/board-mackerel.c |    1 +
>  arch/arm/mach-shmobile/clock-sh7372.c   |    2 ++
>  3 files changed, 4 insertions(+)
> 
> --- 0001/arch/arm/mach-shmobile/board-ap4evb.c
> +++ work/arch/arm/mach-shmobile/board-ap4evb.c	2011-08-26 13:41:24.000000000 +0900
> @@ -1412,6 +1412,7 @@ static void __init ap4evb_init(void)
>  	fsi_init_pm_clock();
>  	sh7372_pm_init();
>  	pm_clk_add(&fsi_device.dev, "spu2");
> +	pm_clk_add(&lcdc1_device.dev, "hdmi");
>  }
>  
>  static void __init ap4evb_timer_init(void)
> --- 0004/arch/arm/mach-shmobile/board-mackerel.c
> +++ work/arch/arm/mach-shmobile/board-mackerel.c	2011-08-26 13:33:36.000000000 +0900
> @@ -1592,6 +1592,7 @@ static void __init mackerel_init(void)
>  	hdmi_init_pm_clock();
>  	sh7372_pm_init();
>  	pm_clk_add(&fsi_device.dev, "spu2");
> +	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
>  }
>  
>  static void __init mackerel_timer_init(void)
> --- 0005/arch/arm/mach-shmobile/clock-sh7372.c
> +++ work/arch/arm/mach-shmobile/clock-sh7372.c	2011-08-26 13:33:36.000000000 +0900
> @@ -659,6 +659,8 @@ static struct clk_lookup lookups[] = {
>  	CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */
>  	CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
>  
> +	CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1",
> +		      &div6_reparent_clks[DIV6_HDMI]),
>  	CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
>  	CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
>  	CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
> 
> 


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

* [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2 (incremental)
  2011-08-24  9:39 [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix Magnus Damm
                   ` (2 preceding siblings ...)
  2011-08-26 20:47 ` Rafael J. Wysocki
@ 2011-08-27 12:04 ` Magnus Damm
  2011-08-27 12:27 ` Rafael J. Wysocki
  4 siblings, 0 replies; 6+ messages in thread
From: Magnus Damm @ 2011-08-27 12:04 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@opensource.se>

This patch updates the recently submitted
"Associate the HDMI clock together with LCDC1 on sh7372"
to V2 with the following change:
 - Use lcdc1_device on AP4EVB to build properly.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/mach-shmobile/board-ap4evb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 0007/arch/arm/mach-shmobile/board-ap4evb.c
+++ work/arch/arm/mach-shmobile/board-ap4evb.c	2011-08-27 20:58:15.000000000 +0900
@@ -1412,7 +1412,7 @@ static void __init ap4evb_init(void)
 	fsi_init_pm_clock();
 	sh7372_pm_init();
 	pm_clk_add(&fsi_device.dev, "spu2");
-	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
+	pm_clk_add(&lcdc1_device.dev, "hdmi");
 }
 
 static void __init ap4evb_timer_init(void)

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

* Re: [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2 (incremental)
  2011-08-24  9:39 [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix Magnus Damm
                   ` (3 preceding siblings ...)
  2011-08-27 12:04 ` [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2 (incremental) Magnus Damm
@ 2011-08-27 12:27 ` Rafael J. Wysocki
  4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2011-08-27 12:27 UTC (permalink / raw)
  To: linux-sh

On Saturday, August 27, 2011, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> This patch updates the recently submitted
> "Associate the HDMI clock together with LCDC1 on sh7372"
> to V2 with the following change:
>  - Use lcdc1_device on AP4EVB to build properly.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>

Applied to linux-pm/pm-fixes, thanks!

Rafael


> ---
> 
>  arch/arm/mach-shmobile/board-ap4evb.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- 0007/arch/arm/mach-shmobile/board-ap4evb.c
> +++ work/arch/arm/mach-shmobile/board-ap4evb.c	2011-08-27 20:58:15.000000000 +0900
> @@ -1412,7 +1412,7 @@ static void __init ap4evb_init(void)
>  	fsi_init_pm_clock();
>  	sh7372_pm_init();
>  	pm_clk_add(&fsi_device.dev, "spu2");
> -	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
> +	pm_clk_add(&lcdc1_device.dev, "hdmi");
>  }
>  
>  static void __init ap4evb_timer_init(void)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


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

end of thread, other threads:[~2011-08-27 12:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24  9:39 [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix Magnus Damm
2011-08-24 20:43 ` Rafael J. Wysocki
2011-08-26  4:47 ` [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2 Magnus Damm
2011-08-26 20:47 ` Rafael J. Wysocki
2011-08-27 12:04 ` [PATCH] ARM: mach-shmobile: sh7372 LCDC1 suspend fix V2 (incremental) Magnus Damm
2011-08-27 12:27 ` Rafael J. Wysocki

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.