diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-31 12:00:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-31 12:00:59 -0500 |
commit | db200df0b3530f673d8e9f5bd535e9e10305842a (patch) | |
tree | 9a94039b8813452c51a50fcb45e95c32a9f0e537 | |
parent | ec270e59a74eee972006a87c8e12514a20588369 (diff) | |
parent | 43a256322ac1fc105c181b3cade3b9bfc0b63ca1 (diff) |
Merge branch 'irq-fixes-for-linus-4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'irq-fixes-for-linus-4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sparseirq: move __weak symbols into separate compilation unit
sparseirq: work around __weak alias bug
sparseirq: fix hang with !SPARSE_IRQ
sparseirq: set lock_class for legacy irq when sparse_irq is selected
sparseirq: work around compiler optimizing away __weak functions
sparseirq: fix desc->lock init
sparseirq: do not printk when migrating IRQ descriptors
sparseirq: remove duplicated arch_early_irq_init()
irq: simplify for_each_irq_desc() usage
proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c
irq: for_each_irq_desc() move to irqnr.h
hrtimer: remove #include <linux/irq.h>
-rw-r--r-- | arch/x86/kernel/io_apic.c | 18 | ||||
-rw-r--r-- | drivers/xen/events.c | 3 | ||||
-rw-r--r-- | fs/proc/stat.c | 11 | ||||
-rw-r--r-- | include/linux/interrupt.h | 6 | ||||
-rw-r--r-- | include/linux/irq.h | 27 | ||||
-rw-r--r-- | include/linux/irqnr.h | 23 | ||||
-rw-r--r-- | init/main.c | 9 | ||||
-rw-r--r-- | kernel/hrtimer.c | 1 | ||||
-rw-r--r-- | kernel/irq/autoprobe.c | 15 | ||||
-rw-r--r-- | kernel/irq/handle.c | 48 | ||||
-rw-r--r-- | kernel/irq/numa_migrate.c | 7 | ||||
-rw-r--r-- | kernel/irq/spurious.c | 5 | ||||
-rw-r--r-- | kernel/softirq.c | 20 |
13 files changed, 84 insertions, 109 deletions
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index f6ea94b74da1..74917658b004 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
@@ -170,7 +170,7 @@ static struct irq_cfg irq_cfgx[NR_IRQS] = { | |||
170 | [15] = { .domain = CPU_MASK_ALL, .vector = IRQ15_VECTOR, }, | 170 | [15] = { .domain = CPU_MASK_ALL, .vector = IRQ15_VECTOR, }, |
171 | }; | 171 | }; |
172 | 172 | ||
173 | void __init arch_early_irq_init(void) | 173 | int __init arch_early_irq_init(void) |
174 | { | 174 | { |
175 | struct irq_cfg *cfg; | 175 | struct irq_cfg *cfg; |
176 | struct irq_desc *desc; | 176 | struct irq_desc *desc; |
@@ -184,6 +184,8 @@ void __init arch_early_irq_init(void) | |||
184 | desc = irq_to_desc(i); | 184 | desc = irq_to_desc(i); |
185 | desc->chip_data = &cfg[i]; | 185 | desc->chip_data = &cfg[i]; |
186 | } | 186 | } |
187 | |||
188 | return 0; | ||
187 | } | 189 | } |
188 | 190 | ||
189 | #ifdef CONFIG_SPARSE_IRQ | 191 | #ifdef CONFIG_SPARSE_IRQ |
@@ -212,7 +214,7 @@ static struct irq_cfg *get_one_free_irq_cfg(int cpu) | |||
212 | return cfg; | 214 | return cfg; |
213 | } | 215 | } |
214 | 216 | ||
215 | void arch_init_chip_data(struct irq_desc *desc, int cpu) | 217 | int arch_init_chip_data(struct irq_desc *desc, int cpu) |
216 | { | 218 | { |
217 | struct irq_cfg *cfg; | 219 | struct irq_cfg *cfg; |
218 | 220 | ||
@@ -224,6 +226,8 @@ void arch_init_chip_data(struct irq_desc *desc, int cpu) | |||
224 | BUG_ON(1); | 226 | BUG_ON(1); |
225 | } | 227 | } |
226 | } | 228 | } |
229 | |||
230 | return 0; | ||
227 | } | 231 | } |
228 | 232 | ||
229 | #ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC | 233 | #ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC |
@@ -1345,8 +1349,6 @@ void __setup_vector_irq(int cpu) | |||
1345 | 1349 | ||
1346 | /* Mark the inuse vectors */ | 1350 | /* Mark the inuse vectors */ |
1347 | for_each_irq_desc(irq, desc) { | 1351 | for_each_irq_desc(irq, desc) { |
1348 | if (!desc) | ||
1349 | continue; | ||
1350 | cfg = desc->chip_data; | 1352 | cfg = desc->chip_data; |
1351 | if (!cpu_isset(cpu, cfg->domain)) | 1353 | if (!cpu_isset(cpu, cfg->domain)) |
1352 | continue; | 1354 | continue; |
@@ -1730,8 +1732,6 @@ __apicdebuginit(void) print_IO_APIC(void) | |||
1730 | for_each_irq_desc(irq, desc) { | 1732 | for_each_irq_desc(irq, desc) { |
1731 | struct irq_pin_list *entry; | 1733 | struct irq_pin_list *entry; |
1732 | 1734 | ||
1733 | if (!desc) | ||
1734 | continue; | ||
1735 | cfg = desc->chip_data; | 1735 | cfg = desc->chip_data; |
1736 | entry = cfg->irq_2_pin; | 1736 | entry = cfg->irq_2_pin; |
1737 | if (!entry) | 1737 | if (!entry) |
@@ -2378,9 +2378,6 @@ static void ir_irq_migration(struct work_struct *work) | |||
2378 | struct irq_desc *desc; | 2378 | struct irq_desc *desc; |
2379 | 2379 | ||
2380 | for_each_irq_desc(irq, desc) { | 2380 | for_each_irq_desc(irq, desc) { |
2381 | if (!desc) | ||
2382 | continue; | ||
2383 | |||
2384 | if (desc->status & IRQ_MOVE_PENDING) { | 2381 | if (desc->status & IRQ_MOVE_PENDING) { |
2385 | unsigned long flags; | 2382 | unsigned long flags; |
2386 | 2383 | ||
@@ -2670,9 +2667,6 @@ static inline void init_IO_APIC_traps(void) | |||
2670 | * 0x80, because int 0x80 is hm, kind of importantish. ;) | 2667 | * 0x80, because int 0x80 is hm, kind of importantish. ;) |
2671 | */ | 2668 | */ |
2672 | for_each_irq_desc(irq, desc) { | 2669 | for_each_irq_desc(irq, desc) { |
2673 | if (!desc) | ||
2674 | continue; | ||
2675 | |||
2676 | cfg = desc->chip_data; | 2670 | cfg = desc->chip_data; |
2677 | if (IO_APIC_IRQ(irq) && cfg && !cfg->vector) { | 2671 | if (IO_APIC_IRQ(irq) && cfg && !cfg->vector) { |
2678 | /* | 2672 | /* |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 46625cd38743..e26733a9df21 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -142,9 +142,6 @@ static void init_evtchn_cpu_bindings(void) | |||
142 | 142 | ||
143 | /* By default all event channels notify CPU#0. */ | 143 | /* By default all event channels notify CPU#0. */ |
144 | for_each_irq_desc(i, desc) { | 144 | for_each_irq_desc(i, desc) { |
145 | if (!desc) | ||
146 | continue; | ||
147 | |||
148 | desc->affinity = cpumask_of_cpu(0); | 145 | desc->affinity = cpumask_of_cpu(0); |
149 | } | 146 | } |
150 | #endif | 147 | #endif |
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 3bb1cf1e7425..f75efa22df5e 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/seq_file.h> | 9 | #include <linux/seq_file.h> |
10 | #include <linux/slab.h> | 10 | #include <linux/slab.h> |
11 | #include <linux/time.h> | 11 | #include <linux/time.h> |
12 | #include <linux/irqnr.h> | ||
12 | #include <asm/cputime.h> | 13 | #include <asm/cputime.h> |
13 | 14 | ||
14 | #ifndef arch_irq_stat_cpu | 15 | #ifndef arch_irq_stat_cpu |
@@ -45,10 +46,6 @@ static int show_stat(struct seq_file *p, void *v) | |||
45 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); | 46 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); |
46 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); | 47 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); |
47 | for_each_irq_nr(j) { | 48 | for_each_irq_nr(j) { |
48 | #ifdef CONFIG_SPARSE_IRQ | ||
49 | if (!irq_to_desc(j)) | ||
50 | continue; | ||
51 | #endif | ||
52 | sum += kstat_irqs_cpu(j, i); | 49 | sum += kstat_irqs_cpu(j, i); |
53 | } | 50 | } |
54 | sum += arch_irq_stat_cpu(i); | 51 | sum += arch_irq_stat_cpu(i); |
@@ -95,12 +92,6 @@ static int show_stat(struct seq_file *p, void *v) | |||
95 | /* sum again ? it could be updated? */ | 92 | /* sum again ? it could be updated? */ |
96 | for_each_irq_nr(j) { | 93 | for_each_irq_nr(j) { |
97 | per_irq_sum = 0; | 94 | per_irq_sum = 0; |
98 | #ifdef CONFIG_SPARSE_IRQ | ||
99 | if (!irq_to_desc(j)) { | ||
100 | seq_printf(p, " %u", per_irq_sum); | ||
101 | continue; | ||
102 | } | ||
103 | #endif | ||
104 | for_each_possible_cpu(i) | 95 | for_each_possible_cpu(i) |
105 | per_irq_sum += kstat_irqs_cpu(j, i); | 96 | per_irq_sum += kstat_irqs_cpu(j, i); |
106 | 97 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index be3c484b5242..8cc8ef47f5b6 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -464,4 +464,10 @@ static inline void init_irq_proc(void) | |||
464 | 464 | ||
465 | int show_interrupts(struct seq_file *p, void *v); | 465 | int show_interrupts(struct seq_file *p, void *v); |
466 | 466 | ||
467 | struct irq_desc; | ||
468 | |||
469 | extern int early_irq_init(void); | ||
470 | extern int arch_early_irq_init(void); | ||
471 | extern int arch_init_chip_data(struct irq_desc *desc, int cpu); | ||
472 | |||
467 | #endif | 473 | #endif |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 98564dc64476..d64a6d49bdef 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -193,42 +193,23 @@ struct irq_desc { | |||
193 | const char *name; | 193 | const char *name; |
194 | } ____cacheline_internodealigned_in_smp; | 194 | } ____cacheline_internodealigned_in_smp; |
195 | 195 | ||
196 | extern void early_irq_init(void); | ||
197 | extern void arch_early_irq_init(void); | ||
198 | extern void arch_init_chip_data(struct irq_desc *desc, int cpu); | ||
199 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, | 196 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, |
200 | struct irq_desc *desc, int cpu); | 197 | struct irq_desc *desc, int cpu); |
201 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); | 198 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); |
202 | 199 | ||
203 | #ifndef CONFIG_SPARSE_IRQ | 200 | #ifndef CONFIG_SPARSE_IRQ |
204 | extern struct irq_desc irq_desc[NR_IRQS]; | 201 | extern struct irq_desc irq_desc[NR_IRQS]; |
205 | 202 | #else /* CONFIG_SPARSE_IRQ */ | |
206 | static inline struct irq_desc *irq_to_desc(unsigned int irq) | ||
207 | { | ||
208 | return (irq < NR_IRQS) ? irq_desc + irq : NULL; | ||
209 | } | ||
210 | static inline struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu) | ||
211 | { | ||
212 | return irq_to_desc(irq); | ||
213 | } | ||
214 | |||
215 | #else | ||
216 | |||
217 | extern struct irq_desc *irq_to_desc(unsigned int irq); | ||
218 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | ||
219 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); | 203 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); |
220 | 204 | ||
221 | # define for_each_irq_desc(irq, desc) \ | ||
222 | for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; irq++, desc = irq_to_desc(irq)) | ||
223 | # define for_each_irq_desc_reverse(irq, desc) \ | ||
224 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; irq--, desc = irq_to_desc(irq)) | ||
225 | |||
226 | #define kstat_irqs_this_cpu(DESC) \ | 205 | #define kstat_irqs_this_cpu(DESC) \ |
227 | ((DESC)->kstat_irqs[smp_processor_id()]) | 206 | ((DESC)->kstat_irqs[smp_processor_id()]) |
228 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ | 207 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ |
229 | ((DESC)->kstat_irqs[smp_processor_id()]++) | 208 | ((DESC)->kstat_irqs[smp_processor_id()]++) |
230 | 209 | ||
231 | #endif | 210 | #endif /* CONFIG_SPARSE_IRQ */ |
211 | |||
212 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | ||
232 | 213 | ||
233 | static inline struct irq_desc * | 214 | static inline struct irq_desc * |
234 | irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) | 215 | irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) |
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 95d2b74641f5..5504a5c97836 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
@@ -15,20 +15,23 @@ | |||
15 | 15 | ||
16 | # define for_each_irq_desc_reverse(irq, desc) \ | 16 | # define for_each_irq_desc_reverse(irq, desc) \ |
17 | for (irq = nr_irqs - 1; irq >= 0; irq--) | 17 | for (irq = nr_irqs - 1; irq >= 0; irq--) |
18 | #else | 18 | #else /* CONFIG_GENERIC_HARDIRQS */ |
19 | 19 | ||
20 | extern int nr_irqs; | 20 | extern int nr_irqs; |
21 | extern struct irq_desc *irq_to_desc(unsigned int irq); | ||
21 | 22 | ||
22 | #ifndef CONFIG_SPARSE_IRQ | 23 | # define for_each_irq_desc(irq, desc) \ |
24 | for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \ | ||
25 | irq++, desc = irq_to_desc(irq)) \ | ||
26 | if (desc) | ||
23 | 27 | ||
24 | struct irq_desc; | 28 | |
25 | # define for_each_irq_desc(irq, desc) \ | 29 | # define for_each_irq_desc_reverse(irq, desc) \ |
26 | for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) | 30 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \ |
27 | # define for_each_irq_desc_reverse(irq, desc) \ | 31 | irq--, desc = irq_to_desc(irq)) \ |
28 | for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ | 32 | if (desc) |
29 | irq >= 0; irq--, desc--) | 33 | |
30 | #endif | 34 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
31 | #endif | ||
32 | 35 | ||
33 | #define for_each_irq_nr(irq) \ | 36 | #define for_each_irq_nr(irq) \ |
34 | for (irq = 0; irq < nr_irqs; irq++) | 37 | for (irq = 0; irq < nr_irqs; irq++) |
diff --git a/init/main.c b/init/main.c index 2a7ce0f8e453..f5e64f20d2b0 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -540,15 +540,6 @@ void __init __weak thread_info_cache_init(void) | |||
540 | { | 540 | { |
541 | } | 541 | } |
542 | 542 | ||
543 | void __init __weak arch_early_irq_init(void) | ||
544 | { | ||
545 | } | ||
546 | |||
547 | void __init __weak early_irq_init(void) | ||
548 | { | ||
549 | arch_early_irq_init(); | ||
550 | } | ||
551 | |||
552 | asmlinkage void __init start_kernel(void) | 543 | asmlinkage void __init start_kernel(void) |
553 | { | 544 | { |
554 | char * command_line; | 545 | char * command_line; |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index bda9cb924276..eb2bfefa6dcc 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -32,7 +32,6 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <linux/cpu.h> | 34 | #include <linux/cpu.h> |
35 | #include <linux/irq.h> | ||
36 | #include <linux/module.h> | 35 | #include <linux/module.h> |
37 | #include <linux/percpu.h> | 36 | #include <linux/percpu.h> |
38 | #include <linux/hrtimer.h> | 37 | #include <linux/hrtimer.h> |
diff --git a/kernel/irq/autoprobe.c b/kernel/irq/autoprobe.c index 650ce4102a63..cc0f7321b8ce 100644 --- a/kernel/irq/autoprobe.c +++ b/kernel/irq/autoprobe.c | |||
@@ -40,9 +40,6 @@ unsigned long probe_irq_on(void) | |||
40 | * flush such a longstanding irq before considering it as spurious. | 40 | * flush such a longstanding irq before considering it as spurious. |
41 | */ | 41 | */ |
42 | for_each_irq_desc_reverse(i, desc) { | 42 | for_each_irq_desc_reverse(i, desc) { |
43 | if (!desc) | ||
44 | continue; | ||
45 | |||
46 | spin_lock_irq(&desc->lock); | 43 | spin_lock_irq(&desc->lock); |
47 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { | 44 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { |
48 | /* | 45 | /* |
@@ -71,9 +68,6 @@ unsigned long probe_irq_on(void) | |||
71 | * happened in the previous stage, it may have masked itself) | 68 | * happened in the previous stage, it may have masked itself) |
72 | */ | 69 | */ |
73 | for_each_irq_desc_reverse(i, desc) { | 70 | for_each_irq_desc_reverse(i, desc) { |
74 | if (!desc) | ||
75 | continue; | ||
76 | |||
77 | spin_lock_irq(&desc->lock); | 71 | spin_lock_irq(&desc->lock); |
78 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { | 72 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { |
79 | desc->status |= IRQ_AUTODETECT | IRQ_WAITING; | 73 | desc->status |= IRQ_AUTODETECT | IRQ_WAITING; |
@@ -92,9 +86,6 @@ unsigned long probe_irq_on(void) | |||
92 | * Now filter out any obviously spurious interrupts | 86 | * Now filter out any obviously spurious interrupts |
93 | */ | 87 | */ |
94 | for_each_irq_desc(i, desc) { | 88 | for_each_irq_desc(i, desc) { |
95 | if (!desc) | ||
96 | continue; | ||
97 | |||
98 | spin_lock_irq(&desc->lock); | 89 | spin_lock_irq(&desc->lock); |
99 | status = desc->status; | 90 | status = desc->status; |
100 | 91 | ||
@@ -133,9 +124,6 @@ unsigned int probe_irq_mask(unsigned long val) | |||
133 | int i; | 124 | int i; |
134 | 125 | ||
135 | for_each_irq_desc(i, desc) { | 126 | for_each_irq_desc(i, desc) { |
136 | if (!desc) | ||
137 | continue; | ||
138 | |||
139 | spin_lock_irq(&desc->lock); | 127 | spin_lock_irq(&desc->lock); |
140 | status = desc->status; | 128 | status = desc->status; |
141 | 129 | ||
@@ -178,9 +166,6 @@ int probe_irq_off(unsigned long val) | |||
178 | unsigned int status; | 166 | unsigned int status; |
179 | 167 | ||
180 | for_each_irq_desc(i, desc) { | 168 | for_each_irq_desc(i, desc) { |
181 | if (!desc) | ||
182 | continue; | ||
183 | |||
184 | spin_lock_irq(&desc->lock); | 169 | spin_lock_irq(&desc->lock); |
185 | status = desc->status; | 170 | status = desc->status; |
186 | 171 | ||
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index 6492400cb50d..c20db0be9173 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
@@ -56,10 +56,6 @@ void handle_bad_irq(unsigned int irq, struct irq_desc *desc) | |||
56 | int nr_irqs = NR_IRQS; | 56 | int nr_irqs = NR_IRQS; |
57 | EXPORT_SYMBOL_GPL(nr_irqs); | 57 | EXPORT_SYMBOL_GPL(nr_irqs); |
58 | 58 | ||
59 | void __init __attribute__((weak)) arch_early_irq_init(void) | ||
60 | { | ||
61 | } | ||
62 | |||
63 | #ifdef CONFIG_SPARSE_IRQ | 59 | #ifdef CONFIG_SPARSE_IRQ |
64 | static struct irq_desc irq_desc_init = { | 60 | static struct irq_desc irq_desc_init = { |
65 | .irq = -1, | 61 | .irq = -1, |
@@ -90,13 +86,11 @@ void init_kstat_irqs(struct irq_desc *desc, int cpu, int nr) | |||
90 | desc->kstat_irqs = (unsigned int *)ptr; | 86 | desc->kstat_irqs = (unsigned int *)ptr; |
91 | } | 87 | } |
92 | 88 | ||
93 | void __attribute__((weak)) arch_init_chip_data(struct irq_desc *desc, int cpu) | ||
94 | { | ||
95 | } | ||
96 | |||
97 | static void init_one_irq_desc(int irq, struct irq_desc *desc, int cpu) | 89 | static void init_one_irq_desc(int irq, struct irq_desc *desc, int cpu) |
98 | { | 90 | { |
99 | memcpy(desc, &irq_desc_init, sizeof(struct irq_desc)); | 91 | memcpy(desc, &irq_desc_init, sizeof(struct irq_desc)); |
92 | |||
93 | spin_lock_init(&desc->lock); | ||
100 | desc->irq = irq; | 94 | desc->irq = irq; |
101 | #ifdef CONFIG_SMP | 95 | #ifdef CONFIG_SMP |
102 | desc->cpu = cpu; | 96 | desc->cpu = cpu; |
@@ -134,7 +128,7 @@ static struct irq_desc irq_desc_legacy[NR_IRQS_LEGACY] __cacheline_aligned_in_sm | |||
134 | /* FIXME: use bootmem alloc ...*/ | 128 | /* FIXME: use bootmem alloc ...*/ |
135 | static unsigned int kstat_irqs_legacy[NR_IRQS_LEGACY][NR_CPUS]; | 129 | static unsigned int kstat_irqs_legacy[NR_IRQS_LEGACY][NR_CPUS]; |
136 | 130 | ||
137 | void __init early_irq_init(void) | 131 | int __init early_irq_init(void) |
138 | { | 132 | { |
139 | struct irq_desc *desc; | 133 | struct irq_desc *desc; |
140 | int legacy_count; | 134 | int legacy_count; |
@@ -146,6 +140,7 @@ void __init early_irq_init(void) | |||
146 | for (i = 0; i < legacy_count; i++) { | 140 | for (i = 0; i < legacy_count; i++) { |
147 | desc[i].irq = i; | 141 | desc[i].irq = i; |
148 | desc[i].kstat_irqs = kstat_irqs_legacy[i]; | 142 | desc[i].kstat_irqs = kstat_irqs_legacy[i]; |
143 | lockdep_set_class(&desc[i].lock, &irq_desc_lock_class); | ||
149 | 144 | ||
150 | irq_desc_ptrs[i] = desc + i; | 145 | irq_desc_ptrs[i] = desc + i; |
151 | } | 146 | } |
@@ -153,7 +148,7 @@ void __init early_irq_init(void) | |||
153 | for (i = legacy_count; i < NR_IRQS; i++) | 148 | for (i = legacy_count; i < NR_IRQS; i++) |
154 | irq_desc_ptrs[i] = NULL; | 149 | irq_desc_ptrs[i] = NULL; |
155 | 150 | ||
156 | arch_early_irq_init(); | 151 | return arch_early_irq_init(); |
157 | } | 152 | } |
158 | 153 | ||
159 | struct irq_desc *irq_to_desc(unsigned int irq) | 154 | struct irq_desc *irq_to_desc(unsigned int irq) |
@@ -203,7 +198,7 @@ out_unlock: | |||
203 | return desc; | 198 | return desc; |
204 | } | 199 | } |
205 | 200 | ||
206 | #else | 201 | #else /* !CONFIG_SPARSE_IRQ */ |
207 | 202 | ||
208 | struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { | 203 | struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { |
209 | [0 ... NR_IRQS-1] = { | 204 | [0 ... NR_IRQS-1] = { |
@@ -218,7 +213,31 @@ struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { | |||
218 | } | 213 | } |
219 | }; | 214 | }; |
220 | 215 | ||
221 | #endif | 216 | int __init early_irq_init(void) |
217 | { | ||
218 | struct irq_desc *desc; | ||
219 | int count; | ||
220 | int i; | ||
221 | |||
222 | desc = irq_desc; | ||
223 | count = ARRAY_SIZE(irq_desc); | ||
224 | |||
225 | for (i = 0; i < count; i++) | ||
226 | desc[i].irq = i; | ||
227 | |||
228 | return arch_early_irq_init(); | ||
229 | } | ||
230 | |||
231 | struct irq_desc *irq_to_desc(unsigned int irq) | ||
232 | { | ||
233 | return (irq < NR_IRQS) ? irq_desc + irq : NULL; | ||
234 | } | ||
235 | |||
236 | struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu) | ||
237 | { | ||
238 | return irq_to_desc(irq); | ||
239 | } | ||
240 | #endif /* !CONFIG_SPARSE_IRQ */ | ||
222 | 241 | ||
223 | /* | 242 | /* |
224 | * What should we do if we get a hw irq event on an illegal vector? | 243 | * What should we do if we get a hw irq event on an illegal vector? |
@@ -428,9 +447,6 @@ void early_init_irq_lock_class(void) | |||
428 | int i; | 447 | int i; |
429 | 448 | ||
430 | for_each_irq_desc(i, desc) { | 449 | for_each_irq_desc(i, desc) { |
431 | if (!desc) | ||
432 | continue; | ||
433 | |||
434 | lockdep_set_class(&desc->lock, &irq_desc_lock_class); | 450 | lockdep_set_class(&desc->lock, &irq_desc_lock_class); |
435 | } | 451 | } |
436 | } | 452 | } |
@@ -439,7 +455,7 @@ void early_init_irq_lock_class(void) | |||
439 | unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 455 | unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) |
440 | { | 456 | { |
441 | struct irq_desc *desc = irq_to_desc(irq); | 457 | struct irq_desc *desc = irq_to_desc(irq); |
442 | return desc->kstat_irqs[cpu]; | 458 | return desc ? desc->kstat_irqs[cpu] : 0; |
443 | } | 459 | } |
444 | #endif | 460 | #endif |
445 | EXPORT_SYMBOL(kstat_irqs_cpu); | 461 | EXPORT_SYMBOL(kstat_irqs_cpu); |
diff --git a/kernel/irq/numa_migrate.c b/kernel/irq/numa_migrate.c index 089c3746358a..ecf765c6a77a 100644 --- a/kernel/irq/numa_migrate.c +++ b/kernel/irq/numa_migrate.c | |||
@@ -42,6 +42,7 @@ static void init_copy_one_irq_desc(int irq, struct irq_desc *old_desc, | |||
42 | struct irq_desc *desc, int cpu) | 42 | struct irq_desc *desc, int cpu) |
43 | { | 43 | { |
44 | memcpy(desc, old_desc, sizeof(struct irq_desc)); | 44 | memcpy(desc, old_desc, sizeof(struct irq_desc)); |
45 | spin_lock_init(&desc->lock); | ||
45 | desc->cpu = cpu; | 46 | desc->cpu = cpu; |
46 | lockdep_set_class(&desc->lock, &irq_desc_lock_class); | 47 | lockdep_set_class(&desc->lock, &irq_desc_lock_class); |
47 | init_copy_kstat_irqs(old_desc, desc, cpu, nr_cpu_ids); | 48 | init_copy_kstat_irqs(old_desc, desc, cpu, nr_cpu_ids); |
@@ -74,10 +75,8 @@ static struct irq_desc *__real_move_irq_desc(struct irq_desc *old_desc, | |||
74 | 75 | ||
75 | node = cpu_to_node(cpu); | 76 | node = cpu_to_node(cpu); |
76 | desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node); | 77 | desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node); |
77 | printk(KERN_DEBUG " move irq_desc for %d to cpu %d node %d\n", | ||
78 | irq, cpu, node); | ||
79 | if (!desc) { | 78 | if (!desc) { |
80 | printk(KERN_ERR "can not get new irq_desc for moving\n"); | 79 | printk(KERN_ERR "irq %d: can not get new irq_desc for migration.\n", irq); |
81 | /* still use old one */ | 80 | /* still use old one */ |
82 | desc = old_desc; | 81 | desc = old_desc; |
83 | goto out_unlock; | 82 | goto out_unlock; |
@@ -106,8 +105,6 @@ struct irq_desc *move_irq_desc(struct irq_desc *desc, int cpu) | |||
106 | return desc; | 105 | return desc; |
107 | 106 | ||
108 | old_cpu = desc->cpu; | 107 | old_cpu = desc->cpu; |
109 | printk(KERN_DEBUG | ||
110 | "try to move irq_desc from cpu %d to %d\n", old_cpu, cpu); | ||
111 | if (old_cpu != cpu) { | 108 | if (old_cpu != cpu) { |
112 | node = cpu_to_node(cpu); | 109 | node = cpu_to_node(cpu); |
113 | old_node = cpu_to_node(old_cpu); | 110 | old_node = cpu_to_node(old_cpu); |
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c index 3738107531fd..dd364c11e56e 100644 --- a/kernel/irq/spurious.c +++ b/kernel/irq/spurious.c | |||
@@ -91,9 +91,6 @@ static int misrouted_irq(int irq) | |||
91 | int i, ok = 0; | 91 | int i, ok = 0; |
92 | 92 | ||
93 | for_each_irq_desc(i, desc) { | 93 | for_each_irq_desc(i, desc) { |
94 | if (!desc) | ||
95 | continue; | ||
96 | |||
97 | if (!i) | 94 | if (!i) |
98 | continue; | 95 | continue; |
99 | 96 | ||
@@ -115,8 +112,6 @@ static void poll_spurious_irqs(unsigned long dummy) | |||
115 | for_each_irq_desc(i, desc) { | 112 | for_each_irq_desc(i, desc) { |
116 | unsigned int status; | 113 | unsigned int status; |
117 | 114 | ||
118 | if (!desc) | ||
119 | continue; | ||
120 | if (!i) | 115 | if (!i) |
121 | continue; | 116 | continue; |
122 | 117 | ||
diff --git a/kernel/softirq.c b/kernel/softirq.c index 466e75ce271a..670c1eca47ec 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -784,3 +784,23 @@ int on_each_cpu(void (*func) (void *info), void *info, int wait) | |||
784 | } | 784 | } |
785 | EXPORT_SYMBOL(on_each_cpu); | 785 | EXPORT_SYMBOL(on_each_cpu); |
786 | #endif | 786 | #endif |
787 | |||
788 | /* | ||
789 | * [ These __weak aliases are kept in a separate compilation unit, so that | ||
790 | * GCC does not inline them incorrectly. ] | ||
791 | */ | ||
792 | |||
793 | int __init __weak early_irq_init(void) | ||
794 | { | ||
795 | return 0; | ||
796 | } | ||
797 | |||
798 | int __init __weak arch_early_irq_init(void) | ||
799 | { | ||
800 | return 0; | ||
801 | } | ||
802 | |||
803 | int __weak arch_init_chip_data(struct irq_desc *desc, int cpu) | ||
804 | { | ||
805 | return 0; | ||
806 | } | ||