aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2011-05-10 15:30:36 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-19 01:31:59 -0400
commit3ee62d365b519c0c18c774049efcde84fe51c60c (patch)
tree7229d970675b0c5dff165d8597707ebc6e5798cc /arch/powerpc
parent9553361499f9f9e8ca8c9dae2e103f651fa48217 (diff)
powerpc: Add virq_is_host to reduce virq_to_host usage
Some irq_host implementations are using virq_to_host to check if they are the irq_host for a virtual irq. To allow us to make space versus time tradeoffs, replace this usage with an assertive virq_is_host that confirms or denies the irq is associated with the given irq_host. Signed-off-by: Milton Miller <miltonm@bga.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/irq.h1
-rw-r--r--arch/powerpc/kernel/irq.c6
-rw-r--r--arch/powerpc/sysdev/xics/xics-common.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index 6f4a3efb59a9..a65d1702643b 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -128,6 +128,7 @@ struct irq_host {
128struct irq_data; 128struct irq_data;
129extern irq_hw_number_t irqd_to_hwirq(struct irq_data *d); 129extern irq_hw_number_t irqd_to_hwirq(struct irq_data *d);
130extern irq_hw_number_t virq_to_hw(unsigned int virq); 130extern irq_hw_number_t virq_to_hw(unsigned int virq);
131extern bool virq_is_host(unsigned int virq, struct irq_host *host);
131extern struct irq_host *virq_to_host(unsigned int virq); 132extern struct irq_host *virq_to_host(unsigned int virq);
132 133
133/** 134/**
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 0715a09a4101..73cf29078fef 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -510,6 +510,12 @@ irq_hw_number_t virq_to_hw(unsigned int virq)
510} 510}
511EXPORT_SYMBOL_GPL(virq_to_hw); 511EXPORT_SYMBOL_GPL(virq_to_hw);
512 512
513bool virq_is_host(unsigned int virq, struct irq_host *host)
514{
515 return irq_map[virq].host == host;
516}
517EXPORT_SYMBOL_GPL(virq_is_host);
518
513struct irq_host *virq_to_host(unsigned int virq) 519struct irq_host *virq_to_host(unsigned int virq)
514{ 520{
515 return irq_map[virq].host; 521 return irq_map[virq].host;
diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c
index 43b2a791e204..445c5a01b766 100644
--- a/arch/powerpc/sysdev/xics/xics-common.c
+++ b/arch/powerpc/sysdev/xics/xics-common.c
@@ -213,7 +213,7 @@ void xics_migrate_irqs_away(void)
213 /* We can't set affinity on ISA interrupts */ 213 /* We can't set affinity on ISA interrupts */
214 if (virq < NUM_ISA_INTERRUPTS) 214 if (virq < NUM_ISA_INTERRUPTS)
215 continue; 215 continue;
216 if (virq_to_host(virq) != xics_host) 216 if (!virq_is_host(virq, xics_host))
217 continue; 217 continue;
218 irq = (unsigned int)virq_to_hw(virq); 218 irq = (unsigned int)virq_to_hw(virq);
219 /* We need to get IPIs still. */ 219 /* We need to get IPIs still. */