2023-11-21 18:07:21

by Robin Murphy

[permalink] [raw]
Subject: [PATCH v6 0/7] iommu: Retire bus ops

v5: https://lore.kernel.org/linux-iommu/[email protected]/

Yet another rebase, this time just tweaking patch #3 for the new
domain_alloc_user() sites, and picking up reviews/acks.

Thanks,
Robin.


Robin Murphy (7):
iommu: Factor out some helpers
iommu: Decouple iommu_present() from bus ops
iommu: Validate that devices match domains
iommu: Decouple iommu_domain_alloc() from bus ops
iommu/arm-smmu: Don't register fwnode for legacy binding
iommu: Retire bus ops
iommu: Clean up open-coded ownership checks

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 3 -
drivers/iommu/arm/arm-smmu/arm-smmu.c | 12 +-
drivers/iommu/arm/arm-smmu/qcom_iommu.c | 16 +--
drivers/iommu/iommu.c | 143 +++++++++++++-------
drivers/iommu/iommufd/hw_pagetable.c | 2 +
drivers/iommu/mtk_iommu.c | 7 +-
drivers/iommu/mtk_iommu_v1.c | 3 -
drivers/iommu/sprd-iommu.c | 8 +-
drivers/iommu/virtio-iommu.c | 3 -
include/acpi/acpi_bus.h | 2 +
include/linux/device.h | 1 -
include/linux/device/bus.h | 5 -
include/linux/dma-map-ops.h | 1 +
include/linux/iommu.h | 2 +-
14 files changed, 110 insertions(+), 98 deletions(-)

--
2.39.2.101.g768bb238c484.dirty


2023-11-21 18:12:15

by Robin Murphy

[permalink] [raw]
Subject: [PATCH v6 5/7] iommu/arm-smmu: Don't register fwnode for legacy binding

When using the legacy binding we bypass the of_xlate mechanism, so avoid
registering the instance fwnodes which act as keys for that. This will
help __iommu_probe_device() to retrieve the registered ops the same way
as for x86 etc. when no fwspec has previously been set up by of_xlate.

Acked-by: Will Deacon <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Jerry Snitselaar <[email protected]>
Signed-off-by: Robin Murphy <[email protected]>
---
drivers/iommu/arm/arm-smmu/arm-smmu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
index d6d1a2a55cc0..4b83a3adacd6 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
@@ -2161,7 +2161,8 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
return err;
}

- err = iommu_device_register(&smmu->iommu, &arm_smmu_ops, dev);
+ err = iommu_device_register(&smmu->iommu, &arm_smmu_ops,
+ using_legacy_binding ? NULL : dev);
if (err) {
dev_err(dev, "Failed to register iommu\n");
iommu_device_sysfs_remove(&smmu->iommu);
--
2.39.2.101.g768bb238c484.dirty

2023-11-27 10:03:57

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH v6 0/7] iommu: Retire bus ops

On Tue, Nov 21, 2023 at 06:03:56PM +0000, Robin Murphy wrote:
> Robin Murphy (7):
> iommu: Factor out some helpers
> iommu: Decouple iommu_present() from bus ops
> iommu: Validate that devices match domains
> iommu: Decouple iommu_domain_alloc() from bus ops
> iommu/arm-smmu: Don't register fwnode for legacy binding
> iommu: Retire bus ops
> iommu: Clean up open-coded ownership checks

Applied, thanks.