blob: 4bd4faa6323ac14d327addcf1012c9318c51f623 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/kernel/irq/proc.c
3 *
4 * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar
5 *
6 * This file contains the /proc/irq/ handling code.
7 */
8
9#include <linux/irq.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090010#include <linux/gfp.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <linux/proc_fs.h>
Alexey Dobriyanf18e4392008-08-12 15:09:03 -070012#include <linux/seq_file.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/interrupt.h>
Thomas Gleixnerc78b9b62010-12-16 17:21:47 +010014#include <linux/kernel_stat.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Adrian Bunk97a41e22006-01-08 01:02:17 -080016#include "internals.h"
17
Ingo Molnar4a733ee2006-06-29 02:24:42 -070018static struct proc_dir_entry *root_irq_dir;
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
20#ifdef CONFIG_SMP
21
Mike Travis4b060422011-05-24 17:13:12 -070022static int show_irq_affinity(int type, struct seq_file *m, void *v)
Linus Torvalds1da177e2005-04-16 15:20:36 -070023{
Yinghai Lu08678b02008-08-19 20:50:05 -070024 struct irq_desc *desc = irq_to_desc((long)m->private);
Thomas Gleixner6b8ff312010-10-01 12:58:38 +020025 const struct cpumask *mask = desc->irq_data.affinity;
Andi Kleen42ee2b72007-07-21 17:09:54 +020026
27#ifdef CONFIG_GENERIC_PENDING_IRQ
Thomas Gleixnerf230b6d2011-02-05 15:20:04 +010028 if (irqd_is_setaffinity_pending(&desc->irq_data))
Mike Travis7f7ace02009-01-10 21:58:08 -080029 mask = desc->pending_mask;
Andi Kleen42ee2b72007-07-21 17:09:54 +020030#endif
Mike Travis4b060422011-05-24 17:13:12 -070031 if (type)
32 seq_cpumask_list(m, mask);
33 else
34 seq_cpumask(m, mask);
Alexey Dobriyanf18e4392008-08-12 15:09:03 -070035 seq_putc(m, '\n');
36 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070037}
38
Peter P Waskiewicz Jre7a297b2010-04-30 14:44:50 -070039static int irq_affinity_hint_proc_show(struct seq_file *m, void *v)
40{
41 struct irq_desc *desc = irq_to_desc((long)m->private);
42 unsigned long flags;
43 cpumask_var_t mask;
44
Peter P Waskiewicz Jr4308ad82010-05-05 13:56:42 -070045 if (!zalloc_cpumask_var(&mask, GFP_KERNEL))
Peter P Waskiewicz Jre7a297b2010-04-30 14:44:50 -070046 return -ENOMEM;
47
48 raw_spin_lock_irqsave(&desc->lock, flags);
49 if (desc->affinity_hint)
50 cpumask_copy(mask, desc->affinity_hint);
Peter P Waskiewicz Jre7a297b2010-04-30 14:44:50 -070051 raw_spin_unlock_irqrestore(&desc->lock, flags);
52
53 seq_cpumask(m, mask);
54 seq_putc(m, '\n');
55 free_cpumask_var(mask);
56
57 return 0;
58}
59
John Keller25d61572007-05-10 22:42:44 -070060#ifndef is_affinity_mask_valid
61#define is_affinity_mask_valid(val) 1
62#endif
63
Linus Torvalds1da177e2005-04-16 15:20:36 -070064int no_irq_affinity;
Mike Travis4b060422011-05-24 17:13:12 -070065static int irq_affinity_proc_show(struct seq_file *m, void *v)
66{
67 return show_irq_affinity(0, m, v);
68}
69
70static int irq_affinity_list_proc_show(struct seq_file *m, void *v)
71{
72 return show_irq_affinity(1, m, v);
73}
74
75
76static ssize_t write_irq_affinity(int type, struct file *file,
Alexey Dobriyanf18e4392008-08-12 15:09:03 -070077 const char __user *buffer, size_t count, loff_t *pos)
Linus Torvalds1da177e2005-04-16 15:20:36 -070078{
Alexey Dobriyanf18e4392008-08-12 15:09:03 -070079 unsigned int irq = (int)(long)PDE(file->f_path.dentry->d_inode)->data;
Rusty Russell0de26522008-12-13 21:20:26 +103080 cpumask_var_t new_value;
Alexey Dobriyanf18e4392008-08-12 15:09:03 -070081 int err;
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
Thomas Gleixnerbce43032011-02-10 22:37:41 +010083 if (!irq_can_set_affinity(irq) || no_irq_affinity)
Linus Torvalds1da177e2005-04-16 15:20:36 -070084 return -EIO;
85
Rusty Russell0de26522008-12-13 21:20:26 +103086 if (!alloc_cpumask_var(&new_value, GFP_KERNEL))
87 return -ENOMEM;
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
Mike Travis4b060422011-05-24 17:13:12 -070089 if (type)
90 err = cpumask_parselist_user(buffer, count, new_value);
91 else
92 err = cpumask_parse_user(buffer, count, new_value);
Rusty Russell0de26522008-12-13 21:20:26 +103093 if (err)
94 goto free_cpumask;
95
Ingo Molnar6bdf1972009-01-03 12:50:46 +010096 if (!is_affinity_mask_valid(new_value)) {
Rusty Russell0de26522008-12-13 21:20:26 +103097 err = -EINVAL;
98 goto free_cpumask;
99 }
John Keller25d61572007-05-10 22:42:44 -0700100
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 /*
102 * Do not allow disabling IRQs completely - it's a too easy
103 * way to make the system unusable accidentally :-) At least
104 * one online CPU still has to be targeted.
105 */
Rusty Russell0de26522008-12-13 21:20:26 +1030106 if (!cpumask_intersects(new_value, cpu_online_mask)) {
Ivan Kokshayskyeee45262006-01-06 00:12:21 -0800107 /* Special case for empty set - allow the architecture
108 code to set default SMP affinity. */
Thomas Gleixner3b8249e2011-02-07 16:02:20 +0100109 err = irq_select_affinity_usr(irq, new_value) ? -EINVAL : count;
Rusty Russell0de26522008-12-13 21:20:26 +1030110 } else {
111 irq_set_affinity(irq, new_value);
112 err = count;
113 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114
Rusty Russell0de26522008-12-13 21:20:26 +1030115free_cpumask:
116 free_cpumask_var(new_value);
117 return err;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118}
119
Mike Travis4b060422011-05-24 17:13:12 -0700120static ssize_t irq_affinity_proc_write(struct file *file,
121 const char __user *buffer, size_t count, loff_t *pos)
122{
123 return write_irq_affinity(0, file, buffer, count, pos);
124}
125
126static ssize_t irq_affinity_list_proc_write(struct file *file,
127 const char __user *buffer, size_t count, loff_t *pos)
128{
129 return write_irq_affinity(1, file, buffer, count, pos);
130}
131
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700132static int irq_affinity_proc_open(struct inode *inode, struct file *file)
Max Krasnyansky18404752008-05-29 11:02:52 -0700133{
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700134 return single_open(file, irq_affinity_proc_show, PDE(inode)->data);
Max Krasnyansky18404752008-05-29 11:02:52 -0700135}
136
Mike Travis4b060422011-05-24 17:13:12 -0700137static int irq_affinity_list_proc_open(struct inode *inode, struct file *file)
138{
139 return single_open(file, irq_affinity_list_proc_show, PDE(inode)->data);
140}
141
Peter P Waskiewicz Jre7a297b2010-04-30 14:44:50 -0700142static int irq_affinity_hint_proc_open(struct inode *inode, struct file *file)
143{
144 return single_open(file, irq_affinity_hint_proc_show, PDE(inode)->data);
145}
146
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700147static const struct file_operations irq_affinity_proc_fops = {
148 .open = irq_affinity_proc_open,
149 .read = seq_read,
150 .llseek = seq_lseek,
151 .release = single_release,
152 .write = irq_affinity_proc_write,
153};
154
Peter P Waskiewicz Jre7a297b2010-04-30 14:44:50 -0700155static const struct file_operations irq_affinity_hint_proc_fops = {
156 .open = irq_affinity_hint_proc_open,
157 .read = seq_read,
158 .llseek = seq_lseek,
159 .release = single_release,
160};
161
Mike Travis4b060422011-05-24 17:13:12 -0700162static const struct file_operations irq_affinity_list_proc_fops = {
163 .open = irq_affinity_list_proc_open,
164 .read = seq_read,
165 .llseek = seq_lseek,
166 .release = single_release,
167 .write = irq_affinity_list_proc_write,
168};
169
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700170static int default_affinity_show(struct seq_file *m, void *v)
Max Krasnyansky18404752008-05-29 11:02:52 -0700171{
Rusty Russelld036e672009-01-01 10:12:26 +1030172 seq_cpumask(m, irq_default_affinity);
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700173 seq_putc(m, '\n');
174 return 0;
175}
176
177static ssize_t default_affinity_write(struct file *file,
178 const char __user *buffer, size_t count, loff_t *ppos)
179{
Rusty Russelld036e672009-01-01 10:12:26 +1030180 cpumask_var_t new_value;
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700181 int err;
Max Krasnyansky18404752008-05-29 11:02:52 -0700182
Rusty Russelld036e672009-01-01 10:12:26 +1030183 if (!alloc_cpumask_var(&new_value, GFP_KERNEL))
184 return -ENOMEM;
Max Krasnyansky18404752008-05-29 11:02:52 -0700185
Rusty Russelld036e672009-01-01 10:12:26 +1030186 err = cpumask_parse_user(buffer, count, new_value);
187 if (err)
188 goto out;
189
190 if (!is_affinity_mask_valid(new_value)) {
191 err = -EINVAL;
192 goto out;
193 }
Max Krasnyansky18404752008-05-29 11:02:52 -0700194
195 /*
196 * Do not allow disabling IRQs completely - it's a too easy
197 * way to make the system unusable accidentally :-) At least
198 * one online CPU still has to be targeted.
199 */
Rusty Russelld036e672009-01-01 10:12:26 +1030200 if (!cpumask_intersects(new_value, cpu_online_mask)) {
201 err = -EINVAL;
202 goto out;
203 }
Max Krasnyansky18404752008-05-29 11:02:52 -0700204
Rusty Russelld036e672009-01-01 10:12:26 +1030205 cpumask_copy(irq_default_affinity, new_value);
206 err = count;
Max Krasnyansky18404752008-05-29 11:02:52 -0700207
Rusty Russelld036e672009-01-01 10:12:26 +1030208out:
209 free_cpumask_var(new_value);
210 return err;
Max Krasnyansky18404752008-05-29 11:02:52 -0700211}
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700212
213static int default_affinity_open(struct inode *inode, struct file *file)
214{
Thomas Gleixner34769942009-11-20 11:46:21 +0100215 return single_open(file, default_affinity_show, PDE(inode)->data);
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700216}
217
218static const struct file_operations default_affinity_proc_fops = {
219 .open = default_affinity_open,
220 .read = seq_read,
221 .llseek = seq_lseek,
222 .release = single_release,
223 .write = default_affinity_write,
224};
Dimitri Sivanich92d6b712010-03-11 14:08:56 -0800225
226static int irq_node_proc_show(struct seq_file *m, void *v)
227{
228 struct irq_desc *desc = irq_to_desc((long) m->private);
229
Thomas Gleixner6b8ff312010-10-01 12:58:38 +0200230 seq_printf(m, "%d\n", desc->irq_data.node);
Dimitri Sivanich92d6b712010-03-11 14:08:56 -0800231 return 0;
232}
233
234static int irq_node_proc_open(struct inode *inode, struct file *file)
235{
236 return single_open(file, irq_node_proc_show, PDE(inode)->data);
237}
238
239static const struct file_operations irq_node_proc_fops = {
240 .open = irq_node_proc_open,
241 .read = seq_read,
242 .llseek = seq_lseek,
243 .release = single_release,
244};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245#endif
246
Alexey Dobriyana1afb632009-08-28 22:19:33 +0400247static int irq_spurious_proc_show(struct seq_file *m, void *v)
Andi Kleen96d97cf2008-01-30 13:32:48 +0100248{
Alexey Dobriyana1afb632009-08-28 22:19:33 +0400249 struct irq_desc *desc = irq_to_desc((long) m->private);
250
251 seq_printf(m, "count %u\n" "unhandled %u\n" "last_unhandled %u ms\n",
252 desc->irq_count, desc->irqs_unhandled,
253 jiffies_to_msecs(desc->last_unhandled));
254 return 0;
Andi Kleen96d97cf2008-01-30 13:32:48 +0100255}
256
Alexey Dobriyana1afb632009-08-28 22:19:33 +0400257static int irq_spurious_proc_open(struct inode *inode, struct file *file)
258{
Kenji Kaneshige25c91702010-11-30 17:36:08 +0900259 return single_open(file, irq_spurious_proc_show, PDE(inode)->data);
Alexey Dobriyana1afb632009-08-28 22:19:33 +0400260}
261
262static const struct file_operations irq_spurious_proc_fops = {
263 .open = irq_spurious_proc_open,
264 .read = seq_read,
265 .llseek = seq_lseek,
266 .release = single_release,
267};
268
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269#define MAX_NAMELEN 128
270
271static int name_unique(unsigned int irq, struct irqaction *new_action)
272{
Yinghai Lu08678b02008-08-19 20:50:05 -0700273 struct irq_desc *desc = irq_to_desc(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274 struct irqaction *action;
Dmitry Adamushkod2d94332007-05-08 00:27:31 -0700275 unsigned long flags;
276 int ret = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277
Thomas Gleixner239007b2009-11-17 16:46:45 +0100278 raw_spin_lock_irqsave(&desc->lock, flags);
Dmitry Adamushkod2d94332007-05-08 00:27:31 -0700279 for (action = desc->action ; action; action = action->next) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280 if ((action != new_action) && action->name &&
Dmitry Adamushkod2d94332007-05-08 00:27:31 -0700281 !strcmp(new_action->name, action->name)) {
282 ret = 0;
283 break;
284 }
285 }
Thomas Gleixner239007b2009-11-17 16:46:45 +0100286 raw_spin_unlock_irqrestore(&desc->lock, flags);
Dmitry Adamushkod2d94332007-05-08 00:27:31 -0700287 return ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288}
289
290void register_handler_proc(unsigned int irq, struct irqaction *action)
291{
292 char name [MAX_NAMELEN];
Yinghai Lu08678b02008-08-19 20:50:05 -0700293 struct irq_desc *desc = irq_to_desc(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294
Yinghai Lu08678b02008-08-19 20:50:05 -0700295 if (!desc->dir || action->dir || !action->name ||
Linus Torvalds1da177e2005-04-16 15:20:36 -0700296 !name_unique(irq, action))
297 return;
298
299 memset(name, 0, MAX_NAMELEN);
300 snprintf(name, MAX_NAMELEN, "%s", action->name);
301
302 /* create /proc/irq/1234/handler/ */
Yinghai Lu08678b02008-08-19 20:50:05 -0700303 action->dir = proc_mkdir(name, desc->dir);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304}
305
306#undef MAX_NAMELEN
307
308#define MAX_NAMELEN 10
309
Yinghai Lu2c6927a2008-08-19 20:50:11 -0700310void register_irq_proc(unsigned int irq, struct irq_desc *desc)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311{
312 char name [MAX_NAMELEN];
313
Thomas Gleixner6b8ff312010-10-01 12:58:38 +0200314 if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip) || desc->dir)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315 return;
316
317 memset(name, 0, MAX_NAMELEN);
318 sprintf(name, "%d", irq);
319
320 /* create /proc/irq/1234 */
Yinghai Lu08678b02008-08-19 20:50:05 -0700321 desc->dir = proc_mkdir(name, root_irq_dir);
Cyrill Gorcunovc82a43d2009-10-26 23:28:11 +0300322 if (!desc->dir)
323 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324
325#ifdef CONFIG_SMP
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700326 /* create /proc/irq/<irq>/smp_affinity */
Yinghai Lu08678b02008-08-19 20:50:05 -0700327 proc_create_data("smp_affinity", 0600, desc->dir,
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700328 &irq_affinity_proc_fops, (void *)(long)irq);
Dimitri Sivanich92d6b712010-03-11 14:08:56 -0800329
Peter P Waskiewicz Jre7a297b2010-04-30 14:44:50 -0700330 /* create /proc/irq/<irq>/affinity_hint */
331 proc_create_data("affinity_hint", 0400, desc->dir,
332 &irq_affinity_hint_proc_fops, (void *)(long)irq);
333
Mike Travis4b060422011-05-24 17:13:12 -0700334 /* create /proc/irq/<irq>/smp_affinity_list */
335 proc_create_data("smp_affinity_list", 0600, desc->dir,
336 &irq_affinity_list_proc_fops, (void *)(long)irq);
337
Dimitri Sivanich92d6b712010-03-11 14:08:56 -0800338 proc_create_data("node", 0444, desc->dir,
339 &irq_node_proc_fops, (void *)(long)irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340#endif
Andi Kleen96d97cf2008-01-30 13:32:48 +0100341
Alexey Dobriyana1afb632009-08-28 22:19:33 +0400342 proc_create_data("spurious", 0444, desc->dir,
343 &irq_spurious_proc_fops, (void *)(long)irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344}
345
Thomas Gleixner13bfe992010-09-30 02:46:07 +0200346void unregister_irq_proc(unsigned int irq, struct irq_desc *desc)
347{
348 char name [MAX_NAMELEN];
349
350 if (!root_irq_dir || !desc->dir)
351 return;
352#ifdef CONFIG_SMP
353 remove_proc_entry("smp_affinity", desc->dir);
354 remove_proc_entry("affinity_hint", desc->dir);
Yinghai Ludef945e2011-05-25 22:09:40 -0700355 remove_proc_entry("smp_affinity_list", desc->dir);
Thomas Gleixner13bfe992010-09-30 02:46:07 +0200356 remove_proc_entry("node", desc->dir);
357#endif
358 remove_proc_entry("spurious", desc->dir);
359
360 memset(name, 0, MAX_NAMELEN);
361 sprintf(name, "%u", irq);
362 remove_proc_entry(name, root_irq_dir);
363}
364
Linus Torvalds1da177e2005-04-16 15:20:36 -0700365#undef MAX_NAMELEN
366
367void unregister_handler_proc(unsigned int irq, struct irqaction *action)
368{
Yinghai Lu08678b02008-08-19 20:50:05 -0700369 if (action->dir) {
370 struct irq_desc *desc = irq_to_desc(irq);
Thomas Gleixnerd3c60042008-10-16 09:55:00 +0200371
Yinghai Lu08678b02008-08-19 20:50:05 -0700372 remove_proc_entry(action->dir->name, desc->dir);
373 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374}
375
roel kluin3786fc72008-10-21 19:49:09 -0400376static void register_default_affinity_proc(void)
Max Krasnyansky18404752008-05-29 11:02:52 -0700377{
378#ifdef CONFIG_SMP
Alexey Dobriyanf18e4392008-08-12 15:09:03 -0700379 proc_create("irq/default_smp_affinity", 0600, NULL,
380 &default_affinity_proc_fops);
Max Krasnyansky18404752008-05-29 11:02:52 -0700381#endif
382}
383
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384void init_irq_proc(void)
385{
Yinghai Lu2c6927a2008-08-19 20:50:11 -0700386 unsigned int irq;
387 struct irq_desc *desc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388
389 /* create /proc/irq */
390 root_irq_dir = proc_mkdir("irq", NULL);
391 if (!root_irq_dir)
392 return;
393
Max Krasnyansky18404752008-05-29 11:02:52 -0700394 register_default_affinity_proc();
395
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396 /*
397 * Create entries for all existing IRQs.
398 */
Yinghai Lu0b8f1ef2008-12-05 18:58:31 -0800399 for_each_irq_desc(irq, desc) {
400 if (!desc)
401 continue;
402
Yinghai Lu2c6927a2008-08-19 20:50:11 -0700403 register_irq_proc(irq, desc);
Yinghai Lu0b8f1ef2008-12-05 18:58:31 -0800404 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405}
406
Thomas Gleixnerc78b9b62010-12-16 17:21:47 +0100407#ifdef CONFIG_GENERIC_IRQ_SHOW
408
409int __weak arch_show_interrupts(struct seq_file *p, int prec)
410{
411 return 0;
412}
413
Thomas Gleixnera6e120e2011-03-25 22:20:51 +0100414#ifndef ACTUAL_NR_IRQS
415# define ACTUAL_NR_IRQS nr_irqs
416#endif
417
Thomas Gleixnerc78b9b62010-12-16 17:21:47 +0100418int show_interrupts(struct seq_file *p, void *v)
419{
420 static int prec;
421
422 unsigned long flags, any_count = 0;
423 int i = *(loff_t *) v, j;
424 struct irqaction *action;
425 struct irq_desc *desc;
426
Thomas Gleixnera6e120e2011-03-25 22:20:51 +0100427 if (i > ACTUAL_NR_IRQS)
Thomas Gleixnerc78b9b62010-12-16 17:21:47 +0100428 return 0;
429
Thomas Gleixnera6e120e2011-03-25 22:20:51 +0100430 if (i == ACTUAL_NR_IRQS)
Thomas Gleixnerc78b9b62010-12-16 17:21:47 +0100431 return arch_show_interrupts(p, prec);
432
433 /* print header and calculate the width of the first column */
434 if (i == 0) {
435 for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
436 j *= 10;
437
438 seq_printf(p, "%*s", prec + 8, "");
439 for_each_online_cpu(j)
440 seq_printf(p, "CPU%-8d", j);
441 seq_putc(p, '\n');
442 }
443
444 desc = irq_to_desc(i);
445 if (!desc)
446 return 0;
447
448 raw_spin_lock_irqsave(&desc->lock, flags);
449 for_each_online_cpu(j)
450 any_count |= kstat_irqs_cpu(i, j);
451 action = desc->action;
452 if (!action && !any_count)
453 goto out;
454
455 seq_printf(p, "%*d: ", prec, i);
456 for_each_online_cpu(j)
457 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
Thomas Gleixnerab7798f2011-03-25 16:48:50 +0100458
459 if (desc->irq_data.chip) {
460 if (desc->irq_data.chip->irq_print_chip)
461 desc->irq_data.chip->irq_print_chip(&desc->irq_data, p);
462 else if (desc->irq_data.chip->name)
463 seq_printf(p, " %8s", desc->irq_data.chip->name);
464 else
465 seq_printf(p, " %8s", "-");
466 } else {
467 seq_printf(p, " %8s", "None");
468 }
Geert Uytterhoeven94b2c362011-04-30 22:56:20 +0200469#ifdef CONFIG_GENERIC_IRQ_SHOW_LEVEL
Thomas Gleixnerab7798f2011-03-25 16:48:50 +0100470 seq_printf(p, " %-8s", irqd_is_level_type(&desc->irq_data) ? "Level" : "Edge");
471#endif
Thomas Gleixneree0401e2011-03-17 13:36:57 +0100472 if (desc->name)
473 seq_printf(p, "-%-8s", desc->name);
Thomas Gleixnerc78b9b62010-12-16 17:21:47 +0100474
475 if (action) {
476 seq_printf(p, " %s", action->name);
477 while ((action = action->next) != NULL)
478 seq_printf(p, ", %s", action->name);
479 }
480
481 seq_putc(p, '\n');
482out:
483 raw_spin_unlock_irqrestore(&desc->lock, flags);
484 return 0;
485}
486#endif