| .. | .. |
|---|
| 100 | 100 | return 0; |
|---|
| 101 | 101 | } |
|---|
| 102 | 102 | |
|---|
| 103 | | -#ifndef is_affinity_mask_valid |
|---|
| 104 | | -#define is_affinity_mask_valid(val) 1 |
|---|
| 105 | | -#endif |
|---|
| 106 | | - |
|---|
| 107 | 103 | int no_irq_affinity; |
|---|
| 108 | 104 | static int irq_affinity_proc_show(struct seq_file *m, void *v) |
|---|
| 109 | 105 | { |
|---|
| .. | .. |
|---|
| 158 | 154 | if (err) |
|---|
| 159 | 155 | goto free_cpumask; |
|---|
| 160 | 156 | |
|---|
| 161 | | - if (!is_affinity_mask_valid(new_value)) { |
|---|
| 162 | | - err = -EINVAL; |
|---|
| 163 | | - goto free_cpumask; |
|---|
| 164 | | - } |
|---|
| 165 | | - |
|---|
| 166 | 157 | /* |
|---|
| 167 | 158 | * Do not allow disabling IRQs completely - it's a too easy |
|---|
| 168 | 159 | * way to make the system unusable accidentally :-) At least |
|---|
| 169 | | - * one online CPU still has to be targeted. |
|---|
| 160 | + * one active CPU still has to be targeted. |
|---|
| 170 | 161 | */ |
|---|
| 171 | | - if (!cpumask_intersects(new_value, cpu_online_mask)) { |
|---|
| 162 | + if (!cpumask_intersects(new_value, cpu_active_mask)) { |
|---|
| 172 | 163 | /* |
|---|
| 173 | 164 | * Special case for empty set - allow the architecture code |
|---|
| 174 | 165 | * to set default SMP affinity. |
|---|
| .. | .. |
|---|
| 207 | 198 | return single_open(file, irq_affinity_list_proc_show, PDE_DATA(inode)); |
|---|
| 208 | 199 | } |
|---|
| 209 | 200 | |
|---|
| 210 | | -static const struct file_operations irq_affinity_proc_fops = { |
|---|
| 211 | | - .open = irq_affinity_proc_open, |
|---|
| 212 | | - .read = seq_read, |
|---|
| 213 | | - .llseek = seq_lseek, |
|---|
| 214 | | - .release = single_release, |
|---|
| 215 | | - .write = irq_affinity_proc_write, |
|---|
| 201 | +static const struct proc_ops irq_affinity_proc_ops = { |
|---|
| 202 | + .proc_open = irq_affinity_proc_open, |
|---|
| 203 | + .proc_read = seq_read, |
|---|
| 204 | + .proc_lseek = seq_lseek, |
|---|
| 205 | + .proc_release = single_release, |
|---|
| 206 | + .proc_write = irq_affinity_proc_write, |
|---|
| 216 | 207 | }; |
|---|
| 217 | 208 | |
|---|
| 218 | | -static const struct file_operations irq_affinity_list_proc_fops = { |
|---|
| 219 | | - .open = irq_affinity_list_proc_open, |
|---|
| 220 | | - .read = seq_read, |
|---|
| 221 | | - .llseek = seq_lseek, |
|---|
| 222 | | - .release = single_release, |
|---|
| 223 | | - .write = irq_affinity_list_proc_write, |
|---|
| 209 | +static const struct proc_ops irq_affinity_list_proc_ops = { |
|---|
| 210 | + .proc_open = irq_affinity_list_proc_open, |
|---|
| 211 | + .proc_read = seq_read, |
|---|
| 212 | + .proc_lseek = seq_lseek, |
|---|
| 213 | + .proc_release = single_release, |
|---|
| 214 | + .proc_write = irq_affinity_list_proc_write, |
|---|
| 224 | 215 | }; |
|---|
| 225 | 216 | |
|---|
| 226 | 217 | #ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK |
|---|
| .. | .. |
|---|
| 254 | 245 | if (err) |
|---|
| 255 | 246 | goto out; |
|---|
| 256 | 247 | |
|---|
| 257 | | - if (!is_affinity_mask_valid(new_value)) { |
|---|
| 258 | | - err = -EINVAL; |
|---|
| 259 | | - goto out; |
|---|
| 260 | | - } |
|---|
| 261 | | - |
|---|
| 262 | 248 | /* |
|---|
| 263 | 249 | * Do not allow disabling IRQs completely - it's a too easy |
|---|
| 264 | 250 | * way to make the system unusable accidentally :-) At least |
|---|
| .. | .. |
|---|
| 282 | 268 | return single_open(file, default_affinity_show, PDE_DATA(inode)); |
|---|
| 283 | 269 | } |
|---|
| 284 | 270 | |
|---|
| 285 | | -static const struct file_operations default_affinity_proc_fops = { |
|---|
| 286 | | - .open = default_affinity_open, |
|---|
| 287 | | - .read = seq_read, |
|---|
| 288 | | - .llseek = seq_lseek, |
|---|
| 289 | | - .release = single_release, |
|---|
| 290 | | - .write = default_affinity_write, |
|---|
| 271 | +static const struct proc_ops default_affinity_proc_ops = { |
|---|
| 272 | + .proc_open = default_affinity_open, |
|---|
| 273 | + .proc_read = seq_read, |
|---|
| 274 | + .proc_lseek = seq_lseek, |
|---|
| 275 | + .proc_release = single_release, |
|---|
| 276 | + .proc_write = default_affinity_write, |
|---|
| 291 | 277 | }; |
|---|
| 292 | 278 | |
|---|
| 293 | 279 | static int irq_node_proc_show(struct seq_file *m, void *v) |
|---|
| .. | .. |
|---|
| 378 | 364 | #ifdef CONFIG_SMP |
|---|
| 379 | 365 | /* create /proc/irq/<irq>/smp_affinity */ |
|---|
| 380 | 366 | proc_create_data("smp_affinity", 0644, desc->dir, |
|---|
| 381 | | - &irq_affinity_proc_fops, irqp); |
|---|
| 367 | + &irq_affinity_proc_ops, irqp); |
|---|
| 382 | 368 | |
|---|
| 383 | 369 | /* create /proc/irq/<irq>/affinity_hint */ |
|---|
| 384 | 370 | proc_create_single_data("affinity_hint", 0444, desc->dir, |
|---|
| .. | .. |
|---|
| 386 | 372 | |
|---|
| 387 | 373 | /* create /proc/irq/<irq>/smp_affinity_list */ |
|---|
| 388 | 374 | proc_create_data("smp_affinity_list", 0644, desc->dir, |
|---|
| 389 | | - &irq_affinity_list_proc_fops, irqp); |
|---|
| 375 | + &irq_affinity_list_proc_ops, irqp); |
|---|
| 390 | 376 | |
|---|
| 391 | 377 | proc_create_single_data("node", 0444, desc->dir, irq_node_proc_show, |
|---|
| 392 | 378 | irqp); |
|---|
| .. | .. |
|---|
| 437 | 423 | { |
|---|
| 438 | 424 | #ifdef CONFIG_SMP |
|---|
| 439 | 425 | proc_create("irq/default_smp_affinity", 0644, NULL, |
|---|
| 440 | | - &default_affinity_proc_fops); |
|---|
| 426 | + &default_affinity_proc_ops); |
|---|
| 441 | 427 | #endif |
|---|
| 442 | 428 | } |
|---|
| 443 | 429 | |
|---|
| .. | .. |
|---|
| 499 | 485 | |
|---|
| 500 | 486 | rcu_read_lock(); |
|---|
| 501 | 487 | desc = irq_to_desc(i); |
|---|
| 502 | | - if (!desc) |
|---|
| 488 | + if (!desc || irq_settings_is_hidden(desc)) |
|---|
| 503 | 489 | goto outsparse; |
|---|
| 504 | 490 | |
|---|
| 505 | 491 | if (desc->kstat_irqs) |
|---|