Thread (84 messages) 84 messages, 11 authors, 2022-11-17

RE: [RFC PATCH v4 3/8] iommu/arm-smmu-v3: support ops registration for CDX bus

From: "Gupta, Nipun" <Nipun.Gupta@amd.com>
Date: 2022-10-14 04:52:07
Also in: kvm, linux-devicetree, linux-kbuild, lkml

[AMD Official Use Only - General]

This patch will be rebased on top of https://lore.kernel.org/linux-iommu/cover.1660572783.git.robin.murphy@arm.com/T/#t (local)
in next respin.

Regards,
Nipun
quoted hunk ↗ jump to hunk
-----Original Message-----
From: Nipun Gupta <nipun.gupta@amd.com>
Sent: Friday, October 14, 2022 10:11 AM
To: robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org;
gregkh@linuxfoundation.org; rafael@kernel.org; eric.auger@redhat.com;
alex.williamson@redhat.com; cohuck@redhat.com; Gupta, Puneet (DCG-ENG)
[off-list ref]; song.bao.hua@hisilicon.com;
mchehab+huawei@kernel.org; maz@kernel.org; f.fainelli@gmail.com;
jeffrey.l.hugo@gmail.com; saravanak@google.com; Michael.Srba@seznam.cz;
mani@kernel.org; yishaih@nvidia.com; jgg@ziepe.ca; jgg@nvidia.com;
robin.murphy@arm.com; will@kernel.org; joro@8bytes.org;
masahiroy@kernel.org; ndesaulniers@google.com; linux-arm-
kernel@lists.infradead.org; linux-kbuild@vger.kernel.org; linux-
kernel@vger.kernel.org; devicetree@vger.kernel.org; kvm@vger.kernel.org
Cc: okaya@kernel.org; Anand, Harpreet <redacted>; Agarwal,
Nikhil [off-list ref]; Simek, Michal [off-list ref];
Radovanovic, Aleksandar [off-list ref]; git (AMD-Xilinx)
[off-list ref]; Gupta, Nipun [off-list ref]
Subject: [RFC PATCH v4 3/8] iommu/arm-smmu-v3: support ops registration for
CDX bus

With new CDX bus supported for AMD FPGA devices on ARM
platform, the bus requires registration for the SMMU v3
driver.

Signed-off-by: Nipun Gupta <nipun.gupta@amd.com>
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index d32b02336411..8ec9f2baf12d 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -29,6 +29,7 @@
 #include <linux/platform_device.h>

 #include <linux/amba/bus.h>
+#include <linux/cdx/cdx_bus.h>

 #include "arm-smmu-v3.h"
 #include "../../iommu-sva-lib.h"
@@ -3690,16 +3691,27 @@ static int arm_smmu_set_bus_ops(struct
iommu_ops *ops)
 		if (err)
 			goto err_reset_pci_ops;
 	}
+#endif
+#ifdef CONFIG_CDX_BUS
+	if (cdx_bus_type.iommu_ops != ops) {
+		err = bus_set_iommu(&cdx_bus_type, ops);
+		if (err)
+			goto err_reset_amba_ops;
+	}
 #endif
 	if (platform_bus_type.iommu_ops != ops) {
 		err = bus_set_iommu(&platform_bus_type, ops);
 		if (err)
-			goto err_reset_amba_ops;
+			goto err_reset_cdx_ops;
 	}

 	return 0;

-err_reset_amba_ops:
+err_reset_cdx_ops:
+#ifdef CONFIG_CDX_BUS
+	bus_set_iommu(&cdx_bus_type, NULL);
+#endif
+err_reset_amba_ops: __maybe_unused;
 #ifdef CONFIG_ARM_AMBA
 	bus_set_iommu(&amba_bustype, NULL);
 #endif
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help