All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/sun50i: Remove IOMMU_DOMAIN_IDENTITY
@ 2022-11-28 14:06 ` Jason Gunthorpe
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2022-11-28 14:06 UTC (permalink / raw)
  To: iommu, Maxime Ripard, Jernej Skrabec, Joerg Roedel,
	linux-arm-kernel, linux-sunxi, Robin Murphy, Samuel Holland,
	Chen-Yu Tsai, Will Deacon
  Cc: Joerg Roedel

This driver treats IOMMU_DOMAIN_IDENTITY the same as UNMANAGED, which
cannot possibly be correct.

UNMANAGED domains are required to start out blocking all DMAs. This seems
to be what this driver does as it allocates a first level 'dt' for the IO
page table that is 0 filled.

Thus UNMANAGED looks like a working IO page table, and so IDENTITY must be
a mistake. Remove it.

Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/sun50i-iommu.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index cd9b74ee24def1..0843418434ff3a 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -601,7 +601,6 @@ static struct iommu_domain *sun50i_iommu_domain_alloc(unsigned type)
 	struct sun50i_iommu_domain *sun50i_domain;
 
 	if (type != IOMMU_DOMAIN_DMA &&
-	    type != IOMMU_DOMAIN_IDENTITY &&
 	    type != IOMMU_DOMAIN_UNMANAGED)
 		return NULL;
 

base-commit: 328827239b9ce3a95b5c0d33e8875651580de053
-- 
2.38.1


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

end of thread, other threads:[~2022-12-05 10:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-28 14:06 [PATCH] iommu/sun50i: Remove IOMMU_DOMAIN_IDENTITY Jason Gunthorpe
2022-11-28 14:06 ` Jason Gunthorpe
2022-11-28 14:21 ` Robin Murphy
2022-11-28 14:21   ` Robin Murphy
2022-12-05 10:53 ` Joerg Roedel
2022-12-05 10:53   ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.