Message ID | 20210316153825.135976-12-hch@lst.de (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [01/18] iommu: remove the unused domain_window_disable method | expand |
On Tue, Mar 16, 2021 at 04:38:17PM +0100, Christoph Hellwig wrote: > The snoop_id is always set to ~(u32)0. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > Acked-by: Li Yang <leoyang.li@nxp.com> > --- > drivers/iommu/fsl_pamu_domain.c | 5 ++--- > drivers/iommu/fsl_pamu_domain.h | 1 - > 2 files changed, 2 insertions(+), 4 deletions(-) pamu_config_ppaace() takes quite a few useless parameters at this stage, but anyway: Acked-by: Will Deacon <will@kernel.org> Do you know if this driver is actually useful? Once the complexity has been stripped back, the stubs and default values really stand out. Will
On Tue, Mar 30, 2021 at 01:58:17PM +0100, Will Deacon wrote: > pamu_config_ppaace() takes quite a few useless parameters at this stage, > but anyway: I'll see it it makes sense to throw in another patch at the end to cut it down a bit more. > Acked-by: Will Deacon <will@kernel.org> > > Do you know if this driver is actually useful? Once the complexity has been > stripped back, the stubs and default values really stand out. Yeah. No idea what the usefulness of this driver is. Bascially all it seems to do is to setup a few registers to allow access to the whole physical memory. But maybe that is required on this hardware to allow for any DMA access?
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 21c6d9e79eddf9..701fc3f187a100 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -97,12 +97,12 @@ static int pamu_set_liodn(struct fsl_dma_domain *dma_domain, struct device *dev, goto out_unlock; ret = pamu_config_ppaace(liodn, geom->aperture_start, geom->aperture_end - 1, omi_index, 0, - dma_domain->snoop_id, dma_domain->stash_id, 0); + ~(u32)0, dma_domain->stash_id, 0); if (ret) goto out_unlock; ret = pamu_config_ppaace(liodn, geom->aperture_start, geom->aperture_end - 1, ~(u32)0, - 0, dma_domain->snoop_id, dma_domain->stash_id, + 0, ~(u32)0, dma_domain->stash_id, PAACE_AP_PERMS_QUERY | PAACE_AP_PERMS_UPDATE); out_unlock: spin_unlock_irqrestore(&iommu_lock, flags); @@ -210,7 +210,6 @@ static struct iommu_domain *fsl_pamu_domain_alloc(unsigned type) return NULL; dma_domain->stash_id = ~(u32)0; - dma_domain->snoop_id = ~(u32)0; INIT_LIST_HEAD(&dma_domain->devices); spin_lock_init(&dma_domain->domain_lock); diff --git a/drivers/iommu/fsl_pamu_domain.h b/drivers/iommu/fsl_pamu_domain.h index 5f4ed253f61b31..95ac1b3cab3b69 100644 --- a/drivers/iommu/fsl_pamu_domain.h +++ b/drivers/iommu/fsl_pamu_domain.h @@ -13,7 +13,6 @@ struct fsl_dma_domain { /* list of devices associated with the domain */ struct list_head devices; u32 stash_id; - u32 snoop_id; struct iommu_domain iommu_domain; spinlock_t domain_lock; };