Lines Matching +full:cpu +full:- +full:cfg

1 // SPDX-License-Identifier: GPL-2.0-only
26 static void irq_msi_update_msg(struct irq_data *irqd, struct irq_cfg *cfg) in irq_msi_update_msg() argument
30 __irq_msi_compose_msg(cfg, msg, false); in irq_msi_update_msg()
31 irq_data_get_irq_chip(irqd)->irq_write_msi_msg(irqd, msg); in irq_msi_update_msg()
37 struct irq_cfg old_cfg, *cfg = irqd_cfg(irqd); in msi_set_affinity() local
38 struct irq_data *parent = irqd->parent_data; in msi_set_affinity()
39 unsigned int cpu; in msi_set_affinity() local
43 cpu = cpumask_first(irq_data_get_effective_affinity_mask(irqd)); in msi_set_affinity()
44 old_cfg = *cfg; in msi_set_affinity()
47 ret = parent->chip->irq_set_affinity(parent, mask, force); in msi_set_affinity()
52 * For non-maskable and non-remapped MSI interrupts the migration in msi_set_affinity()
53 * to a different destination CPU and a different vector has to be in msi_set_affinity()
55 * caused by the non-atomic update of the address/data pair. in msi_set_affinity()
58 * - The MSI is maskable (remapped MSI does not use this code path). in msi_set_affinity()
60 * - The new vector is the same as the old vector in msi_set_affinity()
61 * - The old vector is MANAGED_IRQ_SHUTDOWN_VECTOR (interrupt starts up) in msi_set_affinity()
62 * - The interrupt is not yet started up in msi_set_affinity()
63 * - The new destination CPU is the same as the old destination CPU in msi_set_affinity()
66 cfg->vector == old_cfg.vector || in msi_set_affinity()
69 cfg->dest_apicid == old_cfg.dest_apicid) { in msi_set_affinity()
70 irq_msi_update_msg(irqd, cfg); in msi_set_affinity()
76 * CPU. in msi_set_affinity()
78 if (WARN_ON_ONCE(cpu != smp_processor_id())) { in msi_set_affinity()
79 irq_msi_update_msg(irqd, cfg); in msi_set_affinity()
84 * Redirect the interrupt to the new vector on the current CPU in msi_set_affinity()
87 * update to the final destination CPU. in msi_set_affinity()
102 * Mark the new target vector on the local CPU if it is currently in msi_set_affinity()
104 * the CPU hotplug path for a similar purpose. This cannot be in msi_set_affinity()
105 * undone here as the current CPU has interrupts disabled and in msi_set_affinity()
107 * section is done. In the CPU unplug case, the current CPU is in msi_set_affinity()
109 * vector is cleaned up when the CPU comes online again. in msi_set_affinity()
111 if (IS_ERR_OR_NULL(this_cpu_read(vector_irq[cfg->vector]))) in msi_set_affinity()
112 this_cpu_write(vector_irq[cfg->vector], VECTOR_RETRIGGERED); in msi_set_affinity()
114 /* Redirect it to the new vector on the local CPU temporarily */ in msi_set_affinity()
115 old_cfg.vector = cfg->vector; in msi_set_affinity()
118 /* Now transition it to the target CPU */ in msi_set_affinity()
119 irq_msi_update_msg(irqd, cfg); in msi_set_affinity()
123 * vector/CPU. in msi_set_affinity()
126 * to the local CPU was hit by an interrupt raised in the device, in msi_set_affinity()
139 if (lapic_vector_set_in_irr(cfg->vector)) in msi_set_affinity()
140 irq_data_get_irq_chip(irqd)->irq_retrigger(irqd); in msi_set_affinity()
146 * pci_dev_has_default_msi_parent_domain - Check whether the device has the default
152 struct irq_domain *domain = dev_get_msi_domain(&dev->dev); in pci_dev_has_default_msi_parent_domain()
155 domain = dev_get_msi_domain(&dev->bus->dev); in pci_dev_has_default_msi_parent_domain()
163 * x86_msi_prepare - Setup of msi_alloc_info_t for allocations
178 struct msi_domain_info *info = domain->host_data; in x86_msi_prepare()
182 switch (info->bus_token) { in x86_msi_prepare()
184 alloc->type = X86_IRQ_ALLOC_TYPE_PCI_MSI; in x86_msi_prepare()
187 alloc->type = X86_IRQ_ALLOC_TYPE_PCI_MSIX; in x86_msi_prepare()
190 return -EINVAL; in x86_msi_prepare()
195 * x86_init_dev_msi_info - Domain info setup for MSI domains
208 const struct msi_parent_ops *pops = real_parent->msi_parent_ops; in x86_init_dev_msi_info()
211 switch (real_parent->bus_token) { in x86_init_dev_msi_info()
216 info->chip->irq_set_affinity = msi_set_affinity; in x86_init_dev_msi_info()
227 switch(info->bus_token) { in x86_init_dev_msi_info()
240 info->flags &= pops->supported_flags; in x86_init_dev_msi_info()
242 info->flags |= X86_VECTOR_MSI_FLAGS_REQUIRED; in x86_init_dev_msi_info()
245 info->ops->msi_prepare = x86_msi_prepare; in x86_init_dev_msi_info()
247 info->chip->irq_ack = irq_chip_ack_parent; in x86_init_dev_msi_info()
248 info->chip->irq_retrigger = irq_chip_retrigger_hierarchy; in x86_init_dev_msi_info()
249 info->chip->flags |= IRQCHIP_SKIP_SET_WAKE | in x86_init_dev_msi_info()
252 info->handler = handle_edge_irq; in x86_init_dev_msi_info()
253 info->handler_name = "edge"; in x86_init_dev_msi_info()
268 x86_vector_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT; in native_create_pci_msi_domain()
269 x86_vector_domain->msi_parent_ops = &x86_vector_msi_parent_ops; in native_create_pci_msi_domain()
284 if (to_pci_dev(dev)->msix_enabled) in pci_msi_prepare()
285 arg->type = X86_IRQ_ALLOC_TYPE_PCI_MSIX; in pci_msi_prepare()
287 arg->type = X86_IRQ_ALLOC_TYPE_PCI_MSI; in pci_msi_prepare()
306 dmar_msi_write(data->irq, msg); in dmar_msi_write_msg()
310 .name = "DMAR-MSI",
326 irq_domain_set_info(domain, virq, arg->devid, info->chip, NULL, in dmar_msi_init()
327 handle_edge_irq, arg->data, "edge"); in dmar_msi_init()
352 fn = irq_domain_alloc_named_fwnode("DMAR-MSI"); in dmar_get_irq_domain()
370 return -1; in dmar_alloc_hwirq()