summaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-08 17:11:03 +0100
committerThomas Gleixner <tglx@linutronix.de>2011-02-19 12:58:20 +0100
commita005677b3dd05decdd8880cf3044ae709856f58f (patch)
tree529d1454940fe8c6723bd54f01e009d9be2ab840 /kernel/irq/manage.c
parent1ce6068dac1924f7095be5850481e790cbf1b3c1 (diff)
downloadop-kernel-dev-a005677b3dd05decdd8880cf3044ae709856f58f.zip
op-kernel-dev-a005677b3dd05decdd8880cf3044ae709856f58f.tar.gz
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 f1cfa27..84a0a9c 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -73,8 +73,8 @@ int irq_can_set_affinity(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
- if ((desc->status & (IRQ_PER_CPU | IRQ_NO_BALANCING)) ||
- !desc->irq_data.chip || !desc->irq_data.chip->irq_set_affinity)
+ if (!irqd_can_balance(&desc->irq_data) || !desc->irq_data.chip ||
+ !desc->irq_data.chip->irq_set_affinity)
return 0;
return 1;
@@ -897,8 +897,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
IRQS_INPROGRESS | IRQS_ONESHOT | \
IRQS_WAITING);
- if (new->flags & IRQF_PERCPU)
- desc->status |= IRQ_PER_CPU;
+ if (new->flags & IRQF_PERCPU) {
+ irqd_set(&desc->irq_data, IRQD_PER_CPU);
+ irq_settings_set_per_cpu(desc);
+ }
if (new->flags & IRQF_ONESHOT)
desc->istate |= IRQS_ONESHOT;
@@ -910,8 +912,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
desc->depth = 1;
/* Exclude IRQ from balancing if requested */
- if (new->flags & IRQF_NOBALANCING)
- desc->status |= IRQ_NO_BALANCING;
+ if (new->flags & IRQF_NOBALANCING) {
+ irq_settings_set_no_balancing(desc);
+ irqd_set(&desc->irq_data, IRQD_NO_BALANCING);
+ }
/* Set default affinity mask once everything is setup */
setup_affinity(irq, desc, mask);
OpenPOWER on IntegriCloud