Lines Matching refs:domain

168 			 (dev->msi.domain &&  in msi_ctrl_valid()
169 !dev->msi.data->__domains[ctrl->domid].domain))) in msi_ctrl_valid()
319 if (dev->msi.domain && !irq_domain_is_msi_parent(dev->msi.domain)) in msi_setup_device_data()
320 md->__domains[MSI_DEFAULT_DOMAIN].domain = dev->msi.domain; in msi_setup_device_data()
586 struct irq_domain *domain; in msi_get_device_domain() local
593 domain = dev->msi.data->__domains[domid].domain; in msi_get_device_domain()
594 if (!domain) in msi_get_device_domain()
597 if (WARN_ON_ONCE(irq_domain_is_msi_parent(domain))) in msi_get_device_domain()
600 return domain; in msi_get_device_domain()
606 struct irq_domain *domain; in msi_domain_get_hwsize() local
608 domain = msi_get_device_domain(dev, domid); in msi_domain_get_hwsize()
609 if (domain) { in msi_domain_get_hwsize()
610 info = domain->host_data; in msi_domain_get_hwsize()
623 static void msi_check_level(struct irq_domain *domain, struct msi_msg *msg) in msi_check_level() argument
625 struct msi_domain_info *info = domain->host_data; in msi_check_level()
657 msi_check_level(irq_data->domain, msg); in msi_domain_set_affinity()
664 static int msi_domain_activate(struct irq_domain *domain, in msi_domain_activate() argument
670 msi_check_level(irq_data->domain, msg); in msi_domain_activate()
675 static void msi_domain_deactivate(struct irq_domain *domain, in msi_domain_deactivate() argument
684 static int msi_domain_alloc(struct irq_domain *domain, unsigned int virq, in msi_domain_alloc() argument
687 struct msi_domain_info *info = domain->host_data; in msi_domain_alloc()
692 if (irq_find_mapping(domain, hwirq) > 0) in msi_domain_alloc()
695 if (domain->parent) { in msi_domain_alloc()
696 ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, arg); in msi_domain_alloc()
702 ret = ops->msi_init(domain, info, virq + i, hwirq + i, arg); in msi_domain_alloc()
706 ops->msi_free(domain, info, virq + i); in msi_domain_alloc()
708 irq_domain_free_irqs_top(domain, virq, nr_irqs); in msi_domain_alloc()
716 static void msi_domain_free(struct irq_domain *domain, unsigned int virq, in msi_domain_free() argument
719 struct msi_domain_info *info = domain->host_data; in msi_domain_free()
724 info->ops->msi_free(domain, info, virq + i); in msi_domain_free()
726 irq_domain_free_irqs_top(domain, virq, nr_irqs); in msi_domain_free()
742 static int msi_domain_ops_prepare(struct irq_domain *domain, struct device *dev, in msi_domain_ops_prepare() argument
755 static int msi_domain_ops_init(struct irq_domain *domain, in msi_domain_ops_init() argument
760 irq_domain_set_hwirq_and_chip(domain, virq, hwirq, info->chip, in msi_domain_ops_init()
813 struct irq_domain *domain; in __msi_create_irq_domain() local
830 domain = irq_domain_create_hierarchy(parent, flags | IRQ_DOMAIN_FLAG_MSI, 0, in __msi_create_irq_domain()
833 if (domain) in __msi_create_irq_domain()
834 irq_domain_update_bus_token(domain, info->bus_token); in __msi_create_irq_domain()
836 return domain; in __msi_create_irq_domain()
881 bool msi_parent_init_dev_msi_info(struct device *dev, struct irq_domain *domain, in msi_parent_init_dev_msi_info() argument
885 struct irq_domain *parent = domain->parent; in msi_parent_init_dev_msi_info()
947 struct irq_domain *domain, *parent = dev->msi.domain; in msi_create_device_irq_domain() local
988 domain = __msi_create_irq_domain(fwnode, &bundle->info, IRQ_DOMAIN_FLAG_MSI_DEVICE, parent); in msi_create_device_irq_domain()
989 if (!domain) in msi_create_device_irq_domain()
992 domain->dev = dev; in msi_create_device_irq_domain()
993 dev->msi.data->__domains[domid].domain = domain; in msi_create_device_irq_domain()
1015 struct irq_domain *domain; in msi_remove_device_irq_domain() local
1019 domain = msi_get_device_domain(dev, domid); in msi_remove_device_irq_domain()
1021 if (!domain || !irq_domain_is_msi_device(domain)) in msi_remove_device_irq_domain()
1024 dev->msi.data->__domains[domid].domain = NULL; in msi_remove_device_irq_domain()
1025 info = domain->host_data; in msi_remove_device_irq_domain()
1026 if (irq_domain_is_msi_device(domain)) in msi_remove_device_irq_domain()
1027 fwnode = domain->fwnode; in msi_remove_device_irq_domain()
1028 irq_domain_remove(domain); in msi_remove_device_irq_domain()
1048 struct irq_domain *domain; in msi_match_device_irq_domain() local
1052 domain = msi_get_device_domain(dev, domid); in msi_match_device_irq_domain()
1053 if (domain && irq_domain_is_msi_device(domain)) { in msi_match_device_irq_domain()
1054 info = domain->host_data; in msi_match_device_irq_domain()
1061 int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev, in msi_domain_prepare_irqs() argument
1064 struct msi_domain_info *info = domain->host_data; in msi_domain_prepare_irqs()
1067 return ops->msi_prepare(domain, dev, nvec, arg); in msi_domain_prepare_irqs()
1070 int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev, in msi_domain_populate_irqs() argument
1073 struct msi_domain_info *info = domain->host_data; in msi_domain_populate_irqs()
1102 ret = irq_domain_alloc_irqs_hierarchy(domain, virq, 1, arg); in msi_domain_populate_irqs()
1114 irq_domain_free_irqs_common(domain, virq, 1); in msi_domain_populate_irqs()
1152 static bool msi_check_reservation_mode(struct irq_domain *domain, in msi_check_reservation_mode() argument
1158 switch(domain->bus_token) { in msi_check_reservation_mode()
1182 static int msi_handle_pci_fail(struct irq_domain *domain, struct msi_desc *desc, in msi_handle_pci_fail() argument
1185 switch(domain->bus_token) { in msi_handle_pci_fail()
1208 static int msi_init_virq(struct irq_domain *domain, int virq, unsigned int vflags) in msi_init_virq() argument
1210 struct irq_data *irqd = irq_domain_get_irq_data(domain, virq); in msi_init_virq()
1247 static int __msi_domain_alloc_irqs(struct device *dev, struct irq_domain *domain, in __msi_domain_alloc_irqs() argument
1251 struct msi_domain_info *info = domain->host_data; in __msi_domain_alloc_irqs()
1259 ret = msi_domain_prepare_irqs(domain, dev, ctrl->nirqs, &arg); in __msi_domain_alloc_irqs()
1275 if (msi_check_reservation_mode(domain, info, dev)) in __msi_domain_alloc_irqs()
1287 ops->prepare_desc(domain, &arg, desc); in __msi_domain_alloc_irqs()
1291 virq = __irq_domain_alloc_irqs(domain, -1, desc->nvec_used, in __msi_domain_alloc_irqs()
1295 return msi_handle_pci_fail(domain, desc, allocated); in __msi_domain_alloc_irqs()
1300 ret = msi_init_virq(domain, virq + i, vflags); in __msi_domain_alloc_irqs()
1328 struct irq_domain *domain; in __msi_domain_alloc_locked() local
1334 domain = msi_get_device_domain(dev, ctrl->domid); in __msi_domain_alloc_locked()
1335 if (!domain) in __msi_domain_alloc_locked()
1338 info = domain->host_data; in __msi_domain_alloc_locked()
1346 return ops->domain_alloc_irqs(domain, dev, ctrl->nirqs); in __msi_domain_alloc_locked()
1348 return __msi_domain_alloc_irqs(dev, domain, ctrl); in __msi_domain_alloc_locked()
1464 struct irq_domain *domain; in msi_domain_alloc_irq_at() local
1470 domain = msi_get_device_domain(dev, domid); in msi_domain_alloc_irq_at()
1471 if (!domain) { in msi_domain_alloc_irq_at()
1493 ret = __msi_domain_alloc_irqs(dev, domain, &ctrl); in msi_domain_alloc_irq_at()
1506 static void __msi_domain_free_irqs(struct device *dev, struct irq_domain *domain, in __msi_domain_free_irqs() argument
1510 struct msi_domain_info *info = domain->host_data; in __msi_domain_free_irqs()
1523 irqd = irq_domain_get_irq_data(domain, desc->irq + i); in __msi_domain_free_irqs()
1539 struct irq_domain *domain; in msi_domain_free_locked() local
1544 domain = msi_get_device_domain(dev, ctrl->domid); in msi_domain_free_locked()
1545 if (!domain) in msi_domain_free_locked()
1548 info = domain->host_data; in msi_domain_free_locked()
1552 ops->domain_free_irqs(domain, dev); in msi_domain_free_locked()
1554 __msi_domain_free_irqs(dev, domain, ctrl); in msi_domain_free_locked()
1557 ops->msi_post_free(domain, dev); in msi_domain_free_locked()
1637 struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain) in msi_get_domain_info() argument
1639 return (struct msi_domain_info *)domain->host_data; in msi_get_domain_info()
1660 struct irq_domain *domain = dev_get_msi_domain(dev); in msi_device_has_isolated_msi() local
1662 for (; domain; domain = domain->parent) in msi_device_has_isolated_msi()
1663 if (domain->flags & IRQ_DOMAIN_FLAG_ISOLATED_MSI) in msi_device_has_isolated_msi()