Message ID | 3-v1-0bb8d5313a27+27b-smmuv3_paging_flags_jgg@nvidia.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | iommu/arm-smmuv3: Update domain_alloc_paging_flags() | expand |
On Thu, Dec 05, 2024 at 11:43:29AM -0400, Jason Gunthorpe wrote: > arm_smmu_domain_alloc_paging_flags() with a flags = 0 now does the same > thing as arm_smmu_domain_alloc_paging(), remove > arm_smmu_domain_alloc_paging(). > > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 31 --------------------- > 1 file changed, 31 deletions(-) Ha! I was reviewing the previous patch and about to reply asking why we couldn't just implement arm_smmu_domain_alloc_paging() as a wrapper around arm_smmu_domain_alloc_paging() with flags of 0. Good thing I read ahead :) Will
On Mon, Dec 09, 2024 at 11:06:12PM +0000, Will Deacon wrote: > On Thu, Dec 05, 2024 at 11:43:29AM -0400, Jason Gunthorpe wrote: > > arm_smmu_domain_alloc_paging_flags() with a flags = 0 now does the same > > thing as arm_smmu_domain_alloc_paging(), remove > > arm_smmu_domain_alloc_paging(). > > > > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> > > --- > > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 31 --------------------- > > 1 file changed, 31 deletions(-) > > Ha! I was reviewing the previous patch and about to reply asking why we > couldn't just implement arm_smmu_domain_alloc_paging() as a wrapper > around arm_smmu_domain_alloc_paging() with flags of 0. > > Good thing I read ahead :) Yes, the main point of the prior patch was to make this patch possible :) Jason
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 00105ccadc8b2b..f285b98f982c14 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -83,8 +83,6 @@ static struct arm_smmu_option_prop arm_smmu_options[] = { { 0, NULL}, }; -static int arm_smmu_domain_finalise(struct arm_smmu_domain *smmu_domain, - struct arm_smmu_device *smmu, u32 flags); static int arm_smmu_alloc_cd_tables(struct arm_smmu_master *master); static void parse_driver_options(struct arm_smmu_device *smmu) @@ -2359,34 +2357,6 @@ struct arm_smmu_domain *arm_smmu_domain_alloc(void) return smmu_domain; } -static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev) -{ - struct arm_smmu_master *master = dev_iommu_priv_get(dev); - struct arm_smmu_domain *smmu_domain; - int ret; - - /* - * Allocate the domain and initialise some of its data structures. - * We can't really do anything meaningful until we've added a - * master. - */ - smmu_domain = arm_smmu_domain_alloc(); - if (IS_ERR(smmu_domain)) - return ERR_CAST(smmu_domain); - - if (master->smmu->features & ARM_SMMU_FEAT_TRANS_S1) - smmu_domain->stage = ARM_SMMU_DOMAIN_S1; - else - smmu_domain->stage = ARM_SMMU_DOMAIN_S2; - - ret = arm_smmu_domain_finalise(smmu_domain, master->smmu, 0); - if (ret) { - kfree(smmu_domain); - return ERR_PTR(ret); - } - return &smmu_domain->domain; -} - static void arm_smmu_domain_free_paging(struct iommu_domain *domain) { struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); @@ -3549,7 +3519,6 @@ static struct iommu_ops arm_smmu_ops = { .blocked_domain = &arm_smmu_blocked_domain, .capable = arm_smmu_capable, .hw_info = arm_smmu_hw_info, - .domain_alloc_paging = arm_smmu_domain_alloc_paging, .domain_alloc_sva = arm_smmu_sva_domain_alloc, .domain_alloc_paging_flags = arm_smmu_domain_alloc_paging_flags, .probe_device = arm_smmu_probe_device,
arm_smmu_domain_alloc_paging_flags() with a flags = 0 now does the same thing as arm_smmu_domain_alloc_paging(), remove arm_smmu_domain_alloc_paging(). Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 31 --------------------- 1 file changed, 31 deletions(-)