diff options
author | Ivan Kokshaysky <ink@jurassic.park.msu.ru> | 2006-01-06 03:12:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:40 -0500 |
commit | eee45269b0f5979c70bc151c6c2f4e5f4f5ababe (patch) | |
tree | a8ed14ee532ea8dabc1010d540542eea1d620540 | |
parent | 1fa744e6e91a895750b9980d13fcfc5791a0cd91 (diff) |
[PATCH] Alpha: convert to generic irq framework (generic part)
Thanks to Christoph for doing most of the work.
This allows automatic SMP IRQ affinity assignment other than default "all
interrupts on all CPUs" which is rather expensive. This might be useful if
the hardware can be programmed to distribute interrupts among different
CPUs, like Alpha does.
Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/irq.h | 11 | ||||
-rw-r--r-- | kernel/irq/manage.c | 2 | ||||
-rw-r--r-- | kernel/irq/proc.c | 4 |
3 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index f04ba20712a2..60f8bc78a35a 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -221,6 +221,17 @@ extern void note_interrupt(unsigned int irq, irq_desc_t *desc, | |||
221 | extern int can_request_irq(unsigned int irq, unsigned long irqflags); | 221 | extern int can_request_irq(unsigned int irq, unsigned long irqflags); |
222 | 222 | ||
223 | extern void init_irq_proc(void); | 223 | extern void init_irq_proc(void); |
224 | |||
225 | #ifdef CONFIG_AUTO_IRQ_AFFINITY | ||
226 | extern int select_smp_affinity(unsigned int irq); | ||
227 | #else | ||
228 | static inline int | ||
229 | select_smp_affinity(unsigned int irq) | ||
230 | { | ||
231 | return 1; | ||
232 | } | ||
233 | #endif | ||
234 | |||
224 | #endif | 235 | #endif |
225 | 236 | ||
226 | extern hw_irq_controller no_irq_type; /* needed in every arch ? */ | 237 | extern hw_irq_controller no_irq_type; /* needed in every arch ? */ |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 81c49a4d679e..97d5559997d2 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -366,6 +366,8 @@ int request_irq(unsigned int irq, | |||
366 | action->next = NULL; | 366 | action->next = NULL; |
367 | action->dev_id = dev_id; | 367 | action->dev_id = dev_id; |
368 | 368 | ||
369 | select_smp_affinity(irq); | ||
370 | |||
369 | retval = setup_irq(irq, action); | 371 | retval = setup_irq(irq, action); |
370 | if (retval) | 372 | if (retval) |
371 | kfree(action); | 373 | kfree(action); |
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index f26e534c6585..8a64a4844cde 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c | |||
@@ -68,7 +68,9 @@ static int irq_affinity_write_proc(struct file *file, const char __user *buffer, | |||
68 | */ | 68 | */ |
69 | cpus_and(tmp, new_value, cpu_online_map); | 69 | cpus_and(tmp, new_value, cpu_online_map); |
70 | if (cpus_empty(tmp)) | 70 | if (cpus_empty(tmp)) |
71 | return -EINVAL; | 71 | /* Special case for empty set - allow the architecture |
72 | code to set default SMP affinity. */ | ||
73 | return select_smp_affinity(irq) ? -EINVAL : full_count; | ||
72 | 74 | ||
73 | proc_set_irq_affinity(irq, new_value); | 75 | proc_set_irq_affinity(irq, new_value); |
74 | 76 | ||