Skip to content

Commit 5d89418

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/ipmmu-vmsa: Drop IOVA cookie management
The core code bakes its own cookies now. Reviewed-by: Yoshihiro Shimoda <[email protected]> Tested-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/dc5513293942d81f84edf61b354b236e5ac51dc2.1628682048.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent 4a376d4 commit 5d89418

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

drivers/iommu/ipmmu-vmsa.c

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include <linux/bitmap.h>
1010
#include <linux/delay.h>
11-
#include <linux/dma-iommu.h>
1211
#include <linux/dma-mapping.h>
1312
#include <linux/err.h>
1413
#include <linux/export.h>
@@ -564,10 +563,13 @@ static irqreturn_t ipmmu_irq(int irq, void *dev)
564563
* IOMMU Operations
565564
*/
566565

567-
static struct iommu_domain *__ipmmu_domain_alloc(unsigned type)
566+
static struct iommu_domain *ipmmu_domain_alloc(unsigned type)
568567
{
569568
struct ipmmu_vmsa_domain *domain;
570569

570+
if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA)
571+
return NULL;
572+
571573
domain = kzalloc(sizeof(*domain), GFP_KERNEL);
572574
if (!domain)
573575
return NULL;
@@ -577,27 +579,6 @@ static struct iommu_domain *__ipmmu_domain_alloc(unsigned type)
577579
return &domain->io_domain;
578580
}
579581

580-
static struct iommu_domain *ipmmu_domain_alloc(unsigned type)
581-
{
582-
struct iommu_domain *io_domain = NULL;
583-
584-
switch (type) {
585-
case IOMMU_DOMAIN_UNMANAGED:
586-
io_domain = __ipmmu_domain_alloc(type);
587-
break;
588-
589-
case IOMMU_DOMAIN_DMA:
590-
io_domain = __ipmmu_domain_alloc(type);
591-
if (io_domain && iommu_get_dma_cookie(io_domain)) {
592-
kfree(io_domain);
593-
io_domain = NULL;
594-
}
595-
break;
596-
}
597-
598-
return io_domain;
599-
}
600-
601582
static void ipmmu_domain_free(struct iommu_domain *io_domain)
602583
{
603584
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);
@@ -606,7 +587,6 @@ static void ipmmu_domain_free(struct iommu_domain *io_domain)
606587
* Free the domain resources. We assume that all devices have already
607588
* been detached.
608589
*/
609-
iommu_put_dma_cookie(io_domain);
610590
ipmmu_domain_destroy_context(domain);
611591
free_io_pgtable_ops(domain->iop);
612592
kfree(domain);

0 commit comments

Comments
 (0)