diff mbox series

[08/11] iommu/amd: Convert to msi_create_parent_irq_domain() helper

Message ID 20241204124549.607054-9-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-8-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 209.19s
conchuod/patch-8-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1379.48s
conchuod/patch-8-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1588.16s
conchuod/patch-8-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 75.26s
conchuod/patch-8-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 78.14s
conchuod/patch-8-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.48s
conchuod/patch-8-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 45.98s
conchuod/patch-8-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-8-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.54s
conchuod/patch-8-test-10 success .github/scripts/patches/tests/module_param.sh took 0.02s
conchuod/patch-8-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-8-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 AMD IOMMU remapping over to that.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 drivers/iommu/amd/iommu.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 3f691e1fd22ce..8137674aca51d 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -3807,6 +3807,7 @@  static struct irq_chip amd_ir_chip = {
 
 static const struct msi_parent_ops amdvi_msi_parent_ops = {
 	.supported_flags	= X86_VECTOR_MSI_FLAGS_SUPPORTED | MSI_FLAG_MULTI_PCI_MSI,
+	.bus_token		= DOMAIN_BUS_AMDVI,
 	.prefix			= "IR-",
 	.init_dev_msi_info	= msi_parent_init_dev_msi_info,
 };
@@ -3818,18 +3819,15 @@  int amd_iommu_create_irq_domain(struct amd_iommu *iommu)
 	fn = irq_domain_alloc_named_id_fwnode("AMD-IR", iommu->index);
 	if (!fn)
 		return -ENOMEM;
-	iommu->ir_domain = irq_domain_create_hierarchy(arch_get_ir_parent_domain(), 0, 0,
-						       fn, &amd_ir_domain_ops, iommu);
+	iommu->ir_domain = msi_create_parent_irq_domain(fn, &amdvi_msi_parent_ops,
+							&amd_ir_domain_ops,
+							IRQ_DOMAIN_FLAG_ISOLATED_MSI, 0,
+							iommu, arch_get_ir_parent_domain());
 	if (!iommu->ir_domain) {
 		irq_domain_free_fwnode(fn);
 		return -ENOMEM;
 	}
 
-	irq_domain_update_bus_token(iommu->ir_domain,  DOMAIN_BUS_AMDVI);
-	iommu->ir_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT |
-				   IRQ_DOMAIN_FLAG_ISOLATED_MSI;
-	iommu->ir_domain->msi_parent_ops = &amdvi_msi_parent_ops;
-
 	return 0;
 }