Lines Matching +full:interrupt +full:- +full:affinity

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar
12 #include <linux/interrupt.h>
22 * concurrent free of the interrupt descriptor. remove_proc_entry()
26 * We remove the proc entries first and then delete the interrupt
40 AFFINITY, enumerator
48 struct irq_desc *desc = irq_to_desc((long)m->private); in show_irq_affinity()
52 case AFFINITY: in show_irq_affinity()
54 mask = desc->irq_common_data.affinity; in show_irq_affinity()
55 if (irq_move_pending(&desc->irq_data)) in show_irq_affinity()
61 mask = irq_data_get_effective_affinity_mask(&desc->irq_data); in show_irq_affinity()
65 return -EINVAL; in show_irq_affinity()
73 case AFFINITY: in show_irq_affinity()
83 struct irq_desc *desc = irq_to_desc((long)m->private); in irq_affinity_hint_proc_show()
88 return -ENOMEM; in irq_affinity_hint_proc_show()
90 raw_spin_lock_irqsave(&desc->lock, flags); in irq_affinity_hint_proc_show()
91 if (desc->affinity_hint) in irq_affinity_hint_proc_show()
92 cpumask_copy(mask, desc->affinity_hint); in irq_affinity_hint_proc_show()
93 raw_spin_unlock_irqrestore(&desc->lock, flags); in irq_affinity_hint_proc_show()
104 return show_irq_affinity(AFFINITY, m); in irq_affinity_proc_show()
116 * If the interrupt is started up already then this fails. The in irq_select_affinity_usr()
117 * interrupt is assigned to an online CPU already. There is no in irq_select_affinity_usr()
121 * If not then any change to the affinity is pointless because the in irq_select_affinity_usr()
125 return -EINVAL; in irq_select_affinity_usr()
128 /* ALPHA magic affinity auto selector. Keep it for historical reasons. */
143 return -EPERM; in write_irq_affinity()
146 return -ENOMEM; in write_irq_affinity()
156 * Do not allow disabling IRQs completely - it's a too easy in write_irq_affinity()
157 * way to make the system unusable accidentally :-) At least in write_irq_affinity()
162 * Special case for empty set - allow the architecture code in write_irq_affinity()
163 * to set default SMP affinity. in write_irq_affinity()
165 err = irq_select_affinity_usr(irq) ? -EINVAL : count; in write_irq_affinity()
240 return -ENOMEM; in default_affinity_write()
247 * Do not allow disabling IRQs completely - it's a too easy in default_affinity_write()
248 * way to make the system unusable accidentally :-) At least in default_affinity_write()
252 err = -EINVAL; in default_affinity_write()
279 struct irq_desc *desc = irq_to_desc((long) m->private); in irq_node_proc_show()
288 struct irq_desc *desc = irq_to_desc((long) m->private); in irq_spurious_proc_show()
291 desc->irq_count, desc->irqs_unhandled, in irq_spurious_proc_show()
292 jiffies_to_msecs(desc->last_unhandled)); in irq_spurious_proc_show()
305 raw_spin_lock_irqsave(&desc->lock, flags); in name_unique()
307 if ((action != new_action) && action->name && in name_unique()
308 !strcmp(new_action->name, action->name)) { in name_unique()
313 raw_spin_unlock_irqrestore(&desc->lock, flags); in name_unique()
322 if (!desc->dir || action->dir || !action->name || in register_handler_proc()
326 snprintf(name, MAX_NAMELEN, "%s", action->name); in register_handler_proc()
329 action->dir = proc_mkdir(name, desc->dir); in register_handler_proc()
342 if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip)) in register_irq_proc()
352 if (desc->dir) in register_irq_proc()
358 desc->dir = proc_mkdir(name, root_irq_dir); in register_irq_proc()
359 if (!desc->dir) in register_irq_proc()
365 if (irq_can_set_affinity_usr(desc->irq_data.irq)) in register_irq_proc()
369 proc_create_data("smp_affinity", umode, desc->dir, in register_irq_proc()
373 proc_create_single_data("affinity_hint", 0444, desc->dir, in register_irq_proc()
377 proc_create_data("smp_affinity_list", umode, desc->dir, in register_irq_proc()
380 proc_create_single_data("node", 0444, desc->dir, irq_node_proc_show, in register_irq_proc()
383 proc_create_single_data("effective_affinity", 0444, desc->dir, in register_irq_proc()
385 proc_create_single_data("effective_affinity_list", 0444, desc->dir, in register_irq_proc()
389 proc_create_single_data("spurious", 0444, desc->dir, in register_irq_proc()
400 if (!root_irq_dir || !desc->dir) in unregister_irq_proc()
403 remove_proc_entry("smp_affinity", desc->dir); in unregister_irq_proc()
404 remove_proc_entry("affinity_hint", desc->dir); in unregister_irq_proc()
405 remove_proc_entry("smp_affinity_list", desc->dir); in unregister_irq_proc()
406 remove_proc_entry("node", desc->dir); in unregister_irq_proc()
408 remove_proc_entry("effective_affinity", desc->dir); in unregister_irq_proc()
409 remove_proc_entry("effective_affinity_list", desc->dir); in unregister_irq_proc()
412 remove_proc_entry("spurious", desc->dir); in unregister_irq_proc()
422 proc_remove(action->dir); in unregister_handler_proc()
486 seq_printf(p, "CPU%-8d", j); in show_interrupts()
495 if (!desc->action || irq_desc_is_chained(desc) || !desc->kstat_irqs) in show_interrupts()
500 unsigned int cnt = desc->kstat_irqs ? per_cpu(desc->kstat_irqs->cnt, j) : 0; in show_interrupts()
506 raw_spin_lock_irqsave(&desc->lock, flags); in show_interrupts()
507 if (desc->irq_data.chip) { in show_interrupts()
508 if (desc->irq_data.chip->irq_print_chip) in show_interrupts()
509 desc->irq_data.chip->irq_print_chip(&desc->irq_data, p); in show_interrupts()
510 else if (desc->irq_data.chip->name) in show_interrupts()
511 seq_printf(p, "%8s", desc->irq_data.chip->name); in show_interrupts()
513 seq_printf(p, "%8s", "-"); in show_interrupts()
517 if (desc->irq_data.domain) in show_interrupts()
518 seq_printf(p, " %*lu", prec, desc->irq_data.hwirq); in show_interrupts()
522 seq_printf(p, " %-8s", irqd_is_level_type(&desc->irq_data) ? "Level" : "Edge"); in show_interrupts()
524 if (desc->name) in show_interrupts()
525 seq_printf(p, "-%-8s", desc->name); in show_interrupts()
527 action = desc->action; in show_interrupts()
529 seq_printf(p, " %s", action->name); in show_interrupts()
530 while ((action = action->next) != NULL) in show_interrupts()
531 seq_printf(p, ", %s", action->name); in show_interrupts()
535 raw_spin_unlock_irqrestore(&desc->lock, flags); in show_interrupts()