linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] ARM: shmobile: sh7372: Keep D4 pm domain powered
@ 2014-10-23 11:31 Geert Uytterhoeven
  2014-10-27  1:08 ` Simon Horman
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2014-10-23 11:31 UTC (permalink / raw)
  To: Simon Horman, Magnus Damm
  Cc: Rafael J. Wysocki, linux-sh, linux-pm, linux-arm-kernel,
	Geert Uytterhoeven

The D4 power domain contains the Coresight-ETM hardware block.
As long as the ARM debug/perf code doesn't use resource management with
runtime PM support, the D4 power domain must be kept powered to avoid a
crash during resume from s2ram (dbg_cpu_pm_notify() calls
reset_ctrl_regs() unconditionally, causing an undefined instruction
oops).

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Untested on real hardware, but a similar workaround is needed on r8a7740.

 arch/arm/mach-shmobile/pm-sh7372.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
index 7e5c2676c48902f1..cedffdd4b476adb4 100644
--- a/arch/arm/mach-shmobile/pm-sh7372.c
+++ b/arch/arm/mach-shmobile/pm-sh7372.c
@@ -77,6 +77,16 @@
 
 #define PM_DOMAIN_ON_OFF_LATENCY_NS	250000
 
+static int sh7372_d4_pd_suspend(void)
+{
+	/*
+	 * The D4 domain contains the Coresight-ETM hardware block and
+	 * therefore it should only be turned off if the debug module is
+	 * not in use.
+	 */
+	return -EBUSY;
+}
+
 static int sh7372_a4r_pd_suspend(void)
 {
 	sh7372_intcs_suspend();
@@ -131,6 +141,8 @@ static struct rmobile_pm_domain sh7372_pm_domains[] = {
 		.genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
 		.genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
 		.bit_shift = 3,
+		.gov = &pm_domain_always_on_gov,
+		.suspend = sh7372_d4_pd_suspend,
 	},
 	{
 		.genpd.name = "A4R",
-- 
1.9.1


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

end of thread, other threads:[~2014-10-29  0:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-23 11:31 [PATCH/RFC] ARM: shmobile: sh7372: Keep D4 pm domain powered Geert Uytterhoeven
2014-10-27  1:08 ` Simon Horman
2014-10-27  8:23   ` Geert Uytterhoeven
2014-10-28  0:16     ` Simon Horman
2014-10-28  0:44       ` Simon Horman
2014-10-28  8:15       ` Geert Uytterhoeven
2014-10-29  0:14         ` Simon Horman

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