Lines Matching +full:pci +full:- +full:domain
1 // SPDX-License-Identifier: GPL-2.0-only
7 #include <linux/irqchip/irq-msi-lib.h>
10 * msi_lib_init_dev_msi_info - Domain info setup for MSI domains
11 * @dev: The device for which the domain is created for
12 * @domain: The domain providing this callback
13 * @real_parent: The real parent domain of the domain to be initialized
14 * which might be a domain built on top of @domain or
15 * @domain itself
16 * @info: The domain info for the domain to be initialize
19 * parent domain and any intermediates. The topmost parent domain specific
22 * All intermediate domains between the root and the device domain must
26 bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain, in msi_lib_init_dev_msi_info() argument
30 const struct msi_parent_ops *pops = real_parent->msi_parent_ops; in msi_lib_init_dev_msi_info()
31 struct irq_chip *chip = info->chip; in msi_lib_init_dev_msi_info()
39 * MSI parent domain specific settings. For now there is only the in msi_lib_init_dev_msi_info()
40 * root parent domain, e.g. NEXUS, acting as a MSI parent, but it is in msi_lib_init_dev_msi_info()
41 * possible to stack MSI parents. See x86 vector -> irq remapping in msi_lib_init_dev_msi_info()
43 if (domain->bus_token == pops->bus_select_token) { in msi_lib_init_dev_msi_info()
44 if (WARN_ON_ONCE(domain != real_parent)) in msi_lib_init_dev_msi_info()
51 required_flags = pops->required_flags; in msi_lib_init_dev_msi_info()
53 /* Is the target domain bus token supported? */ in msi_lib_init_dev_msi_info()
54 switch(info->bus_token) { in msi_lib_init_dev_msi_info()
68 if (WARN_ON_ONCE(info->flags)) in msi_lib_init_dev_msi_info()
72 info->flags = MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS | MSI_FLAG_FREE_MSI_DESCS; in msi_lib_init_dev_msi_info()
75 /* Remove PCI specific flags */ in msi_lib_init_dev_msi_info()
88 * Mask out the domain specific MSI feature flags which are not in msi_lib_init_dev_msi_info()
91 info->flags &= pops->supported_flags; in msi_lib_init_dev_msi_info()
93 info->flags |= required_flags; in msi_lib_init_dev_msi_info()
96 if (!chip->irq_eoi && (pops->chip_flags & MSI_CHIP_FLAG_SET_EOI)) in msi_lib_init_dev_msi_info()
97 chip->irq_eoi = irq_chip_eoi_parent; in msi_lib_init_dev_msi_info()
98 if (!chip->irq_ack && (pops->chip_flags & MSI_CHIP_FLAG_SET_ACK)) in msi_lib_init_dev_msi_info()
99 chip->irq_ack = irq_chip_ack_parent; in msi_lib_init_dev_msi_info()
102 * The device MSI domain can never have a set affinity callback. It in msi_lib_init_dev_msi_info()
103 * always has to rely on the parent domain to handle affinity in msi_lib_init_dev_msi_info()
104 * settings. The device MSI domain just has to write the resulting in msi_lib_init_dev_msi_info()
106 * device MSI domain aside of mask/unmask which is provided e.g. by in msi_lib_init_dev_msi_info()
107 * PCI/MSI device domains. in msi_lib_init_dev_msi_info()
109 * The exception to the rule is when the underlying domain in msi_lib_init_dev_msi_info()
110 * tells you that affinity is not a thing -- for example when in msi_lib_init_dev_msi_info()
113 if (!chip->irq_set_affinity && !(info->flags & MSI_FLAG_NO_AFFINITY)) in msi_lib_init_dev_msi_info()
114 chip->irq_set_affinity = msi_domain_set_affinity; in msi_lib_init_dev_msi_info()
117 * If the parent domain insists on being in charge of masking, obey in msi_lib_init_dev_msi_info()
118 * blindly. The interrupt is un-masked at the PCI level on startup in msi_lib_init_dev_msi_info()
120 * driver freed the interrupt. Not masking it at the PCI level in msi_lib_init_dev_msi_info()
122 * getting all the way out to the PCI device. in msi_lib_init_dev_msi_info()
124 if (info->flags & MSI_FLAG_PCI_MSI_MASK_PARENT) { in msi_lib_init_dev_msi_info()
125 chip->irq_mask = irq_chip_mask_parent; in msi_lib_init_dev_msi_info()
126 chip->irq_unmask = irq_chip_unmask_parent; in msi_lib_init_dev_msi_info()
134 * msi_lib_irq_domain_select - Shared select function for NEXUS domains
135 * @d: Pointer to the irq domain on which select is invoked
137 * @bus_token: The bus token for which a matching irq domain is looked up
141 * %1 if @d is either the domain which is directly searched for or
142 * if @d is providing the parent MSI domain for the functionality
148 const struct msi_parent_ops *ops = d->msi_parent_ops; in msi_lib_irq_domain_select()
155 d->flags & IRQ_DOMAIN_FLAG_FWNODE_PARENT ? fwnode_get_parent(fwspec->fwnode) in msi_lib_irq_domain_select()
156 : fwnode_handle_get(fwspec->fwnode); in msi_lib_irq_domain_select()
157 if (fwh != d->fwnode || fwspec->param_count != 0) in msi_lib_irq_domain_select()
160 /* Handle pure domain searches */ in msi_lib_irq_domain_select()
161 if (bus_token == ops->bus_select_token) in msi_lib_irq_domain_select()
164 return !!(ops->bus_select_mask & busmask); in msi_lib_irq_domain_select()