diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-06-11 03:33:09 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-06-11 03:33:09 -0400 |
commit | 54ff328b46e58568c4b3350c2fa3223ef862e5a4 (patch) | |
tree | 93a39c2dffa2490fd62f6441acba5538abf56b03 | |
parent | 6a1555fdde407dad23b8a119cf5feeb7c6466de9 (diff) |
sh: Tie sparseirq in to Kconfig.
Now that the dependent patches are merged, we are ready to enable
sparseirq support. This simply adds the Kconfig option, and then converts
from the _cpu to the _node allocation routines to follow the upstream
sparseirq API changes.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/Kconfig | 12 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/irq/ipr.c | 7 | ||||
-rw-r--r-- | drivers/sh/intc.c | 10 |
3 files changed, 18 insertions, 11 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index b5629cdc37a0..586cd045e2db 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -678,6 +678,18 @@ config GUSA_RB | |||
678 | LLSC, this should be more efficient than the other alternative of | 678 | LLSC, this should be more efficient than the other alternative of |
679 | disabling interrupts around the atomic sequence. | 679 | disabling interrupts around the atomic sequence. |
680 | 680 | ||
681 | config SPARSE_IRQ | ||
682 | bool "Support sparse irq numbering" | ||
683 | depends on EXPERIMENTAL | ||
684 | help | ||
685 | This enables support for sparse irqs. This is useful in general | ||
686 | as most CPUs have a fairly sparse array of IRQ vectors, which | ||
687 | the irq_desc then maps directly on to. Systems with a high | ||
688 | number of off-chip IRQs will want to treat this as | ||
689 | experimental until they have been independently verified. | ||
690 | |||
691 | If you don't know what to do here, say N. | ||
692 | |||
681 | endmenu | 693 | endmenu |
682 | 694 | ||
683 | menu "Boot options" | 695 | menu "Boot options" |
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c index 6ad40dbad881..808d99a48efb 100644 --- a/arch/sh/kernel/cpu/irq/ipr.c +++ b/arch/sh/kernel/cpu/irq/ipr.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <linux/topology.h> | ||
24 | 25 | ||
25 | static inline struct ipr_desc *get_ipr_desc(unsigned int irq) | 26 | static inline struct ipr_desc *get_ipr_desc(unsigned int irq) |
26 | { | 27 | { |
@@ -59,21 +60,17 @@ void register_ipr_controller(struct ipr_desc *desc) | |||
59 | 60 | ||
60 | for (i = 0; i < desc->nr_irqs; i++) { | 61 | for (i = 0; i < desc->nr_irqs; i++) { |
61 | struct ipr_data *p = desc->ipr_data + i; | 62 | struct ipr_data *p = desc->ipr_data + i; |
62 | #ifdef CONFIG_SPARSE_IRQ | ||
63 | struct irq_desc *irq_desc; | 63 | struct irq_desc *irq_desc; |
64 | #endif | ||
65 | 64 | ||
66 | BUG_ON(p->ipr_idx >= desc->nr_offsets); | 65 | BUG_ON(p->ipr_idx >= desc->nr_offsets); |
67 | BUG_ON(!desc->ipr_offsets[p->ipr_idx]); | 66 | BUG_ON(!desc->ipr_offsets[p->ipr_idx]); |
68 | 67 | ||
69 | #ifdef CONFIG_SPARSE_IRQ | 68 | irq_desc = irq_to_desc_alloc_node(p->irq, numa_node_id()); |
70 | irq_desc = irq_to_desc_alloc_cpu(p->irq, smp_processor_id()); | ||
71 | if (unlikely(!irq_desc)) { | 69 | if (unlikely(!irq_desc)) { |
72 | printk(KERN_INFO "can not get irq_desc for %d\n", | 70 | printk(KERN_INFO "can not get irq_desc for %d\n", |
73 | p->irq); | 71 | p->irq); |
74 | continue; | 72 | continue; |
75 | } | 73 | } |
76 | #endif | ||
77 | 74 | ||
78 | disable_irq_nosync(p->irq); | 75 | disable_irq_nosync(p->irq); |
79 | set_irq_chip_and_handler_name(p->irq, &desc->chip, | 76 | set_irq_chip_and_handler_name(p->irq, &desc->chip, |
diff --git a/drivers/sh/intc.c b/drivers/sh/intc.c index caf065694042..d687a9b93d03 100644 --- a/drivers/sh/intc.c +++ b/drivers/sh/intc.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/sh_intc.h> | 24 | #include <linux/sh_intc.h> |
25 | #include <linux/sysdev.h> | 25 | #include <linux/sysdev.h> |
26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
27 | #include <linux/topology.h> | ||
27 | 28 | ||
28 | #define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \ | 29 | #define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \ |
29 | ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \ | 30 | ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \ |
@@ -671,7 +672,7 @@ unsigned int intc_evt2irq(unsigned int vector) | |||
671 | 672 | ||
672 | void __init register_intc_controller(struct intc_desc *desc) | 673 | void __init register_intc_controller(struct intc_desc *desc) |
673 | { | 674 | { |
674 | unsigned int i, k, smp, cpu = smp_processor_id(); | 675 | unsigned int i, k, smp; |
675 | struct intc_desc_int *d; | 676 | struct intc_desc_int *d; |
676 | 677 | ||
677 | d = alloc_bootmem(sizeof(*d)); | 678 | d = alloc_bootmem(sizeof(*d)); |
@@ -771,19 +772,16 @@ void __init register_intc_controller(struct intc_desc *desc) | |||
771 | for (i = 0; i < desc->nr_vectors; i++) { | 772 | for (i = 0; i < desc->nr_vectors; i++) { |
772 | struct intc_vect *vect = desc->vectors + i; | 773 | struct intc_vect *vect = desc->vectors + i; |
773 | unsigned int irq = evt2irq(vect->vect); | 774 | unsigned int irq = evt2irq(vect->vect); |
774 | #ifdef CONFIG_SPARSE_IRQ | ||
775 | struct irq_desc *irq_desc; | 775 | struct irq_desc *irq_desc; |
776 | #endif | 776 | |
777 | if (!vect->enum_id) | 777 | if (!vect->enum_id) |
778 | continue; | 778 | continue; |
779 | 779 | ||
780 | #ifdef CONFIG_SPARSE_IRQ | 780 | irq_desc = irq_to_desc_alloc_node(irq, numa_node_id()); |
781 | irq_desc = irq_to_desc_alloc_cpu(irq, cpu); | ||
782 | if (unlikely(!irq_desc)) { | 781 | if (unlikely(!irq_desc)) { |
783 | printk(KERN_INFO "can not get irq_desc for %d\n", irq); | 782 | printk(KERN_INFO "can not get irq_desc for %d\n", irq); |
784 | continue; | 783 | continue; |
785 | } | 784 | } |
786 | #endif | ||
787 | 785 | ||
788 | intc_register_irq(desc, d, vect->enum_id, irq); | 786 | intc_register_irq(desc, d, vect->enum_id, irq); |
789 | } | 787 | } |