From: chao.xie@marvell.com (Chao Xie)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: gic: add irq_set_affinity to gic_arch_extn
Date: Tue, 26 Feb 2013 21:54:59 -0500 [thread overview]
Message-ID: <1361933699-25779-1-git-send-email-chao.xie@marvell.com> (raw)
gic_arch_extn is used for ARCH specific interrupt controller.
It has added the callbacks for irq_mask/irq_unamsk and so, but
irq_set_affinity is not used.
For SMP architecure, when both cores are powered off, the GIC may
be powered off too. An external interrupt controller can be used
as a logic to detect the interrupt and acknowledge power managment
unitto wake up core.
Because the irqs may be bound to different cors, when set irq
affinity, the external interrupt controller should be set too. Then
it can acknowledge the power managment unit to wake up correct core.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
---
arch/arm/common/gic.c | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 36ae03a..49920a0 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -82,12 +82,15 @@ static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
* Default make them NULL.
*/
struct irq_chip gic_arch_extn = {
- .irq_eoi = NULL,
- .irq_mask = NULL,
- .irq_unmask = NULL,
- .irq_retrigger = NULL,
- .irq_set_type = NULL,
- .irq_set_wake = NULL,
+ .irq_eoi = NULL,
+ .irq_mask = NULL,
+ .irq_unmask = NULL,
+ .irq_retrigger = NULL,
+ .irq_set_type = NULL,
+#ifdef CONFIG_SMP
+ .irq_set_affinity = NULL,
+#endif
+ .irq_set_wake = NULL,
};
#ifndef MAX_GIC_NR
@@ -245,6 +248,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
unsigned int shift = (gic_irq(d) % 4) * 8;
unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
u32 val, mask, bit;
+ int ret = IRQ_SET_MASK_OK;
if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
return -EINVAL;
@@ -253,11 +257,16 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
bit = gic_cpu_map[cpu] << shift;
raw_spin_lock(&irq_controller_lock);
- val = readl_relaxed(reg) & ~mask;
- writel_relaxed(val | bit, reg);
+ if (gic_arch_extn.irq_set_affinity)
+ ret = gic_arch_extn.irq_set_affinity(d, mask_val, force);
+
+ if (ret == IRQ_SET_MASK_OK) {
+ val = readl_relaxed(reg) & ~mask;
+ writel_relaxed(val | bit, reg);
+ }
raw_spin_unlock(&irq_controller_lock);
- return IRQ_SET_MASK_OK;
+ return ret;
}
#endif
--
1.7.4.1
next reply other threads:[~2013-02-27 2:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 2:54 Chao Xie [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-01-29 5:17 [PATCH] ARM: gic: add irq_set_affinity to gic_arch_extn Chao Xie
2013-01-29 8:18 ` Chao Xie
2012-06-13 8:33 Chao Xie
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=1361933699-25779-1-git-send-email-chao.xie@marvell.com \
--to=chao.xie@marvell.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).