To allow PCIe devices, add a new condition whether the device is a PCI device or not in the ipmmu_device_is_allowed(). Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> --- Changes from v1: https://lore.kernel.org/all/20230421122538.3389336-1-yoshihiro.shimoda.uh@xxxxxxxxxxx/ - Drop a condition in the ipmmu_attach_device(). - Drop adding PCIe root devices into the devices_allowlist. - Use dev_is_pci() instead of using strcmp() in ipmmu_device_is_allowed(). drivers/iommu/ipmmu-vmsa.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 9f64c5c9f5b9..6efc99382edb 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -19,6 +19,7 @@ #include <linux/of.h> #include <linux/of_device.h> #include <linux/of_platform.h> +#include <linux/pci.h> #include <linux/platform_device.h> #include <linux/sizes.h> #include <linux/slab.h> @@ -723,6 +724,10 @@ static bool ipmmu_device_is_allowed(struct device *dev) if (soc_device_match(soc_denylist)) return false; + /* Check whether this device is a PCI device */ + if (dev_is_pci(dev)) + return true; + /* Check whether this device can work with the IPMMU */ for (i = 0; i < ARRAY_SIZE(devices_allowlist); i++) { if (!strcmp(dev_name(dev), devices_allowlist[i])) -- 2.25.1