aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-18 16:50:34 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-18 16:50:34 -0400
commita208f37a465e222218974ab20a31b42b7b4893b2 (patch)
tree77c6acdd4be32024330a14f2618b814126ce7a20 /kernel/irq/manage.c
parent511d9d34183662aada3890883e860b151d707e22 (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'linus' into x86/x2apic
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 628b5572a7c..909b2231fa9 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -17,6 +17,8 @@
17 17
18#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
19 19
20cpumask_t irq_default_affinity = CPU_MASK_ALL;
21
20/** 22/**
21 * synchronize_irq - wait for pending IRQ handlers (on other CPUs) 23 * synchronize_irq - wait for pending IRQ handlers (on other CPUs)
22 * @irq: interrupt number to wait for 24 * @irq: interrupt number to wait for
@@ -102,6 +104,27 @@ int irq_set_affinity(unsigned int irq, cpumask_t cpumask)
102 return 0; 104 return 0;
103} 105}
104 106
107#ifndef CONFIG_AUTO_IRQ_AFFINITY
108/*
109 * Generic version of the affinity autoselector.
110 */
111int irq_select_affinity(unsigned int irq)
112{
113 cpumask_t mask;
114
115 if (!irq_can_set_affinity(irq))
116 return 0;
117
118 cpus_and(mask, cpu_online_map, irq_default_affinity);
119
120 irq_desc[irq].affinity = mask;
121 irq_desc[irq].chip->set_affinity(irq, mask);
122
123 set_balance_irq_affinity(irq, mask);
124 return 0;
125}
126#endif
127
105#endif 128#endif
106 129
107/** 130/**
@@ -361,7 +384,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
361 384
362 /* Setup the type (level, edge polarity) if configured: */ 385 /* Setup the type (level, edge polarity) if configured: */
363 if (new->flags & IRQF_TRIGGER_MASK) { 386 if (new->flags & IRQF_TRIGGER_MASK) {
364 if (desc->chip && desc->chip->set_type) 387 if (desc->chip->set_type)
365 desc->chip->set_type(irq, 388 desc->chip->set_type(irq,
366 new->flags & IRQF_TRIGGER_MASK); 389 new->flags & IRQF_TRIGGER_MASK);
367 else 390 else
@@ -371,8 +394,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
371 */ 394 */
372 printk(KERN_WARNING "No IRQF_TRIGGER set_type " 395 printk(KERN_WARNING "No IRQF_TRIGGER set_type "
373 "function for IRQ %d (%s)\n", irq, 396 "function for IRQ %d (%s)\n", irq,
374 desc->chip ? desc->chip->name : 397 desc->chip->name);
375 "unknown");
376 } else 398 } else
377 compat_irq_chip_set_default_handler(desc); 399 compat_irq_chip_set_default_handler(desc);
378 400
@@ -389,6 +411,9 @@ int setup_irq(unsigned int irq, struct irqaction *new)
389 } else 411 } else
390 /* Undo nested disables: */ 412 /* Undo nested disables: */
391 desc->depth = 1; 413 desc->depth = 1;
414
415 /* Set default affinity mask once everything is setup */
416 irq_select_affinity(irq);
392 } 417 }
393 /* Reset broken irq detection when installing new handler */ 418 /* Reset broken irq detection when installing new handler */
394 desc->irq_count = 0; 419 desc->irq_count = 0;
@@ -578,8 +603,6 @@ int request_irq(unsigned int irq, irq_handler_t handler,
578 action->next = NULL; 603 action->next = NULL;
579 action->dev_id = dev_id; 604 action->dev_id = dev_id;
580 605
581 select_smp_affinity(irq);
582
583#ifdef CONFIG_DEBUG_SHIRQ 606#ifdef CONFIG_DEBUG_SHIRQ
584 if (irqflags & IRQF_SHARED) { 607 if (irqflags & IRQF_SHARED) {
585 /* 608 /*