[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44f5c699-1177-7f1d-479e-59a8a42efab6@arm.com>
Date: Thu, 5 Aug 2021 10:37:58 +0100
From: Robin Murphy <robin.murphy@....com>
To: joro@...tes.org, will@...nel.org
Cc: linux-kernel@...r.kernel.org, dianders@...omium.org,
iommu@...ts.linux-foundation.org, rajatja@...gle.com,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3 02/25] iommu/amd: Drop IOVA cookie management
On 2021-08-04 18:15, Robin Murphy wrote:
> The core code bakes its own cookies now.
>
> Signed-off-by: Robin Murphy <robin.murphy@....com>
>
> ---
>
> v3: Also remove unneeded include
> ---
> drivers/iommu/amd/iommu.c | 13 -------------
> 1 file changed, 13 deletions(-)
>
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index 52fe2326042a..92f7cbe3d14a 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -20,7 +20,6 @@
> #include <linux/scatterlist.h>
> #include <linux/dma-map-ops.h>
> #include <linux/dma-direct.h>
> -#include <linux/dma-iommu.h>
Oh dear, how embarrassing... I went through all the drivers making that
decision based on iommu_dma* references but totally forgot about
iommu_setup_dma_ops() here. And then of course fell into the trap of
"such a minor change I don't need to re-rest it" hubris... sigh, roll
back to v2 for this one.
Apologies,
Robin.
> #include <linux/iommu-helper.h>
> #include <linux/delay.h>
> #include <linux/amd-iommu.h>
> @@ -1918,16 +1917,7 @@ static struct iommu_domain *amd_iommu_domain_alloc(unsigned type)
> domain->domain.geometry.aperture_end = ~0ULL;
> domain->domain.geometry.force_aperture = true;
>
> - if (type == IOMMU_DOMAIN_DMA &&
> - iommu_get_dma_cookie(&domain->domain) == -ENOMEM)
> - goto free_domain;
> -
> return &domain->domain;
> -
> -free_domain:
> - protection_domain_free(domain);
> -
> - return NULL;
> }
>
> static void amd_iommu_domain_free(struct iommu_domain *dom)
> @@ -1944,9 +1934,6 @@ static void amd_iommu_domain_free(struct iommu_domain *dom)
> if (!dom)
> return;
>
> - if (dom->type == IOMMU_DOMAIN_DMA)
> - iommu_put_dma_cookie(&domain->domain);
> -
> if (domain->flags & PD_IOMMUV2_MASK)
> free_gcr3_table(domain);
>
>
Powered by blists - more mailing lists