linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH/RFC] ARM: shmobile: sh7372: Keep D4 pm domain powered
Date: Mon, 27 Oct 2014 01:08:47 +0000	[thread overview]
Message-ID: <20141027010846.GC30485@verge.net.au> (raw)
In-Reply-To: <1414063874-9533-1-git-send-email-geert+renesas@glider.be>

On Thu, Oct 23, 2014 at 01:31:14PM +0200, Geert Uytterhoeven wrote:
> 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.

I have hardware in the form of a Mackerel board and I'm happy
to test this if it would help and you give me some guidance on how to do so.

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

  reply	other threads:[~2014-10-27  1:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 11:31 [PATCH/RFC] ARM: shmobile: sh7372: Keep D4 pm domain powered Geert Uytterhoeven
2014-10-27  1:08 ` Simon Horman [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141027010846.GC30485@verge.net.au \
    --to=horms@verge.net.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).