linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: OMAP3: Fix imprecise external abort for off mode on 36xx
Date: Mon, 11 Apr 2016 17:01:51 -0700	[thread overview]
Message-ID: <20160412000151.GK5995@atomide.com> (raw)
In-Reply-To: <570C3040.3030001@ti.com>

* Dave Gerlach <d-gerlach@ti.com> [160411 16:17]:
> On 04/11/2016 04:13 PM, Tony Lindgren wrote:
> >> We still need the call to omap3_intc_resume_idle because the intc restore
> >> context only gets called on resume from off mode. Perhaps we only need to
> >> call omap3_intc_resume_idle when coming back from non-off modes, otherwise
> >> let the context restore handle the reconfig of the INTC idle/sysconfig
> >> registers?
> > 
> > OK. Did you actually test by commenting out omap3_intc_resume_idle()?
> > 
> > Yeah sounds like we can optimize out the restore there for non-off
> > modes.
> 
> Yes I removed it entirely for testing, and I also tried something like this for
> a possible workable solution (without your patch applied):
> 
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index fcf975eb5e9d..8d39b44ba3a3 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -268,7 +268,6 @@ void omap_sram_idle(void)
>         int per_next_state = PWRDM_POWER_ON;
>         int core_next_state = PWRDM_POWER_ON;
>         int per_going_off;
> -       int core_prev_state;
>         u32 sdrc_pwr = 0;
> 
>         mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
> @@ -348,17 +347,16 @@ void omap_sram_idle(void)
>                 sdrc_write_reg(sdrc_pwr, SDRC_POWER);
> 
>         /* CORE */
> -       if (core_next_state < PWRDM_POWER_ON) {
> -               core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm);
> -               if (core_prev_state == PWRDM_POWER_OFF) {
> +       if (core_next_state < PWRDM_POWER_ON &&
> +           pwrdm_read_prev_pwrst(core_pwrdm) == PWRDM_POWER_OFF) {
>                         omap3_core_restore_context();
>                         omap3_cm_restore_context();
>                         omap3_push_sram_idle();
>                         omap3_push_sram_secure_idle();
>                         omap2_sms_restore_context();
> -               }
> -       }
> -       omap3_intc_resume_idle();
> +       } else
> +               omap3_intc_resume_idle();
> +
> 
>         pwrdm_post_transition(NULL);
> 
> 

OK yeah that works for me.

Can you post a proper patch with few minor changes:

- Add a comment to the code somewhere saying that for off mode,
  omap3_core_restore_context() also restores intc and we don't
  need to omap3_intc_resume_idle().

- Add the brackets to the one line else statement for checkpatch.

Cheers,

Tony

  reply	other threads:[~2016-04-12  0:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10 21:35 [PATCH] ARM: OMAP3: Fix imprecise external abort for off mode on 36xx Tony Lindgren
2016-04-07 20:17 ` Dave Gerlach
2016-04-07 23:16   ` Tony Lindgren
2016-04-11 18:20     ` Dave Gerlach
2016-04-11 21:13       ` Tony Lindgren
2016-04-11 23:16         ` Dave Gerlach
2016-04-12  0:01           ` Tony Lindgren [this message]
2016-04-13 15:45             ` Dave Gerlach
2016-04-13 15:50               ` Tony Lindgren

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=20160412000151.GK5995@atomide.com \
    --to=tony@atomide.com \
    --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).