From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: GIC: add gic_reinit() function to help ARM resume
Date: Tue, 30 Aug 2011 10:00:35 -0500 [thread overview]
Message-ID: <4E5CFB13.8060008@gmail.com> (raw)
In-Reply-To: <1314690017-17590-3-git-send-email-shawn.guo@linaro.org>
Shawn,
On 08/30/2011 02:40 AM, Shawn Guo wrote:
> If ARM core gets powered off during suspend, GIC controller has to be
> reinitialized by resume procedure. This patch adds a helper function
> for resume procedure to reinitialize GIC.
Is re-initializing rather than save/restore registers the right thing to
do here? Won't you lose things like edge or level triggered settings?
It's always been fuzzy to what should be done with interrupt masks in
suspend. Is every driver expected to disable and re-enable their
interrupts or this should be maintained thru a suspend cycle?
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> arch/arm/common/gic.c | 15 +++++++++++++--
> arch/arm/include/asm/hardware/gic.h | 1 +
> 2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
> index 666b278..bf0f6d8 100644
> --- a/arch/arm/common/gic.c
> +++ b/arch/arm/common/gic.c
> @@ -255,7 +255,7 @@ void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
> irq_set_chained_handler(irq, gic_handle_cascade_irq);
> }
>
> -static void __init gic_dist_init(struct gic_chip_data *gic,
> +static void gic_dist_init(struct gic_chip_data *gic,
> unsigned int irq_start)
> {
> unsigned int gic_irqs, irq_limit, i;
> @@ -326,7 +326,7 @@ static void __init gic_dist_init(struct gic_chip_data *gic,
> writel_relaxed(1, base + GIC_DIST_CTRL);
> }
>
> -static void __cpuinit gic_cpu_init(struct gic_chip_data *gic)
> +static void gic_cpu_init(struct gic_chip_data *gic)
I don't think you need to change this. With hotplug, this section will
be kept.
Rob
> {
> void __iomem *dist_base = gic->dist_base;
> void __iomem *base = gic->cpu_base;
> @@ -349,6 +349,17 @@ static void __cpuinit gic_cpu_init(struct gic_chip_data *gic)
> writel_relaxed(1, base + GIC_CPU_CTRL);
> }
>
> +void gic_reinit(unsigned int gic_nr, unsigned int irq_start)
> +{
> + struct gic_chip_data *gic;
> +
> + BUG_ON(gic_nr >= MAX_GIC_NR);
> +
> + gic = &gic_data[gic_nr];
> + gic_dist_init(gic, irq_start);
> + gic_cpu_init(gic);
> +}
> +
> void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
> void __iomem *dist_base, void __iomem *cpu_base)
> {
> diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
> index 435d3f8..9338326 100644
> --- a/arch/arm/include/asm/hardware/gic.h
> +++ b/arch/arm/include/asm/hardware/gic.h
> @@ -37,6 +37,7 @@ extern void __iomem *gic_cpu_base_addr;
> extern struct irq_chip gic_arch_extn;
>
> void gic_init(unsigned int, unsigned int, void __iomem *, void __iomem *);
> +void gic_reinit(unsigned int gic_nr, unsigned int irq_start);
> void gic_secondary_init(unsigned int);
> void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
> void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
next prev parent reply other threads:[~2011-08-30 15:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-30 7:40 [PATCH 0/3] make reinitialization of ARM core components possible Shawn Guo
2011-08-30 7:40 ` [PATCH 1/3] ARM: cache-l2x0: make the reinitialization possible Shawn Guo
2011-08-30 14:08 ` Barry Song
2011-08-30 14:52 ` Shawn Guo
2011-08-30 23:11 ` Barry Song
2011-08-30 23:48 ` Barry Song
2011-08-30 7:40 ` [PATCH 2/3] ARM: GIC: add gic_reinit() function to help ARM resume Shawn Guo
2011-08-30 15:00 ` Rob Herring [this message]
2011-08-30 15:47 ` Shawn Guo
2011-08-31 3:32 ` Shawn Guo
2011-08-30 7:40 ` [PATCH 3/3] ARM: smp_scu: remove __init annotation from scu_enable() Shawn Guo
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=4E5CFB13.8060008@gmail.com \
--to=robherring2@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.