[PATCH 2/3] genirq: set irq thread affinity when doing __setup_irq

From: Yong Zhang
Date: Wed Nov 04 2009 - 08:21:04 EST


setup_affinity() should be paired with irq_set_thread_affinity()
even in the setup stage of an irq. Because irq_default_affinity
could be initialized by arch code in which case affinity between
irq and thead will be inconsistent.

Signed-off-by: Yong Zhang <yong.zhang0@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
kernel/irq/manage.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 0b5e5ed..5c5c114 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -748,7 +748,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
desc->status |= IRQ_NO_BALANCING;

/* Set default affinity mask once everything is setup */
- setup_affinity(irq, desc);
+ ret = setup_affinity(irq, desc);
+ if (!ret)
+ irq_set_thread_affinity(desc);

} else if ((new->flags & IRQF_TRIGGER_MASK)
&& (new->flags & IRQF_TRIGGER_MASK)
--
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/