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()
56 if (irqd_is_setaffinity_pending(&desc->irq_data)) in show_irq_affinity()
57 mask = desc->pending_mask; in show_irq_affinity()
63 mask = irq_data_get_effective_affinity_mask(&desc->irq_data); in show_irq_affinity()
67 return -EINVAL; in show_irq_affinity()
75 case AFFINITY: in show_irq_affinity()
85 struct irq_desc *desc = irq_to_desc((long)m->private); in irq_affinity_hint_proc_show()
90 return -ENOMEM; in irq_affinity_hint_proc_show()
92 raw_spin_lock_irqsave(&desc->lock, flags); in irq_affinity_hint_proc_show()
93 if (desc->affinity_hint) in irq_affinity_hint_proc_show()
94 cpumask_copy(mask, desc->affinity_hint); in irq_affinity_hint_proc_show()
95 raw_spin_unlock_irqrestore(&desc->lock, flags); in irq_affinity_hint_proc_show()
106 return show_irq_affinity(AFFINITY, m); in irq_affinity_proc_show()
118 * If the interrupt is started up already then this fails. The in irq_select_affinity_usr()
119 * interrupt is assigned to an online CPU already. There is no in irq_select_affinity_usr()
123 * If not then any change to the affinity is pointless because the in irq_select_affinity_usr()
127 return -EINVAL; in irq_select_affinity_usr()
130 /* ALPHA magic affinity auto selector. Keep it for historical reasons. */
145 return -EIO; in write_irq_affinity()
148 return -ENOMEM; in write_irq_affinity()
158 * Do not allow disabling IRQs completely - it's a too easy in write_irq_affinity()
159 * way to make the system unusable accidentally :-) At least in write_irq_affinity()
164 * Special case for empty set - allow the architecture code in write_irq_affinity()
165 * to set default SMP affinity. in write_irq_affinity()
167 err = irq_select_affinity_usr(irq) ? -EINVAL : count; in write_irq_affinity()
242 return -ENOMEM; in default_affinity_write()
249 * Do not allow disabling IRQs completely - it's a too easy in default_affinity_write()
250 * way to make the system unusable accidentally :-) At least in default_affinity_write()
254 err = -EINVAL; in default_affinity_write()
281 struct irq_desc *desc = irq_to_desc((long) m->private); in irq_node_proc_show()
290 struct irq_desc *desc = irq_to_desc((long) m->private); in irq_spurious_proc_show()
293 desc->irq_count, desc->irqs_unhandled, in irq_spurious_proc_show()
294 jiffies_to_msecs(desc->last_unhandled)); in irq_spurious_proc_show()
307 raw_spin_lock_irqsave(&desc->lock, flags); in name_unique()
309 if ((action != new_action) && action->name && in name_unique()
310 !strcmp(new_action->name, action->name)) { in name_unique()
315 raw_spin_unlock_irqrestore(&desc->lock, flags); in name_unique()
324 if (!desc->dir || action->dir || !action->name || in register_handler_proc()
328 snprintf(name, MAX_NAMELEN, "%s", action->name); in register_handler_proc()
331 action->dir = proc_mkdir(name, desc->dir); in register_handler_proc()
344 if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip)) in register_irq_proc()
354 if (desc->dir) in register_irq_proc()
360 desc->dir = proc_mkdir(name, root_irq_dir); in register_irq_proc()
361 if (!desc->dir) in register_irq_proc()
366 proc_create_data("smp_affinity", 0644, desc->dir, in register_irq_proc()
370 proc_create_single_data("affinity_hint", 0444, desc->dir, in register_irq_proc()
374 proc_create_data("smp_affinity_list", 0644, desc->dir, in register_irq_proc()
377 proc_create_single_data("node", 0444, desc->dir, irq_node_proc_show, in register_irq_proc()
380 proc_create_single_data("effective_affinity", 0444, desc->dir, in register_irq_proc()
382 proc_create_single_data("effective_affinity_list", 0444, desc->dir, in register_irq_proc()
386 proc_create_single_data("spurious", 0444, desc->dir, in register_irq_proc()
397 if (!root_irq_dir || !desc->dir) in unregister_irq_proc()
400 remove_proc_entry("smp_affinity", desc->dir); in unregister_irq_proc()
401 remove_proc_entry("affinity_hint", desc->dir); in unregister_irq_proc()
402 remove_proc_entry("smp_affinity_list", desc->dir); in unregister_irq_proc()
403 remove_proc_entry("node", desc->dir); in unregister_irq_proc()
405 remove_proc_entry("effective_affinity", desc->dir); in unregister_irq_proc()
406 remove_proc_entry("effective_affinity_list", desc->dir); in unregister_irq_proc()
409 remove_proc_entry("spurious", desc->dir); in unregister_irq_proc()
419 proc_remove(action->dir); in unregister_handler_proc()
482 seq_printf(p, "CPU%-8d", j); in show_interrupts()
491 if (desc->kstat_irqs) { in show_interrupts()
493 any_count |= data_race(*per_cpu_ptr(desc->kstat_irqs, j)); in show_interrupts()
496 if ((!desc->action || irq_desc_is_chained(desc)) && !any_count) in show_interrupts()
501 seq_printf(p, "%10u ", desc->kstat_irqs ? in show_interrupts()
502 *per_cpu_ptr(desc->kstat_irqs, j) : 0); in show_interrupts()
504 raw_spin_lock_irqsave(&desc->lock, flags); in show_interrupts()
505 if (desc->irq_data.chip) { in show_interrupts()
506 if (desc->irq_data.chip->irq_print_chip) in show_interrupts()
507 desc->irq_data.chip->irq_print_chip(&desc->irq_data, p); in show_interrupts()
508 else if (desc->irq_data.chip->name) in show_interrupts()
509 seq_printf(p, " %8s", desc->irq_data.chip->name); in show_interrupts()
511 seq_printf(p, " %8s", "-"); in show_interrupts()
515 if (desc->irq_data.domain) in show_interrupts()
516 seq_printf(p, " %*lu", prec, desc->irq_data.hwirq); in show_interrupts()
520 seq_printf(p, " %-8s", irqd_is_level_type(&desc->irq_data) ? "Level" : "Edge"); in show_interrupts()
522 if (desc->name) in show_interrupts()
523 seq_printf(p, "-%-8s", desc->name); in show_interrupts()
525 action = desc->action; in show_interrupts()
527 seq_printf(p, " %s", action->name); in show_interrupts()
528 while ((action = action->next) != NULL) in show_interrupts()
529 seq_printf(p, ", %s", action->name); in show_interrupts()
533 raw_spin_unlock_irqrestore(&desc->lock, flags); in show_interrupts()