diff options
Diffstat (limited to 'kernel/irq/proc.c')
-rw-r--r-- | kernel/irq/proc.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index d03b5eef8ce0..607c7809ad01 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c | |||
@@ -12,18 +12,15 @@ | |||
12 | 12 | ||
13 | #include "internals.h" | 13 | #include "internals.h" |
14 | 14 | ||
15 | static struct proc_dir_entry *root_irq_dir, *irq_dir[NR_IRQS]; | 15 | static struct proc_dir_entry *root_irq_dir; |
16 | 16 | ||
17 | #ifdef CONFIG_SMP | 17 | #ifdef CONFIG_SMP |
18 | 18 | ||
19 | /* | ||
20 | * The /proc/irq/<irq>/smp_affinity values: | ||
21 | */ | ||
22 | static struct proc_dir_entry *smp_affinity_entry[NR_IRQS]; | ||
23 | |||
24 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 19 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
25 | void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val) | 20 | void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val) |
26 | { | 21 | { |
22 | set_balance_irq_affinity(irq, mask_val); | ||
23 | |||
27 | /* | 24 | /* |
28 | * Save these away for later use. Re-progam when the | 25 | * Save these away for later use. Re-progam when the |
29 | * interrupt is pending | 26 | * interrupt is pending |
@@ -33,15 +30,16 @@ void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val) | |||
33 | #else | 30 | #else |
34 | void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val) | 31 | void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val) |
35 | { | 32 | { |
36 | irq_affinity[irq] = mask_val; | 33 | set_balance_irq_affinity(irq, mask_val); |
37 | irq_desc[irq].handler->set_affinity(irq, mask_val); | 34 | irq_desc[irq].affinity = mask_val; |
35 | irq_desc[irq].chip->set_affinity(irq, mask_val); | ||
38 | } | 36 | } |
39 | #endif | 37 | #endif |
40 | 38 | ||
41 | static int irq_affinity_read_proc(char *page, char **start, off_t off, | 39 | static int irq_affinity_read_proc(char *page, char **start, off_t off, |
42 | int count, int *eof, void *data) | 40 | int count, int *eof, void *data) |
43 | { | 41 | { |
44 | int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]); | 42 | int len = cpumask_scnprintf(page, count, irq_desc[(long)data].affinity); |
45 | 43 | ||
46 | if (count - len < 2) | 44 | if (count - len < 2) |
47 | return -EINVAL; | 45 | return -EINVAL; |
@@ -56,7 +54,7 @@ static int irq_affinity_write_proc(struct file *file, const char __user *buffer, | |||
56 | unsigned int irq = (int)(long)data, full_count = count, err; | 54 | unsigned int irq = (int)(long)data, full_count = count, err; |
57 | cpumask_t new_value, tmp; | 55 | cpumask_t new_value, tmp; |
58 | 56 | ||
59 | if (!irq_desc[irq].handler->set_affinity || no_irq_affinity) | 57 | if (!irq_desc[irq].chip->set_affinity || no_irq_affinity) |
60 | return -EIO; | 58 | return -EIO; |
61 | 59 | ||
62 | err = cpumask_parse(buffer, count, new_value); | 60 | err = cpumask_parse(buffer, count, new_value); |
@@ -99,7 +97,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) | |||
99 | { | 97 | { |
100 | char name [MAX_NAMELEN]; | 98 | char name [MAX_NAMELEN]; |
101 | 99 | ||
102 | if (!irq_dir[irq] || action->dir || !action->name || | 100 | if (!irq_desc[irq].dir || action->dir || !action->name || |
103 | !name_unique(irq, action)) | 101 | !name_unique(irq, action)) |
104 | return; | 102 | return; |
105 | 103 | ||
@@ -107,7 +105,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) | |||
107 | snprintf(name, MAX_NAMELEN, "%s", action->name); | 105 | snprintf(name, MAX_NAMELEN, "%s", action->name); |
108 | 106 | ||
109 | /* create /proc/irq/1234/handler/ */ | 107 | /* create /proc/irq/1234/handler/ */ |
110 | action->dir = proc_mkdir(name, irq_dir[irq]); | 108 | action->dir = proc_mkdir(name, irq_desc[irq].dir); |
111 | } | 109 | } |
112 | 110 | ||
113 | #undef MAX_NAMELEN | 111 | #undef MAX_NAMELEN |
@@ -119,22 +117,22 @@ void register_irq_proc(unsigned int irq) | |||
119 | char name [MAX_NAMELEN]; | 117 | char name [MAX_NAMELEN]; |
120 | 118 | ||
121 | if (!root_irq_dir || | 119 | if (!root_irq_dir || |
122 | (irq_desc[irq].handler == &no_irq_type) || | 120 | (irq_desc[irq].chip == &no_irq_chip) || |
123 | irq_dir[irq]) | 121 | irq_desc[irq].dir) |
124 | return; | 122 | return; |
125 | 123 | ||
126 | memset(name, 0, MAX_NAMELEN); | 124 | memset(name, 0, MAX_NAMELEN); |
127 | sprintf(name, "%d", irq); | 125 | sprintf(name, "%d", irq); |
128 | 126 | ||
129 | /* create /proc/irq/1234 */ | 127 | /* create /proc/irq/1234 */ |
130 | irq_dir[irq] = proc_mkdir(name, root_irq_dir); | 128 | irq_desc[irq].dir = proc_mkdir(name, root_irq_dir); |
131 | 129 | ||
132 | #ifdef CONFIG_SMP | 130 | #ifdef CONFIG_SMP |
133 | { | 131 | { |
134 | struct proc_dir_entry *entry; | 132 | struct proc_dir_entry *entry; |
135 | 133 | ||
136 | /* create /proc/irq/<irq>/smp_affinity */ | 134 | /* create /proc/irq/<irq>/smp_affinity */ |
137 | entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); | 135 | entry = create_proc_entry("smp_affinity", 0600, irq_desc[irq].dir); |
138 | 136 | ||
139 | if (entry) { | 137 | if (entry) { |
140 | entry->nlink = 1; | 138 | entry->nlink = 1; |
@@ -142,7 +140,6 @@ void register_irq_proc(unsigned int irq) | |||
142 | entry->read_proc = irq_affinity_read_proc; | 140 | entry->read_proc = irq_affinity_read_proc; |
143 | entry->write_proc = irq_affinity_write_proc; | 141 | entry->write_proc = irq_affinity_write_proc; |
144 | } | 142 | } |
145 | smp_affinity_entry[irq] = entry; | ||
146 | } | 143 | } |
147 | #endif | 144 | #endif |
148 | } | 145 | } |
@@ -152,7 +149,7 @@ void register_irq_proc(unsigned int irq) | |||
152 | void unregister_handler_proc(unsigned int irq, struct irqaction *action) | 149 | void unregister_handler_proc(unsigned int irq, struct irqaction *action) |
153 | { | 150 | { |
154 | if (action->dir) | 151 | if (action->dir) |
155 | remove_proc_entry(action->dir->name, irq_dir[irq]); | 152 | remove_proc_entry(action->dir->name, irq_desc[irq].dir); |
156 | } | 153 | } |
157 | 154 | ||
158 | void init_irq_proc(void) | 155 | void init_irq_proc(void) |