blob: 24c83a3cee4d31bf30c0eeb593a975807f5969d1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/kernel/irq/handle.c
3 *
Ingo Molnara34db9b2006-06-29 02:24:50 -07004 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
5 * Copyright (C) 2005-2006, Thomas Gleixner, Russell King
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 *
7 * This file contains the core interrupt handling code.
Ingo Molnara34db9b2006-06-29 02:24:50 -07008 *
9 * Detailed information is available in Documentation/DocBook/genericirq
10 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070011 */
12
13#include <linux/irq.h>
14#include <linux/module.h>
15#include <linux/random.h>
16#include <linux/interrupt.h>
17#include <linux/kernel_stat.h>
18
19#include "internals.h"
20
Yinghai Lu08678b02008-08-19 20:50:05 -070021/*
22 * lockdep: we want to handle all irq_desc locks as a single lock-class:
23 */
24static struct lock_class_key irq_desc_lock_class;
Yinghai Lu08678b02008-08-19 20:50:05 -070025
Thomas Gleixner6a6de9e2006-06-29 02:24:51 -070026/**
27 * handle_bad_irq - handle spurious and unhandled irqs
Henrik Kretzschmar43a1dd52006-08-31 21:27:44 -070028 * @irq: the interrupt number
29 * @desc: description of the interrupt
Henrik Kretzschmar43a1dd52006-08-31 21:27:44 -070030 *
31 * Handles spurious and unhandled IRQ's. It also prints a debugmessage.
Thomas Gleixner6a6de9e2006-06-29 02:24:51 -070032 */
Harvey Harrison7ad5b3a2008-02-08 04:19:53 -080033void
David Howells7d12e782006-10-05 14:55:46 +010034handle_bad_irq(unsigned int irq, struct irq_desc *desc)
Thomas Gleixner6a6de9e2006-06-29 02:24:51 -070035{
Ingo Molnar43f77752006-06-29 02:24:58 -070036 print_irq_desc(irq, desc);
Yinghai Lu7f95ec92008-08-19 20:50:09 -070037 kstat_irqs_this_cpu(desc)++;
Thomas Gleixner6a6de9e2006-06-29 02:24:51 -070038 ack_bad_irq(irq);
39}
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041/*
42 * Linux has a controller-independent interrupt architecture.
43 * Every controller has a 'controller-template', that is used
44 * by the main code to do the right thing. Each driver-visible
Ingo Molnar06fcb0c2006-06-29 02:24:40 -070045 * interrupt source is transparently wired to the appropriate
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 * controller. Thus drivers need not be aware of the
47 * interrupt-controller.
48 *
49 * The code is designed to be easily extended with new/different
50 * interrupt controllers, without having to do assembly magic or
51 * having to touch the generic code.
52 *
53 * Controller mappings for all interrupt sources:
54 */
Yinghai Lu85c0f902008-08-19 20:49:47 -070055int nr_irqs = NR_IRQS;
Ingo Molnarfa42d102008-08-19 20:50:30 -070056EXPORT_SYMBOL_GPL(nr_irqs);
Yinghai Lud60458b2008-08-19 20:50:00 -070057
58#ifdef CONFIG_HAVE_DYN_ARRAY
Yinghai Lu08678b02008-08-19 20:50:05 -070059static struct irq_desc irq_desc_init = {
60 .irq = -1U,
Yinghai Lud60458b2008-08-19 20:50:00 -070061 .status = IRQ_DISABLED,
62 .chip = &no_irq_chip,
63 .handle_irq = handle_bad_irq,
64 .depth = 1,
65 .lock = __SPIN_LOCK_UNLOCKED(irq_desc_init.lock),
66#ifdef CONFIG_SMP
67 .affinity = CPU_MASK_ALL
68#endif
69};
70
Yinghai Lu08678b02008-08-19 20:50:05 -070071
72static void init_one_irq_desc(struct irq_desc *desc)
73{
74 memcpy(desc, &irq_desc_init, sizeof(struct irq_desc));
Yinghai Lu08678b02008-08-19 20:50:05 -070075 lockdep_set_class(&desc->lock, &irq_desc_lock_class);
Yinghai Lu08678b02008-08-19 20:50:05 -070076}
77
Yinghai Lu7f95ec92008-08-19 20:50:09 -070078extern int after_bootmem;
79extern void *__alloc_bootmem_nopanic(unsigned long size,
80 unsigned long align,
81 unsigned long goal);
82
83static void init_kstat_irqs(struct irq_desc *desc, int nr_desc, int nr)
84{
85 unsigned long bytes, total_bytes;
86 char *ptr;
87 int i;
88 unsigned long phys;
89
90 /* Compute how many bytes we need per irq and allocate them */
91 bytes = nr * sizeof(unsigned int);
92 total_bytes = bytes * nr_desc;
93 if (after_bootmem)
94 ptr = kzalloc(total_bytes, GFP_ATOMIC);
95 else
96 ptr = __alloc_bootmem_nopanic(total_bytes, PAGE_SIZE, 0);
97
98 if (!ptr)
99 panic(" can not allocate kstat_irqs\n");
100
101 phys = __pa(ptr);
102 printk(KERN_DEBUG "kstat_irqs ==> [%#lx - %#lx]\n", phys, phys + total_bytes);
103
104 for (i = 0; i < nr_desc; i++) {
105 desc[i].kstat_irqs = (unsigned int *)ptr;
106 ptr += bytes;
107 }
108}
109
Yinghai Lu67fb2832008-08-19 20:50:18 -0700110#ifdef CONFIG_HAVE_SPARSE_IRQ
111static struct irq_desc *sparse_irqs_free;
112struct irq_desc *sparse_irqs;
113#endif
114
Yinghai Lu7f95ec92008-08-19 20:50:09 -0700115static void __init init_work(void *data)
116{
117 struct dyn_array *da = data;
118 int i;
119 struct irq_desc *desc;
120
121 desc = *da->name;
122
123 for (i = 0; i < *da->nr; i++) {
124 init_one_irq_desc(&desc[i]);
125#ifndef CONFIG_HAVE_SPARSE_IRQ
126 desc[i].irq = i;
127#endif
128 }
129
Yinghai Lu67fb2832008-08-19 20:50:18 -0700130 /* init kstat_irqs, nr_cpu_ids is ready already */
131 init_kstat_irqs(desc, *da->nr, nr_cpu_ids);
132
Yinghai Lu7f95ec92008-08-19 20:50:09 -0700133#ifdef CONFIG_HAVE_SPARSE_IRQ
134 for (i = 1; i < *da->nr; i++)
135 desc[i-1].next = &desc[i];
Yinghai Lu7f95ec92008-08-19 20:50:09 -0700136
Yinghai Lu67fb2832008-08-19 20:50:18 -0700137 sparse_irqs_free = sparse_irqs;
138 sparse_irqs = NULL;
139#endif
Yinghai Lu7f95ec92008-08-19 20:50:09 -0700140}
141
Yinghai Lu08678b02008-08-19 20:50:05 -0700142#ifdef CONFIG_HAVE_SPARSE_IRQ
143static int nr_irq_desc = 32;
144
145static int __init parse_nr_irq_desc(char *arg)
146{
147 if (arg)
148 nr_irq_desc = simple_strtoul(arg, NULL, 0);
149 return 0;
150}
151
152early_param("nr_irq_desc", parse_nr_irq_desc);
153
Yinghai Lu08678b02008-08-19 20:50:05 -0700154DEFINE_DYN_ARRAY(sparse_irqs, sizeof(struct irq_desc), nr_irq_desc, PAGE_SIZE, init_work);
155
Yinghai Lucb5bc832008-08-19 20:50:17 -0700156struct irq_desc *irq_to_desc(unsigned int irq)
Yinghai Lu9059d8f2008-08-19 20:50:10 -0700157{
158 struct irq_desc *desc;
159
Yinghai Lu67fb2832008-08-19 20:50:18 -0700160 desc = sparse_irqs;
Yinghai Lu9059d8f2008-08-19 20:50:10 -0700161 while (desc) {
162 if (desc->irq == irq)
163 return desc;
164
Yinghai Lu9059d8f2008-08-19 20:50:10 -0700165 desc = desc->next;
166 }
167 return NULL;
168}
Yinghai Lucb5bc832008-08-19 20:50:17 -0700169struct irq_desc *irq_to_desc_alloc(unsigned int irq)
Yinghai Lu08678b02008-08-19 20:50:05 -0700170{
171 struct irq_desc *desc, *desc_pri;
172 int i;
173 int count = 0;
174
Yinghai Lu67fb2832008-08-19 20:50:18 -0700175 desc_pri = desc = sparse_irqs;
Yinghai Lu08678b02008-08-19 20:50:05 -0700176 while (desc) {
177 if (desc->irq == irq)
178 return desc;
179
Yinghai Lu08678b02008-08-19 20:50:05 -0700180 desc_pri = desc;
181 desc = desc->next;
182 count++;
183 }
184
185 /*
186 * we run out of pre-allocate ones, allocate more
187 */
Yinghai Lu67fb2832008-08-19 20:50:18 -0700188 if (!sparse_irqs_free) {
189 unsigned long phys;
190 unsigned long total_bytes;
Yinghai Lu46926b62008-08-19 20:50:15 -0700191
Yinghai Lu67fb2832008-08-19 20:50:18 -0700192 printk(KERN_DEBUG "try to get more irq_desc %d\n", nr_irq_desc);
193
194 total_bytes = sizeof(struct irq_desc) * nr_irq_desc;
195 if (after_bootmem)
196 desc = kzalloc(total_bytes, GFP_ATOMIC);
197 else
198 desc = __alloc_bootmem_nopanic(total_bytes, PAGE_SIZE, 0);
199
200 if (!desc)
201 panic("please boot with nr_irq_desc= %d\n", count * 2);
202
203 phys = __pa(desc);
204 printk(KERN_DEBUG "irq_desc ==> [%#lx - %#lx]\n", phys, phys + total_bytes);
205
206 for (i = 0; i < nr_irq_desc; i++)
207 init_one_irq_desc(&desc[i]);
208
209 for (i = 1; i < nr_irq_desc; i++)
210 desc[i-1].next = &desc[i];
211
212 /* init kstat_irqs, nr_cpu_ids is ready already */
213 init_kstat_irqs(desc, nr_irq_desc, nr_cpu_ids);
214
215 sparse_irqs_free = desc;
Yinghai Lu46926b62008-08-19 20:50:15 -0700216 }
Yinghai Lu08678b02008-08-19 20:50:05 -0700217
Yinghai Lu67fb2832008-08-19 20:50:18 -0700218 desc = sparse_irqs_free;
219 sparse_irqs_free = sparse_irqs_free->next;
220 desc->next = NULL;
221 if (desc_pri)
222 desc_pri->next = desc;
Yinghai Lu08678b02008-08-19 20:50:05 -0700223 else
Yinghai Lu67fb2832008-08-19 20:50:18 -0700224 sparse_irqs = desc;
Yinghai Lu08678b02008-08-19 20:50:05 -0700225 desc->irq = irq;
Yinghai Lu67fb2832008-08-19 20:50:18 -0700226 printk(KERN_DEBUG "found new irq_desc for irq %d\n", desc->irq);
227#ifdef CONFIG_HAVE_SPARSE_IRQ_DEBUG
228 {
229 /* dump the results */
230 struct irq_desc *desc;
231 unsigned long phys;
232 unsigned long bytes = sizeof(struct irq_desc);
233 unsigned int irqx;
Yinghai Lu08678b02008-08-19 20:50:05 -0700234
Yinghai Lu67fb2832008-08-19 20:50:18 -0700235 printk(KERN_DEBUG "=========================== %d\n", irq);
236 printk(KERN_DEBUG "irq_desc dump after get that for %d\n", irq);
237 for_each_irq_desc(irqx, desc) {
238 phys = __pa(desc);
239 printk(KERN_DEBUG "irq_desc %d ==> [%#lx - %#lx]\n", irqx, phys, phys + bytes);
240 }
241 printk(KERN_DEBUG "===========================\n");
242 }
243#endif
Yinghai Lu08678b02008-08-19 20:50:05 -0700244 return desc;
245}
246#else
Yinghai Lu9059d8f2008-08-19 20:50:10 -0700247struct irq_desc *irq_desc;
Yinghai Lud60458b2008-08-19 20:50:00 -0700248DEFINE_DYN_ARRAY(irq_desc, sizeof(struct irq_desc), nr_irqs, PAGE_SIZE, init_work);
249
Yinghai Lu08678b02008-08-19 20:50:05 -0700250#endif
251
Yinghai Lud60458b2008-08-19 20:50:00 -0700252#else
253
Ravikiran G Thirumalaie729aa12007-05-08 00:29:13 -0700254struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255 [0 ... NR_IRQS-1] = {
Zhang, Yanmin4f167fb2005-05-16 21:53:43 -0700256 .status = IRQ_DISABLED,
Ingo Molnarf1c26622006-06-29 02:24:57 -0700257 .chip = &no_irq_chip,
Ingo Molnar7a557132006-06-29 02:24:54 -0700258 .handle_irq = handle_bad_irq,
Thomas Gleixner94d39e12006-06-29 02:24:50 -0700259 .depth = 1,
Yinghai Lu08678b02008-08-19 20:50:05 -0700260 .lock = __SPIN_LOCK_UNLOCKED(sparse_irqs->lock),
Ingo Molnara53da522006-06-29 02:24:38 -0700261#ifdef CONFIG_SMP
262 .affinity = CPU_MASK_ALL
263#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264 }
265};
Yinghai Lu08678b02008-08-19 20:50:05 -0700266
267#endif
268
269#ifndef CONFIG_HAVE_SPARSE_IRQ
270struct irq_desc *irq_to_desc(unsigned int irq)
271{
272 if (irq < nr_irqs)
273 return &irq_desc[irq];
274
275 return NULL;
276}
Yinghai Lucb5bc832008-08-19 20:50:17 -0700277struct irq_desc *irq_to_desc_alloc(unsigned int irq)
Yinghai Lu9059d8f2008-08-19 20:50:10 -0700278{
279 return irq_to_desc(irq);
280}
Yinghai Lud60458b2008-08-19 20:50:00 -0700281#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700282
283/*
Ingo Molnar77a5afe2006-06-29 02:24:46 -0700284 * What should we do if we get a hw irq event on an illegal vector?
285 * Each architecture has to answer this themself.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286 */
Ingo Molnar77a5afe2006-06-29 02:24:46 -0700287static void ack_bad(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288{
Yinghai Lu08678b02008-08-19 20:50:05 -0700289 struct irq_desc *desc;
290
291 desc = irq_to_desc(irq);
292 print_irq_desc(irq, desc);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293 ack_bad_irq(irq);
294}
295
Ingo Molnar77a5afe2006-06-29 02:24:46 -0700296/*
297 * NOP functions
298 */
299static void noop(unsigned int irq)
300{
301}
302
303static unsigned int noop_ret(unsigned int irq)
304{
305 return 0;
306}
307
308/*
309 * Generic no controller implementation
310 */
Ingo Molnarf1c26622006-06-29 02:24:57 -0700311struct irq_chip no_irq_chip = {
312 .name = "none",
Ingo Molnar77a5afe2006-06-29 02:24:46 -0700313 .startup = noop_ret,
314 .shutdown = noop,
315 .enable = noop,
316 .disable = noop,
317 .ack = ack_bad,
318 .end = noop,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319};
320
321/*
Thomas Gleixnerf8b54732006-07-01 22:30:08 +0100322 * Generic dummy implementation which can be used for
323 * real dumb interrupt sources
324 */
325struct irq_chip dummy_irq_chip = {
326 .name = "dummy",
327 .startup = noop_ret,
328 .shutdown = noop,
329 .enable = noop,
330 .disable = noop,
331 .ack = noop,
332 .mask = noop,
333 .unmask = noop,
334 .end = noop,
335};
336
337/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338 * Special, empty irq handler:
339 */
David Howells7d12e782006-10-05 14:55:46 +0100340irqreturn_t no_action(int cpl, void *dev_id)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341{
342 return IRQ_NONE;
343}
344
Ingo Molnar8d28bc72006-06-29 02:24:46 -0700345/**
346 * handle_IRQ_event - irq action chain handler
347 * @irq: the interrupt number
Ingo Molnar8d28bc72006-06-29 02:24:46 -0700348 * @action: the interrupt action chain for this irq
349 *
350 * Handles the action chain of an irq event
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351 */
David Howells7d12e782006-10-05 14:55:46 +0100352irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700353{
Jan Beulich908dcec2006-06-23 02:06:00 -0700354 irqreturn_t ret, retval = IRQ_NONE;
355 unsigned int status = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700356
Thomas Gleixner3cca53b2006-07-01 19:29:31 -0700357 if (!(action->flags & IRQF_DISABLED))
Ingo Molnar366c7f52006-07-03 00:25:25 -0700358 local_irq_enable_in_hardirq();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700359
360 do {
David Howells7d12e782006-10-05 14:55:46 +0100361 ret = action->handler(irq, action->dev_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362 if (ret == IRQ_HANDLED)
363 status |= action->flags;
364 retval |= ret;
365 action = action->next;
366 } while (action);
367
Thomas Gleixner3cca53b2006-07-01 19:29:31 -0700368 if (status & IRQF_SAMPLE_RANDOM)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369 add_interrupt_randomness(irq);
370 local_irq_disable();
371
372 return retval;
373}
374
David Howellsaf8c65b2006-09-25 23:32:07 -0700375#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
Ingo Molnar8d28bc72006-06-29 02:24:46 -0700376/**
377 * __do_IRQ - original all in one highlevel IRQ handler
378 * @irq: the interrupt number
Ingo Molnar8d28bc72006-06-29 02:24:46 -0700379 *
380 * __do_IRQ handles all normal device IRQ's (the special
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381 * SMP cross-CPU interrupts have their own specific
382 * handlers).
Ingo Molnar8d28bc72006-06-29 02:24:46 -0700383 *
384 * This is the original x86 implementation which is used for every
385 * interrupt type.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386 */
Harvey Harrison7ad5b3a2008-02-08 04:19:53 -0800387unsigned int __do_IRQ(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388{
Yinghai Lu08678b02008-08-19 20:50:05 -0700389 struct irq_desc *desc = irq_to_desc(irq);
Ingo Molnar06fcb0c2006-06-29 02:24:40 -0700390 struct irqaction *action;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391 unsigned int status;
392
Yinghai Lu7f95ec92008-08-19 20:50:09 -0700393 kstat_irqs_this_cpu(desc)++;
Karsten Wiesef26fdd52005-09-06 15:17:25 -0700394 if (CHECK_IRQ_PER_CPU(desc->status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395 irqreturn_t action_ret;
396
397 /*
398 * No locking required for CPU-local interrupts:
399 */
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700400 if (desc->chip->ack)
401 desc->chip->ack(irq);
Russ Andersonc642b832007-11-14 17:00:15 -0800402 if (likely(!(desc->status & IRQ_DISABLED))) {
403 action_ret = handle_IRQ_event(irq, desc->action);
404 if (!noirqdebug)
405 note_interrupt(irq, desc, action_ret);
406 }
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700407 desc->chip->end(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700408 return 1;
409 }
410
411 spin_lock(&desc->lock);
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700412 if (desc->chip->ack)
413 desc->chip->ack(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414 /*
415 * REPLAY is when Linux resends an IRQ that was dropped earlier
416 * WAITING is used by probe to mark irqs that are being tested
417 */
418 status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING);
419 status |= IRQ_PENDING; /* we _want_ to handle it */
420
421 /*
422 * If the IRQ is disabled for whatever reason, we cannot
423 * use the action we have.
424 */
425 action = NULL;
426 if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) {
427 action = desc->action;
428 status &= ~IRQ_PENDING; /* we commit to handling */
429 status |= IRQ_INPROGRESS; /* we are handling it */
430 }
431 desc->status = status;
432
433 /*
434 * If there is no IRQ handler or it was disabled, exit early.
435 * Since we set PENDING, if another processor is handling
436 * a different instance of this same irq, the other processor
437 * will take care of it.
438 */
439 if (unlikely(!action))
440 goto out;
441
442 /*
443 * Edge triggered interrupts need to remember
444 * pending events.
445 * This applies to any hw interrupts that allow a second
446 * instance of the same irq to arrive while we are in do_IRQ
447 * or in the handler. But the code here only handles the _second_
448 * instance of the irq, not the third or fourth. So it is mostly
449 * useful for irq hardware that does not mask cleanly in an
450 * SMP environment.
451 */
452 for (;;) {
453 irqreturn_t action_ret;
454
455 spin_unlock(&desc->lock);
456
David Howells7d12e782006-10-05 14:55:46 +0100457 action_ret = handle_IRQ_event(irq, action);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458 if (!noirqdebug)
David Howells7d12e782006-10-05 14:55:46 +0100459 note_interrupt(irq, desc, action_ret);
Linus Torvaldsb42172f2006-11-22 09:32:06 -0800460
461 spin_lock(&desc->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700462 if (likely(!(desc->status & IRQ_PENDING)))
463 break;
464 desc->status &= ~IRQ_PENDING;
465 }
466 desc->status &= ~IRQ_INPROGRESS;
467
468out:
469 /*
470 * The ->end() handler has to deal with interrupts which got
471 * disabled while the handler was running.
472 */
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700473 desc->chip->end(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700474 spin_unlock(&desc->lock);
475
476 return 1;
477}
David Howellsaf8c65b2006-09-25 23:32:07 -0700478#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479
Yinghai Lu08678b02008-08-19 20:50:05 -0700480
Ingo Molnar243c7622006-07-03 00:25:06 -0700481#ifdef CONFIG_TRACE_IRQFLAGS
Ingo Molnar243c7622006-07-03 00:25:06 -0700482void early_init_irq_lock_class(void)
483{
Yinghai Lu08678b02008-08-19 20:50:05 -0700484#ifndef CONFIG_HAVE_DYN_ARRAY
Ingo Molnar243c7622006-07-03 00:25:06 -0700485 int i;
486
Yinghai Lu85c0f902008-08-19 20:49:47 -0700487 for (i = 0; i < nr_irqs; i++)
Ingo Molnar243c7622006-07-03 00:25:06 -0700488 lockdep_set_class(&irq_desc[i].lock, &irq_desc_lock_class);
Ingo Molnar243c7622006-07-03 00:25:06 -0700489#endif
Yinghai Lu08678b02008-08-19 20:50:05 -0700490}
491#endif
492
Yinghai Lu7f95ec92008-08-19 20:50:09 -0700493unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
494{
495 struct irq_desc *desc = irq_to_desc(irq);
496 return desc->kstat_irqs[cpu];
497}
498EXPORT_SYMBOL(kstat_irqs_cpu);
499