Linux IOMMU Development
 help / color / mirror / Atom feed
* [PATCH v2] iommu/ipmmu-vmsa: Allow PCIe devices
@ 2023-04-26  8:25 Yoshihiro Shimoda
  2023-05-22 15:30 ` Joerg Roedel
  0 siblings, 1 reply; 3+ messages in thread
From: Yoshihiro Shimoda @ 2023-04-26  8:25 UTC (permalink / raw)
  To: joro, will, robin.murphy; +Cc: iommu, linux-renesas-soc, Yoshihiro Shimoda

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@renesas.com>
---
 Changes from v1:
 https://lore.kernel.org/all/20230421122538.3389336-1-yoshihiro.shimoda.uh@renesas.com/
 - 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-29  4:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-26  8:25 [PATCH v2] iommu/ipmmu-vmsa: Allow PCIe devices Yoshihiro Shimoda
2023-05-22 15:30 ` Joerg Roedel
2023-05-29  4:58   ` Yoshihiro Shimoda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox