blob: 886e80347b322795b56630857fd98996545ea5a4 [file] [log] [blame]
Thomas Gleixner3795de22010-09-22 17:09:43 +02001/*
2 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
3 * Copyright (C) 2005-2006, Thomas Gleixner, Russell King
4 *
5 * This file contains the interrupt descriptor management code
6 *
7 * Detailed information is available in Documentation/DocBook/genericirq
8 *
9 */
10#include <linux/irq.h>
11#include <linux/slab.h>
12#include <linux/module.h>
13#include <linux/interrupt.h>
14#include <linux/kernel_stat.h>
15#include <linux/radix-tree.h>
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020016#include <linux/bitmap.h>
Thomas Gleixner3795de22010-09-22 17:09:43 +020017
18#include "internals.h"
19
20/*
21 * lockdep: we want to handle all irq_desc locks as a single lock-class:
22 */
Thomas Gleixner78f90d92010-09-29 17:18:47 +020023static struct lock_class_key irq_desc_lock_class;
Thomas Gleixner3795de22010-09-22 17:09:43 +020024
Thomas Gleixnerfe051432011-05-18 12:53:03 +020025#if defined(CONFIG_SMP)
Thomas Gleixner3795de22010-09-22 17:09:43 +020026static void __init init_irq_default_affinity(void)
27{
28 alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
29 cpumask_setall(irq_default_affinity);
30}
31#else
32static void __init init_irq_default_affinity(void)
33{
34}
35#endif
36
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020037#ifdef CONFIG_SMP
38static int alloc_masks(struct irq_desc *desc, gfp_t gfp, int node)
39{
40 if (!zalloc_cpumask_var_node(&desc->irq_data.affinity, gfp, node))
41 return -ENOMEM;
42
43#ifdef CONFIG_GENERIC_PENDING_IRQ
44 if (!zalloc_cpumask_var_node(&desc->pending_mask, gfp, node)) {
45 free_cpumask_var(desc->irq_data.affinity);
46 return -ENOMEM;
47 }
48#endif
49 return 0;
50}
51
52static void desc_smp_init(struct irq_desc *desc, int node)
53{
Thomas Gleixneraa99ec02010-09-27 20:02:56 +020054 desc->irq_data.node = node;
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020055 cpumask_copy(desc->irq_data.affinity, irq_default_affinity);
Thomas Gleixnerb7b29332010-09-29 18:46:55 +020056#ifdef CONFIG_GENERIC_PENDING_IRQ
57 cpumask_clear(desc->pending_mask);
58#endif
59}
60
61static inline int desc_node(struct irq_desc *desc)
62{
63 return desc->irq_data.node;
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020064}
65
66#else
67static inline int
68alloc_masks(struct irq_desc *desc, gfp_t gfp, int node) { return 0; }
69static inline void desc_smp_init(struct irq_desc *desc, int node) { }
Thomas Gleixnerb7b29332010-09-29 18:46:55 +020070static inline int desc_node(struct irq_desc *desc) { return 0; }
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020071#endif
72
73static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node)
74{
Eric Dumazet6c9ae002011-01-13 15:45:38 -080075 int cpu;
76
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020077 desc->irq_data.irq = irq;
78 desc->irq_data.chip = &no_irq_chip;
79 desc->irq_data.chip_data = NULL;
80 desc->irq_data.handler_data = NULL;
81 desc->irq_data.msi_desc = NULL;
Thomas Gleixnerf9e49892011-02-09 14:54:49 +010082 irq_settings_clr_and_set(desc, ~0, _IRQ_DEFAULT_INIT_FLAGS);
Thomas Gleixner801a0e92011-03-27 11:02:49 +020083 irqd_set(&desc->irq_data, IRQD_IRQ_DISABLED);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020084 desc->handle_irq = handle_bad_irq;
85 desc->depth = 1;
Thomas Gleixnerb7b29332010-09-29 18:46:55 +020086 desc->irq_count = 0;
87 desc->irqs_unhandled = 0;
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020088 desc->name = NULL;
Eric Dumazet6c9ae002011-01-13 15:45:38 -080089 for_each_possible_cpu(cpu)
90 *per_cpu_ptr(desc->kstat_irqs, cpu) = 0;
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020091 desc_smp_init(desc, node);
92}
93
Thomas Gleixner3795de22010-09-22 17:09:43 +020094int nr_irqs = NR_IRQS;
95EXPORT_SYMBOL_GPL(nr_irqs);
96
Thomas Gleixnera05a9002010-10-08 12:47:53 +020097static DEFINE_MUTEX(sparse_irq_lock);
Thomas Gleixnerc1ee6262011-02-17 17:45:15 +010098static DECLARE_BITMAP(allocated_irqs, IRQ_BITMAP_BITS);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +020099
Thomas Gleixner3795de22010-09-22 17:09:43 +0200100#ifdef CONFIG_SPARSE_IRQ
101
Thomas Gleixnerbaa0d232010-10-05 15:14:35 +0200102static RADIX_TREE(irq_desc_tree, GFP_KERNEL);
Thomas Gleixner3795de22010-09-22 17:09:43 +0200103
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200104static void irq_insert_desc(unsigned int irq, struct irq_desc *desc)
Thomas Gleixner3795de22010-09-22 17:09:43 +0200105{
106 radix_tree_insert(&irq_desc_tree, irq, desc);
107}
108
109struct irq_desc *irq_to_desc(unsigned int irq)
110{
111 return radix_tree_lookup(&irq_desc_tree, irq);
112}
113
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200114static void delete_irq_desc(unsigned int irq)
115{
116 radix_tree_delete(&irq_desc_tree, irq);
117}
118
119#ifdef CONFIG_SMP
120static void free_masks(struct irq_desc *desc)
121{
122#ifdef CONFIG_GENERIC_PENDING_IRQ
123 free_cpumask_var(desc->pending_mask);
124#endif
Thomas Gleixnerc0a19eb2010-10-12 21:58:27 +0200125 free_cpumask_var(desc->irq_data.affinity);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200126}
127#else
128static inline void free_masks(struct irq_desc *desc) { }
129#endif
130
131static struct irq_desc *alloc_desc(int irq, int node)
132{
133 struct irq_desc *desc;
Thomas Gleixnerbaa0d232010-10-05 15:14:35 +0200134 gfp_t gfp = GFP_KERNEL;
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200135
136 desc = kzalloc_node(sizeof(*desc), gfp, node);
137 if (!desc)
138 return NULL;
139 /* allocate based on nr_cpu_ids */
Eric Dumazet6c9ae002011-01-13 15:45:38 -0800140 desc->kstat_irqs = alloc_percpu(unsigned int);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200141 if (!desc->kstat_irqs)
142 goto err_desc;
143
144 if (alloc_masks(desc, gfp, node))
145 goto err_kstat;
146
147 raw_spin_lock_init(&desc->lock);
148 lockdep_set_class(&desc->lock, &irq_desc_lock_class);
149
150 desc_set_defaults(irq, desc, node);
151
152 return desc;
153
154err_kstat:
Eric Dumazet6c9ae002011-01-13 15:45:38 -0800155 free_percpu(desc->kstat_irqs);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200156err_desc:
157 kfree(desc);
158 return NULL;
159}
160
161static void free_desc(unsigned int irq)
162{
163 struct irq_desc *desc = irq_to_desc(irq);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200164
Thomas Gleixner13bfe992010-09-30 02:46:07 +0200165 unregister_irq_proc(irq, desc);
166
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200167 mutex_lock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200168 delete_irq_desc(irq);
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200169 mutex_unlock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200170
171 free_masks(desc);
Eric Dumazet6c9ae002011-01-13 15:45:38 -0800172 free_percpu(desc->kstat_irqs);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200173 kfree(desc);
174}
175
176static int alloc_descs(unsigned int start, unsigned int cnt, int node)
177{
178 struct irq_desc *desc;
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200179 int i;
180
181 for (i = 0; i < cnt; i++) {
182 desc = alloc_desc(start + i, node);
183 if (!desc)
184 goto err;
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200185 mutex_lock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200186 irq_insert_desc(start + i, desc);
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200187 mutex_unlock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200188 }
189 return start;
190
191err:
192 for (i--; i >= 0; i--)
193 free_desc(start + i);
194
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200195 mutex_lock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200196 bitmap_clear(allocated_irqs, start, cnt);
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200197 mutex_unlock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200198 return -ENOMEM;
199}
200
Yinghai Lued4dea62011-02-19 11:07:37 -0800201static int irq_expand_nr_irqs(unsigned int nr)
Thomas Gleixnere7bcecb2011-02-16 17:12:57 +0100202{
Yinghai Lued4dea62011-02-19 11:07:37 -0800203 if (nr > IRQ_BITMAP_BITS)
Thomas Gleixnere7bcecb2011-02-16 17:12:57 +0100204 return -ENOMEM;
Yinghai Lued4dea62011-02-19 11:07:37 -0800205 nr_irqs = nr;
Thomas Gleixnere7bcecb2011-02-16 17:12:57 +0100206 return 0;
207}
208
Thomas Gleixner3795de22010-09-22 17:09:43 +0200209int __init early_irq_init(void)
210{
Thomas Gleixnerb683de22010-09-27 20:55:03 +0200211 int i, initcnt, node = first_online_node;
Thomas Gleixner3795de22010-09-22 17:09:43 +0200212 struct irq_desc *desc;
Thomas Gleixner3795de22010-09-22 17:09:43 +0200213
214 init_irq_default_affinity();
215
Thomas Gleixnerb683de22010-09-27 20:55:03 +0200216 /* Let arch update nr_irqs and return the nr of preallocated irqs */
217 initcnt = arch_probe_nr_irqs();
218 printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt);
Thomas Gleixner3795de22010-09-22 17:09:43 +0200219
Thomas Gleixnerc1ee6262011-02-17 17:45:15 +0100220 if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS))
221 nr_irqs = IRQ_BITMAP_BITS;
222
223 if (WARN_ON(initcnt > IRQ_BITMAP_BITS))
224 initcnt = IRQ_BITMAP_BITS;
225
226 if (initcnt > nr_irqs)
227 nr_irqs = initcnt;
228
Thomas Gleixnerb683de22010-09-27 20:55:03 +0200229 for (i = 0; i < initcnt; i++) {
Thomas Gleixneraa99ec02010-09-27 20:02:56 +0200230 desc = alloc_desc(i, node);
231 set_bit(i, allocated_irqs);
232 irq_insert_desc(i, desc);
Thomas Gleixner3795de22010-09-22 17:09:43 +0200233 }
Thomas Gleixner3795de22010-09-22 17:09:43 +0200234 return arch_early_irq_init();
235}
236
Thomas Gleixner3795de22010-09-22 17:09:43 +0200237#else /* !CONFIG_SPARSE_IRQ */
238
239struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = {
240 [0 ... NR_IRQS-1] = {
Thomas Gleixner3795de22010-09-22 17:09:43 +0200241 .handle_irq = handle_bad_irq,
242 .depth = 1,
243 .lock = __RAW_SPIN_LOCK_UNLOCKED(irq_desc->lock),
244 }
245};
246
Thomas Gleixner3795de22010-09-22 17:09:43 +0200247int __init early_irq_init(void)
248{
Thomas Gleixneraa99ec02010-09-27 20:02:56 +0200249 int count, i, node = first_online_node;
Thomas Gleixner3795de22010-09-22 17:09:43 +0200250 struct irq_desc *desc;
Thomas Gleixner3795de22010-09-22 17:09:43 +0200251
252 init_irq_default_affinity();
253
254 printk(KERN_INFO "NR_IRQS:%d\n", NR_IRQS);
255
256 desc = irq_desc;
257 count = ARRAY_SIZE(irq_desc);
258
259 for (i = 0; i < count; i++) {
260 desc[i].irq_data.irq = i;
261 desc[i].irq_data.chip = &no_irq_chip;
Eric Dumazet6c9ae002011-01-13 15:45:38 -0800262 desc[i].kstat_irqs = alloc_percpu(unsigned int);
Thomas Gleixnerf9e49892011-02-09 14:54:49 +0100263 irq_settings_clr_and_set(desc, ~0, _IRQ_DEFAULT_INIT_FLAGS);
Thomas Gleixneraa99ec02010-09-27 20:02:56 +0200264 alloc_masks(desc + i, GFP_KERNEL, node);
265 desc_smp_init(desc + i, node);
Thomas Gleixner154cd382010-09-22 15:58:45 +0200266 lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
Thomas Gleixner3795de22010-09-22 17:09:43 +0200267 }
268 return arch_early_irq_init();
269}
270
271struct irq_desc *irq_to_desc(unsigned int irq)
272{
273 return (irq < NR_IRQS) ? irq_desc + irq : NULL;
274}
275
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200276static void free_desc(unsigned int irq)
277{
Thomas Gleixnerb7b29332010-09-29 18:46:55 +0200278 dynamic_irq_cleanup(irq);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200279}
280
281static inline int alloc_descs(unsigned int start, unsigned int cnt, int node)
282{
283 return start;
284}
Thomas Gleixnere7bcecb2011-02-16 17:12:57 +0100285
Yinghai Lued4dea62011-02-19 11:07:37 -0800286static int irq_expand_nr_irqs(unsigned int nr)
Thomas Gleixnere7bcecb2011-02-16 17:12:57 +0100287{
288 return -ENOMEM;
289}
290
Thomas Gleixner3795de22010-09-22 17:09:43 +0200291#endif /* !CONFIG_SPARSE_IRQ */
292
Thomas Gleixnerfe12bc22011-05-18 12:48:00 +0200293/**
294 * generic_handle_irq - Invoke the handler for a particular irq
295 * @irq: The irq number to handle
296 *
297 */
298int generic_handle_irq(unsigned int irq)
299{
300 struct irq_desc *desc = irq_to_desc(irq);
301
302 if (!desc)
303 return -EINVAL;
304 generic_handle_irq_desc(irq, desc);
305 return 0;
306}
Jonathan Cameronedf76f82011-05-18 10:39:04 +0100307EXPORT_SYMBOL_GPL(generic_handle_irq);
Thomas Gleixnerfe12bc22011-05-18 12:48:00 +0200308
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200309/* Dynamic interrupt handling */
310
311/**
312 * irq_free_descs - free irq descriptors
313 * @from: Start of descriptor range
314 * @cnt: Number of consecutive irqs to free
315 */
316void irq_free_descs(unsigned int from, unsigned int cnt)
317{
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200318 int i;
319
320 if (from >= nr_irqs || (from + cnt) > nr_irqs)
321 return;
322
323 for (i = 0; i < cnt; i++)
324 free_desc(from + i);
325
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200326 mutex_lock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200327 bitmap_clear(allocated_irqs, from, cnt);
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200328 mutex_unlock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200329}
Jonathan Cameronedf76f82011-05-18 10:39:04 +0100330EXPORT_SYMBOL_GPL(irq_free_descs);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200331
332/**
333 * irq_alloc_descs - allocate and initialize a range of irq descriptors
334 * @irq: Allocate for specific irq number if irq >= 0
335 * @from: Start the search from this irq number
336 * @cnt: Number of consecutive irqs to allocate.
337 * @node: Preferred node on which the irq descriptor should be allocated
338 *
339 * Returns the first irq number or error code
340 */
341int __ref
342irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node)
343{
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200344 int start, ret;
345
346 if (!cnt)
347 return -EINVAL;
348
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200349 mutex_lock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200350
Yinghai Lued4dea62011-02-19 11:07:37 -0800351 start = bitmap_find_next_zero_area(allocated_irqs, IRQ_BITMAP_BITS,
352 from, cnt, 0);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200353 ret = -EEXIST;
354 if (irq >=0 && start != irq)
355 goto err;
356
Yinghai Lued4dea62011-02-19 11:07:37 -0800357 if (start + cnt > nr_irqs) {
358 ret = irq_expand_nr_irqs(start + cnt);
Thomas Gleixnere7bcecb2011-02-16 17:12:57 +0100359 if (ret)
360 goto err;
361 }
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200362
363 bitmap_set(allocated_irqs, start, cnt);
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200364 mutex_unlock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200365 return alloc_descs(start, cnt, node);
366
367err:
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200368 mutex_unlock(&sparse_irq_lock);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200369 return ret;
370}
Jonathan Cameronedf76f82011-05-18 10:39:04 +0100371EXPORT_SYMBOL_GPL(irq_alloc_descs);
Thomas Gleixner1f5a5b82010-09-27 17:48:26 +0200372
Thomas Gleixnera98d24b2010-09-30 10:45:07 +0200373/**
Thomas Gleixner06f6c332010-10-12 12:31:46 +0200374 * irq_reserve_irqs - mark irqs allocated
375 * @from: mark from irq number
376 * @cnt: number of irqs to mark
377 *
378 * Returns 0 on success or an appropriate error code
379 */
380int irq_reserve_irqs(unsigned int from, unsigned int cnt)
381{
Thomas Gleixner06f6c332010-10-12 12:31:46 +0200382 unsigned int start;
383 int ret = 0;
384
385 if (!cnt || (from + cnt) > nr_irqs)
386 return -EINVAL;
387
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200388 mutex_lock(&sparse_irq_lock);
Thomas Gleixner06f6c332010-10-12 12:31:46 +0200389 start = bitmap_find_next_zero_area(allocated_irqs, nr_irqs, from, cnt, 0);
390 if (start == from)
391 bitmap_set(allocated_irqs, start, cnt);
392 else
393 ret = -EEXIST;
Thomas Gleixnera05a9002010-10-08 12:47:53 +0200394 mutex_unlock(&sparse_irq_lock);
Thomas Gleixner06f6c332010-10-12 12:31:46 +0200395 return ret;
396}
397
398/**
Thomas Gleixnera98d24b2010-09-30 10:45:07 +0200399 * irq_get_next_irq - get next allocated irq number
400 * @offset: where to start the search
401 *
402 * Returns next irq number after offset or nr_irqs if none is found.
403 */
404unsigned int irq_get_next_irq(unsigned int offset)
405{
406 return find_next_bit(allocated_irqs, nr_irqs, offset);
407}
408
Thomas Gleixnerd5eb4ad22011-02-12 12:16:16 +0100409struct irq_desc *
410__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus)
411{
412 struct irq_desc *desc = irq_to_desc(irq);
413
414 if (desc) {
415 if (bus)
416 chip_bus_lock(desc);
417 raw_spin_lock_irqsave(&desc->lock, *flags);
418 }
419 return desc;
420}
421
422void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus)
423{
424 raw_spin_unlock_irqrestore(&desc->lock, flags);
425 if (bus)
426 chip_bus_sync_unlock(desc);
427}
428
Thomas Gleixnerb7b29332010-09-29 18:46:55 +0200429/**
430 * dynamic_irq_cleanup - cleanup a dynamically allocated irq
431 * @irq: irq number to initialize
432 */
433void dynamic_irq_cleanup(unsigned int irq)
Thomas Gleixner3795de22010-09-22 17:09:43 +0200434{
Thomas Gleixnerb7b29332010-09-29 18:46:55 +0200435 struct irq_desc *desc = irq_to_desc(irq);
436 unsigned long flags;
437
438 raw_spin_lock_irqsave(&desc->lock, flags);
439 desc_set_defaults(irq, desc, desc_node(desc));
440 raw_spin_unlock_irqrestore(&desc->lock, flags);
Thomas Gleixner3795de22010-09-22 17:09:43 +0200441}
442
Thomas Gleixner3795de22010-09-22 17:09:43 +0200443unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
444{
445 struct irq_desc *desc = irq_to_desc(irq);
Eric Dumazet6c9ae002011-01-13 15:45:38 -0800446
447 return desc && desc->kstat_irqs ?
448 *per_cpu_ptr(desc->kstat_irqs, cpu) : 0;
Thomas Gleixner3795de22010-09-22 17:09:43 +0200449}
KAMEZAWA Hiroyuki478735e32010-10-27 15:34:15 -0700450
KAMEZAWA Hiroyuki478735e32010-10-27 15:34:15 -0700451unsigned int kstat_irqs(unsigned int irq)
452{
453 struct irq_desc *desc = irq_to_desc(irq);
454 int cpu;
455 int sum = 0;
456
Eric Dumazet6c9ae002011-01-13 15:45:38 -0800457 if (!desc || !desc->kstat_irqs)
KAMEZAWA Hiroyuki478735e32010-10-27 15:34:15 -0700458 return 0;
459 for_each_possible_cpu(cpu)
Eric Dumazet6c9ae002011-01-13 15:45:38 -0800460 sum += *per_cpu_ptr(desc->kstat_irqs, cpu);
KAMEZAWA Hiroyuki478735e32010-10-27 15:34:15 -0700461 return sum;
462}