linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ccross@android.com (Colin Cross)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 2/3] ARM: gic: Use cpu pm notifiers to save gic state
Date: Thu, 17 Feb 2011 16:58:09 -0800	[thread overview]
Message-ID: <AANLkTik3O_keaFh25kd_Pr7dkiSAG5rg3-ZGZ7wAVN6S@mail.gmail.com> (raw)
In-Reply-To: <1297373487-23902-3-git-send-email-ccross@android.com>

On Thu, Feb 10, 2011 at 1:31 PM, Colin Cross <ccross@android.com> wrote:

<snip>

> +#ifdef CONFIG_PM
> + ? ? ? u32 saved_spi_enable[DIV_ROUND_UP(1020, 32)];
> + ? ? ? u32 saved_spi_conf[DIV_ROUND_UP(1020, 16)];
> + ? ? ? u32 saved_spi_pri[DIV_ROUND_UP(1020, 4)];
> + ? ? ? u32 saved_spi_target[DIV_ROUND_UP(1020, 4)];
> + ? ? ? u32 __percpu *saved_ppi_enable;
> + ? ? ? u32 __percpu *saved_ppi_conf;
> + ? ? ? u32 __percpu *saved_ppi_pri;
> +#endif
The #ifdef CONFIG_PM breaks building !CONFIG_PM, and this should
depend on CONFIG_CPU_IDLE, not CONFIG_PM.

> +static void gic_cpu_save(unsigned int gic_nr)
> +{
> + ? ? ? int i;
> + ? ? ? u32 *ptr;
> + ? ? ? void __iomem *dist_base;
> + ? ? ? void __iomem *cpu_base;
> +
> + ? ? ? if (gic_nr >= MAX_GIC_NR)
> + ? ? ? ? ? ? ? BUG();
> +
> + ? ? ? dist_base = gic_data[gic_nr].dist_base;
> + ? ? ? cpu_base = gic_data[gic_nr].cpu_base;
> +
> + ? ? ? if (!dist_base || !cpu_base)
> + ? ? ? ? ? ? ? return;
> +
> + ? ? ? ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
> + ? ? ? for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
> + ? ? ? ? ? ? ? ptr[i] = readl(dist_base + GIC_DIST_ENABLE_SET + i * 4);
> +
> + ? ? ? ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
> + ? ? ? for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
> + ? ? ? ? ? ? ? ptr[i] = readl(dist_base + GIC_DIST_CONFIG + i * 4);
> +
> + ? ? ? ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_pri);
> + ? ? ? for (i = 0; i < DIV_ROUND_UP(32, 4); i++)
> + ? ? ? ? ? ? ? ptr[i] = readl(dist_base + GIC_DIST_PRI + i * 4);
> +
> + ? ? ? writel(0, cpu_base + GIC_CPU_CTRL);
> +}
Disabling the GIC cpu interface here prevents SGIs from waking the CPU
from WFI.  On Tegra2, it is useful to be able to go to WFI, and then
either back to normal or into reset depending on the state of the
other CPU.  Is it safe to leave the GIC CPU control on when going to
reset?

  reply	other threads:[~2011-02-18  0:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10 21:31 [RFC PATCH 0/3] CPU PM notifiers Colin Cross
2011-02-10 21:31 ` [RFC PATCH 1/3] ARM: Add cpu power management notifiers Colin Cross
2011-02-12 14:46   ` Russell King - ARM Linux
2011-02-10 21:31 ` [RFC PATCH 2/3] ARM: gic: Use cpu pm notifiers to save gic state Colin Cross
2011-02-18  0:58   ` Colin Cross [this message]
2011-02-10 21:31 ` [RFC PATCH 3/3] ARM: vfp: Use cpu pm notifiers to save vfp state Colin Cross
2011-02-11 12:12   ` Catalin Marinas
2011-02-11 12:24     ` Russell King - ARM Linux
2011-02-11 12:55       ` Catalin Marinas
2011-02-11 19:50     ` Colin Cross
2011-02-13 21:25       ` Colin Cross
2011-02-12 10:23 ` [RFC PATCH 0/3] CPU PM notifiers Santosh Shilimkar

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=AANLkTik3O_keaFh25kd_Pr7dkiSAG5rg3-ZGZ7wAVN6S@mail.gmail.com \
    --to=ccross@android.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).