aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-08 11:11:03 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-19 06:58:20 -0500
commita005677b3dd05decdd8880cf3044ae709856f58f (patch)
tree529d1454940fe8c6723bd54f01e009d9be2ab840 /kernel/irq/manage.c
parent1ce6068dac1924f7095be5850481e790cbf1b3c1 (diff)
genirq: Mirror IRQ_PER_CPU and IRQ_NO_BALANCING in irq_data.state
That's the right data structure to look at for arch code. Accessor functions are provided. irqd_is_per_cpu(irqdata); irqd_can_balance(irqdata); Coders who access them directly will be tracked down and slapped with stinking trouts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index f1cfa271ba70..84a0a9c22226 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -73,8 +73,8 @@ int irq_can_set_affinity(unsigned int irq)
73{ 73{
74 struct irq_desc *desc = irq_to_desc(irq); 74 struct irq_desc *desc = irq_to_desc(irq);
75 75
76 if ((desc->status & (IRQ_PER_CPU | IRQ_NO_BALANCING)) || 76 if (!irqd_can_balance(&desc->irq_data) || !desc->irq_data.chip ||
77 !desc->irq_data.chip || !desc->irq_data.chip->irq_set_affinity) 77 !desc->irq_data.chip->irq_set_affinity)
78 return 0; 78 return 0;
79 79
80 return 1; 80 return 1;
@@ -897,8 +897,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
897 IRQS_INPROGRESS | IRQS_ONESHOT | \ 897 IRQS_INPROGRESS | IRQS_ONESHOT | \
898 IRQS_WAITING); 898 IRQS_WAITING);
899 899
900 if (new->flags & IRQF_PERCPU) 900 if (new->flags & IRQF_PERCPU) {
901 desc->status |= IRQ_PER_CPU; 901 irqd_set(&desc->irq_data, IRQD_PER_CPU);
902 irq_settings_set_per_cpu(desc);
903 }
902 904
903 if (new->flags & IRQF_ONESHOT) 905 if (new->flags & IRQF_ONESHOT)
904 desc->istate |= IRQS_ONESHOT; 906 desc->istate |= IRQS_ONESHOT;
@@ -910,8 +912,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
910 desc->depth = 1; 912 desc->depth = 1;
911 913
912 /* Exclude IRQ from balancing if requested */ 914 /* Exclude IRQ from balancing if requested */
913 if (new->flags & IRQF_NOBALANCING) 915 if (new->flags & IRQF_NOBALANCING) {
914 desc->status |= IRQ_NO_BALANCING; 916 irq_settings_set_no_balancing(desc);
917 irqd_set(&desc->irq_data, IRQD_NO_BALANCING);
918 }
915 919
916 /* Set default affinity mask once everything is setup */ 920 /* Set default affinity mask once everything is setup */
917 setup_affinity(irq, desc, mask); 921 setup_affinity(irq, desc, mask);