diff mbox series

[09/11] iommu/intel: Convert to msi_create_parent_irq_domain() helper

Message ID 20241204124549.607054-10-maz@kernel.org (mailing list archive)
State New
Headers show
Series irqchip: MSI parent cleanup and PCI host driver conversion | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-9-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 211.07s
conchuod/patch-9-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1377.95s
conchuod/patch-9-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1607.60s
conchuod/patch-9-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 77.45s
conchuod/patch-9-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 80.19s
conchuod/patch-9-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.49s
conchuod/patch-9-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 46.47s
conchuod/patch-9-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-9-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.54s
conchuod/patch-9-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-9-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-9-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.03s

Commit Message

Marc Zyngier Dec. 4, 2024, 12:45 p.m. UTC
Now that we have a concise helper to create an MSI parent domain,
switch the Intel IOMMU remapping over to that.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 drivers/iommu/intel/irq_remapping.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_remapping.c
index 466c1412dd456..7ca3ee4c985c9 100644
--- a/drivers/iommu/intel/irq_remapping.c
+++ b/drivers/iommu/intel/irq_remapping.c
@@ -557,21 +557,16 @@  static int intel_setup_irq_remapping(struct intel_iommu *iommu)
 	if (!fn)
 		goto out_free_bitmap;
 
-	iommu->ir_domain =
-		irq_domain_create_hierarchy(arch_get_ir_parent_domain(),
-					    0, INTR_REMAP_TABLE_ENTRIES,
-					    fn, &intel_ir_domain_ops,
-					    iommu);
+	iommu->ir_domain = msi_create_parent_irq_domain(fn, &dmar_msi_parent_ops,
+							&intel_ir_domain_ops,
+							IRQ_DOMAIN_FLAG_ISOLATED_MSI,
+							INTR_REMAP_TABLE_ENTRIES,
+							iommu, arch_get_ir_parent_domain());
 	if (!iommu->ir_domain) {
 		pr_err("IR%d: failed to allocate irqdomain\n", iommu->seq_id);
 		goto out_free_fwnode;
 	}
 
-	irq_domain_update_bus_token(iommu->ir_domain,  DOMAIN_BUS_DMAR);
-	iommu->ir_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT |
-				   IRQ_DOMAIN_FLAG_ISOLATED_MSI;
-	iommu->ir_domain->msi_parent_ops = &dmar_msi_parent_ops;
-
 	ir_table->base = ir_table_base;
 	ir_table->bitmap = bitmap;
 	iommu->ir_table = ir_table;
@@ -1522,6 +1517,7 @@  static const struct irq_domain_ops intel_ir_domain_ops = {
 
 static const struct msi_parent_ops dmar_msi_parent_ops = {
 	.supported_flags	= X86_VECTOR_MSI_FLAGS_SUPPORTED | MSI_FLAG_MULTI_PCI_MSI,
+	.bus_token		= DOMAIN_BUS_DMAR,
 	.prefix			= "IR-",
 	.init_dev_msi_info	= msi_parent_init_dev_msi_info,
 };