Lines Matching +full:single +full:- +full:cpu +full:- +full:affinity
1 // SPDX-License-Identifier: GPL-2.0-or-later
15 #include <linux/cpu.h>
51 /* Find the server numbers for the boot cpu. */ in xics_update_irq_servers()
60 ireg = of_get_property(np, "ibm,ppc-interrupt-gserver#s", &ilen); in xics_update_irq_servers()
69 * entry of "ibm,ppc-interrupt-gserver#s" property. Get the last in xics_update_irq_servers()
70 * entry fom this property for current boot cpu id and use it as in xics_update_irq_servers()
96 index = (1UL << xics_interrupt_server_size) - 1 - gserver; in xics_set_cpu_giq()
100 WARN(status < 0, "set-indicator(%d, %d, %u) returned %d\n", in xics_set_cpu_giq()
107 icp_ops->set_priority(LOWEST_PRIORITY); in xics_setup_cpu()
118 xics_ics->mask_unknown(xics_ics, vec); in xics_mask_unknown_vec()
134 BUG_ON(request_irq(ipi, icp_ops->ipi_action, in xics_request_ipi()
144 smp_ops->cause_ipi = icp_ops->cause_ipi; in xics_smp_probe()
157 os_cppr->index = 0; in xics_teardown_cpu()
158 icp_ops->set_priority(0); in xics_teardown_cpu()
159 icp_ops->teardown_cpu(); in xics_teardown_cpu()
166 icp_ops->flush_ipi(); in xics_kexec_teardown_cpu()
169 * Some machines need to have at least one cpu in the GIQ, in xics_kexec_teardown_cpu()
170 * so leave the master cpu in the group. in xics_kexec_teardown_cpu()
182 int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id(); in xics_migrate_irqs_away() local
186 pr_debug("%s: CPU %u\n", __func__, cpu); in xics_migrate_irqs_away()
193 icp_ops->set_priority(0); in xics_migrate_irqs_away()
204 /* We can't set affinity on ISA interrupts */ in xics_migrate_irqs_away()
208 if (!desc->action) in xics_migrate_irqs_away()
219 if (!chip || !chip->irq_set_affinity) in xics_migrate_irqs_away()
222 raw_spin_lock_irqsave(&desc->lock, flags); in xics_migrate_irqs_away()
225 server = xics_ics->get_server(xics_ics, irq); in xics_migrate_irqs_away()
232 /* We only support delivery to all cpus or to one cpu. in xics_migrate_irqs_away()
233 * The irq has to be migrated only in the single cpu in xics_migrate_irqs_away()
239 /* This is expected during cpu offline. */ in xics_migrate_irqs_away()
240 if (cpu_online(cpu)) in xics_migrate_irqs_away()
241 pr_warn("IRQ %u affinity broken off cpu %u\n", in xics_migrate_irqs_away()
242 virq, cpu); in xics_migrate_irqs_away()
244 /* Reset affinity to all cpus */ in xics_migrate_irqs_away()
245 raw_spin_unlock_irqrestore(&desc->lock, flags); in xics_migrate_irqs_away()
249 raw_spin_unlock_irqrestore(&desc->lock, flags); in xics_migrate_irqs_away()
259 * safe. If we're using icp-opal this may actually allow all in xics_migrate_irqs_away()
262 icp_ops->set_priority(DEFAULT_PRIORITY); in xics_migrate_irqs_away()
269 * For the moment we only implement delivery to all cpus or one cpu.
271 * If the requested affinity is cpu_all_mask, we set global affinity.
272 * If not we set it to the first cpu in the mask, even if multiple cpus
292 return -1; in xics_get_irq_server()
312 return xics_ics->host_match(xics_ics, node) ? 1 : 0; in xics_host_match()
333 * actually works. The device-tree parsing will turn the LSIs in xics_host_map()
346 return -EINVAL; in xics_host_map()
348 if (xics_ics->check(xics_ics, hwirq)) in xics_host_map()
349 return -EINVAL; in xics_host_map()
352 irq_domain_set_info(domain, virq, hwirq, xics_ics->chip, in xics_host_map()
385 * affect the resend function when re-enabling an edge interrupt. in xics_set_irq_type()
394 return -EINVAL; in xics_set_irq_type()
418 return xics_host_xlate(d, to_of_node(fwspec->fwnode), fwspec->param, in xics_host_domain_translate()
419 fwspec->param_count, hwirq, type); in xics_host_domain_translate()
437 irq_domain_set_info(domain, virq + i, hwirq + i, xics_ics->chip, in xics_host_domain_alloc()
467 return -ENOMEM; in xics_allocate_domain()
472 return -ENOMEM; in xics_allocate_domain()
494 np = of_find_compatible_node(NULL, NULL, "ibm,ppc-xics"); in xics_get_server_size()
498 isize = of_get_property(np, "ibm,interrupt-server#-size", NULL); in xics_get_server_size()
507 int rc = -1; in xics_init()
514 if (rc == -ENODEV) in xics_init()
523 ppc_md.get_irq = icp_ops->get_irq; in xics_init()
526 xics_ipi_chip.irq_eoi = icp_ops->eoi; in xics_init()