Lines Matching +full:- +full:affinity
1 // SPDX-License-Identifier: GPL-2.0
19 /* For !GENERIC_IRQ_EFFECTIVE_AFF_MASK this looks at general affinity mask */
28 * which do not implement effective affinity, but the architecture has in irq_needs_fixup()
29 * enabled the config switch. Use the general affinity mask instead. in irq_needs_fixup()
45 pr_warn("Eff. affinity %*pbl of IRQ %u contains only offline CPUs after offlining CPU %u\n", in irq_needs_fixup()
46 cpumask_pr_args(m), d->irq, cpu); in irq_needs_fixup()
58 const struct cpumask *affinity; in migrate_one_irq() local
64 * still in the radix tree. Also if the chip has no affinity setter, in migrate_one_irq()
67 if (!chip || !chip->irq_set_affinity) { in migrate_one_irq()
68 pr_debug("IRQ %u: Unable to migrate away\n", d->irq); in migrate_one_irq()
82 * - Interrupt is per cpu in migrate_one_irq()
83 * - Interrupt is not started in migrate_one_irq()
84 * - Affinity mask does not include this CPU. in migrate_one_irq()
86 * Note: Do not check desc->action as this might be a chained in migrate_one_irq()
100 * mask, so the last change of the affinity does not get lost. If in migrate_one_irq()
102 * any online CPU, use the current affinity mask. in migrate_one_irq()
105 affinity = irq_desc_get_pending_mask(desc); in migrate_one_irq()
107 affinity = irq_data_get_affinity_mask(d); in migrate_one_irq()
110 if (maskchip && chip->irq_mask) in migrate_one_irq()
111 chip->irq_mask(d); in migrate_one_irq()
113 if (!cpumask_intersects(affinity, cpu_online_mask)) { in migrate_one_irq()
116 * the affinity untouched. in migrate_one_irq()
123 affinity = cpu_online_mask; in migrate_one_irq()
128 * disables the masking of offline CPUs from the supplied affinity in migrate_one_irq()
132 err = irq_do_set_affinity(d, affinity, false); in migrate_one_irq()
135 * If there are online CPUs in the affinity mask, but they have no in migrate_one_irq()
137 * affinity by migrating to any online CPU. in migrate_one_irq()
139 if (err == -ENOSPC && !irqd_affinity_is_managed(d) && affinity != cpu_online_mask) { in migrate_one_irq()
140 pr_debug("IRQ%u: set affinity failed for %*pbl, re-try with online CPUs\n", in migrate_one_irq()
141 d->irq, cpumask_pr_args(affinity)); in migrate_one_irq()
143 affinity = cpu_online_mask; in migrate_one_irq()
146 err = irq_do_set_affinity(d, affinity, false); in migrate_one_irq()
150 pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n", in migrate_one_irq()
151 d->irq, err); in migrate_one_irq()
155 if (maskchip && chip->irq_unmask) in migrate_one_irq()
156 chip->irq_unmask(d); in migrate_one_irq()
162 * irq_migrate_all_off_this_cpu - Migrate irqs away from offline cpu
165 * If the affinity settings do not allow other CPUs, force them onto any
180 raw_spin_lock(&desc->lock); in irq_migrate_all_off_this_cpu()
182 raw_spin_unlock(&desc->lock); in irq_migrate_all_off_this_cpu()
208 const struct cpumask *affinity = irq_data_get_affinity_mask(data); in irq_restore_affinity_of_irq() local
210 if (!irqd_affinity_is_managed(data) || !desc->action || in irq_restore_affinity_of_irq()
211 !irq_data_get_irq_chip(data) || !cpumask_test_cpu(cpu, affinity)) in irq_restore_affinity_of_irq()
218 if (desc->istate & IRQS_SUSPENDED) in irq_restore_affinity_of_irq()
226 * CPU then it is already assigned to a CPU in the affinity in irq_restore_affinity_of_irq()
232 irq_set_affinity_locked(data, affinity, false); in irq_restore_affinity_of_irq()
236 * irq_affinity_online_cpu - Restore affinity for managed interrupts
247 raw_spin_lock_irq(&desc->lock); in irq_affinity_online_cpu()
249 raw_spin_unlock_irq(&desc->lock); in irq_affinity_online_cpu()