From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Jonathan Kliegman <kliegs@chromium.org>
Cc: linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com
Subject: Re: [PATCH v2 1/3] ARM: exynos: Save combiner registers on suspend
Date: Fri, 03 Aug 2012 23:27:12 +0200 [thread overview]
Message-ID: <501C4230.9080306@gmail.com> (raw)
In-Reply-To: <1344024333-27159-1-git-send-email-kliegs@chromium.org>
Hi Jonathan,
On 08/03/2012 10:05 PM, Jonathan Kliegman wrote:
> The interupt combiner registers need to be saved on suspend and restored
> on resume or combiner-based intterupts won't work after resume.
intterupts -> interrupts
> Signed-off-by: Jonathan Kliegman<kliegs@chromium.org>
> ---
> arch/arm/mach-exynos/common.c | 74 +++++++++++++++++++++++++++++++++++++----
> 1 files changed, 67 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
> index 4eb39cd..af296e5 100644
> --- a/arch/arm/mach-exynos/common.c
> +++ b/arch/arm/mach-exynos/common.c
> @@ -22,6 +22,7 @@
> #include<linux/export.h>
> #include<linux/irqdomain.h>
> #include<linux/of_address.h>
> +#include<linux/cpu_pm.h>
>
> #include<asm/proc-fns.h>
> #include<asm/exception.h>
> @@ -405,10 +406,14 @@ struct combiner_chip_data {
> unsigned int irq_offset;
> unsigned int irq_mask;
> void __iomem *base;
> +#ifdef CONFIG_CPU_PM
> + bool saved_on;
> +#endif
> };
>
> static struct irq_domain *combiner_irq_domain;
> static struct combiner_chip_data combiner_data[MAX_COMBINER_NR];
> +static unsigned int rt_max_combiner_nr;
>
> static inline void __iomem *combiner_base(struct irq_data *data)
> {
> @@ -535,6 +540,55 @@ static int combiner_irq_domain_map(struct irq_domain *d, unsigned int irq,
> return 0;
> }
>
> +#ifdef CONFIG_CPU_PM
> +static void combiner_save(void)
> +{
> + int i;
> +
> + for (i = 0; i< rt_max_combiner_nr; i++) {
> + if (combiner_data[i].irq_mask&
> + __raw_readl(combiner_data[i].base + COMBINER_ENABLE_SET)) {
> + combiner_data[i].saved_on = true;
> + } else {
> + combiner_data[i].saved_on = false;
> + }
> + }
> +}
> +
> +static void combiner_restore(void)
> +{
> + int i;
> +
> + for (i = 0; i< rt_max_combiner_nr; i++) {
> + if (!combiner_data[i].saved_on)
> + continue;
> +
> + __raw_writel(combiner_data[i].irq_mask,
> + combiner_data[i].base + COMBINER_ENABLE_SET);
> + }
> +}
> +
> +
> +static int combiner_notifier(struct notifier_block *self, unsigned long cmd,
> + void *v)
> +{
> + switch (cmd) {
> + case CPU_CLUSTER_PM_ENTER:
> + combiner_save();
> + break;
> + case CPU_CLSUTER_PM_EXIT:
Looks like this part of code wasn't compiled or some last minute changes
introduced this typo ?
> + combiner_restore();
> + break;
> + }
> +
> + return NOTIFY_OK;
> +}
> +
> +static struct notifier_block combiner_notifier_block = {
> + .notifier_call = combiner_notifier,
> +};
> +#endif
> +
> static struct irq_domain_ops combiner_irq_domain_ops = {
> .xlate = combiner_irq_domain_xlate,
> .map = combiner_irq_domain_map,
> @@ -544,20 +598,21 @@ static void __init combiner_init(void __iomem *combiner_base,
> struct device_node *np)
> {
> int i, irq, irq_base;
> - unsigned int max_nr, nr_irq;
> + unsigned int nr_irq;
>
> if (np) {
> - if (of_property_read_u32(np, "samsung,combiner-nr",&max_nr)) {
> + if (of_property_read_u32(np, "samsung,combiner-nr",
> + &rt_max_combiner_nr)) {
> pr_warning("%s: number of combiners not specified, "
> "setting default as %d.\n",
> __func__, EXYNOS4_MAX_COMBINER_NR);
> - max_nr = EXYNOS4_MAX_COMBINER_NR;
> + rt_max_combiner_nr = EXYNOS4_MAX_COMBINER_NR;
> }
> } else {
> - max_nr = soc_is_exynos5250() ? EXYNOS5_MAX_COMBINER_NR :
> - EXYNOS4_MAX_COMBINER_NR;
> + rt_max_combiner_nr = soc_is_exynos5250() ?
> + EXYNOS5_MAX_COMBINER_NR : EXYNOS4_MAX_COMBINER_NR;
> }
> - nr_irq = max_nr * MAX_IRQ_IN_COMBINER;
> + nr_irq = rt_max_combiner_nr * MAX_IRQ_IN_COMBINER;
>
> irq_base = irq_alloc_descs(COMBINER_IRQ(0, 0), 1, nr_irq, 0);
> if (IS_ERR_VALUE(irq_base)) {
> @@ -572,7 +627,7 @@ static void __init combiner_init(void __iomem *combiner_base,
> return;
> }
>
> - for (i = 0; i< max_nr; i++) {
> + for (i = 0; i< rt_max_combiner_nr; i++) {
> combiner_init_one(i, combiner_base + (i>> 2) * 0x10);
> irq = IRQ_SPI(i);
> #ifdef CONFIG_OF
> @@ -581,6 +636,11 @@ static void __init combiner_init(void __iomem *combiner_base,
> #endif
> combiner_cascade_irq(i, irq);
> }
> +
> +#ifdef CONFIG_PM
Shouldn't this also be CONFIG_CPU_PM ? Declaration of combiner_notifier_block
is compiled in only when CONFIG_CPU_PM is defined.
> + /* Setup suspend/resume combiner saving */
> + cpu_pm_register_notifier(&combiner_notifier_block);
> +#endif
> }
>
> #ifdef CONFIG_OF
Thanks,
Sylwester
next prev parent reply other threads:[~2012-08-03 21:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-20 18:14 [PATCH 1/3] ARM: exynos: Save combiner registers on suspend Jonathan Kliegman
2012-07-20 18:14 ` [PATCH 2/3] ARM: exynos: change local variable combiner_data to use unique name Jonathan Kliegman
2012-07-20 18:14 ` [PATCH 3/3] ARM: exynos: Size combiner_data dynamically after dt parsing Jonathan Kliegman
2012-08-01 11:38 ` [PATCH 1/3] ARM: exynos: Save combiner registers on suspend Kukjin Kim
2012-08-03 20:05 ` [PATCH v2 " Jonathan Kliegman
2012-08-03 21:27 ` Sylwester Nawrocki [this message]
2012-08-03 21:52 ` Jonathan Kliegman
2012-08-03 22:08 ` [PATCH v3 " Jonathan Kliegman
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=501C4230.9080306@gmail.com \
--to=sylvester.nawrocki@gmail.com \
--cc=kgene.kim@samsung.com \
--cc=kliegs@chromium.org \
--cc=linux-samsung-soc@vger.kernel.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.