From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: gic: Use cpu pm notifiers to save gic state
Date: Mon, 13 Jun 2011 11:41:45 +0100 [thread overview]
Message-ID: <20110613104145.GA8230@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <1307925825-28566-3-git-send-email-ccross@android.com>
Hi Colin,
On Mon, Jun 13, 2011 at 01:43:44AM +0100, Colin Cross wrote:
> When the cpu is powered down in a low power mode, the gic cpu
> interface may be reset, and when the cpu complex is powered
> down, the gic distributor may also be reset.
>
> This patch uses CPU_PM_ENTER and CPU_PM_EXIT notifiers to save
> and restore the gic cpu interface registers, and the
> CPU_COMPLEX_PM_ENTER and CPU_COMPLEX_PM_EXIT notifiers to save
> and restore the gic distributor registers.
>
> Signed-off-by: Colin Cross <ccross@android.com>
> ---
> arch/arm/common/gic.c | 212 +++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 212 insertions(+), 0 deletions(-)
>
[...]
> +
> +static void __init gic_cpu_pm_init(struct gic_chip_data *gic)
> +{
> + gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4,
> + sizeof(u32));
> + BUG_ON(!gic->saved_ppi_enable);
> +
> + gic->saved_ppi_conf = __alloc_percpu(DIV_ROUND_UP(32, 16) * 4,
> + sizeof(u32));
> + BUG_ON(!gic->saved_ppi_conf);
> +
> + gic->saved_ppi_pri = __alloc_percpu(DIV_ROUND_UP(32, 4) * 4,
> + sizeof(u32));
> + BUG_ON(!gic->saved_ppi_pri);
> +
> + cpu_pm_register_notifier(&gic_notifier_block);
> +}
> +#else
> +static void __init gic_cpu_pm_init(struct gic_chip_data *gic)
> +{
> +}
> +#endif
> +
> void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
> void __iomem *dist_base, void __iomem *cpu_base)
> {
> @@ -367,6 +578,7 @@ void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
>
> gic_dist_init(gic, irq_start);
> gic_cpu_init(gic);
> + gic_cpu_pm_init(gic);
> }
>
>
I have been using this patchset for a while and it works perfectly fine.
I reckon one bit we could improve is allowing to register a subsystem depending
on a flag set @init, for now it is a save "all default registered subsystems or nothing" solution on cpu_pm_enter(), maybe we could add this level of
configurability as an improvement (GIC being a good example, see OMAP).
Lorenzo
next prev parent reply other threads:[~2011-06-13 10:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-13 0:43 [PATCH 0/3] CPU PM notifiers Colin Cross
2011-06-13 0:43 ` [PATCH 1/3] ARM: Add cpu power management notifiers Colin Cross
2011-06-13 1:57 ` Rob Herring
2011-06-13 22:17 ` Kevin Hilman
2011-06-14 6:15 ` Colin Cross
2011-06-16 0:12 ` Kevin Hilman
2011-06-13 0:43 ` [PATCH 2/3] ARM: gic: Use cpu pm notifiers to save gic state Colin Cross
2011-06-13 10:41 ` Lorenzo Pieralisi [this message]
2011-06-13 0:43 ` [PATCH 3/3] ARM: vfp: Use cpu pm notifiers to save vfp state Colin Cross
2011-06-13 18:37 ` [PATCH 0/3] CPU PM notifiers Rafael J. Wysocki
2011-06-13 18:55 ` Colin Cross
2011-06-14 21:00 ` Rafael J. Wysocki
2011-06-14 21:19 ` Colin Cross
2011-06-14 21:34 ` Rafael J. Wysocki
2011-06-14 21:40 ` Colin Cross
2011-06-14 22:12 ` Rafael J. Wysocki
2011-06-15 6:54 ` Santosh Shilimkar
2011-06-15 23:13 ` Rafael J. Wysocki
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=20110613104145.GA8230@e102568-lin.cambridge.arm.com \
--to=lorenzo.pieralisi@arm.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).