Re: [PATCH v4 06/18] dma: Provide an interface to allow allocate IOVA

From: Leon Romanovsky
Date: Thu Dec 12 2024 - 03:47:46 EST


On Thu, Dec 12, 2024 at 09:42:06AM +0100, Christoph Hellwig wrote:
> s/dma/dma-mapping/ in the subject.
>
> > function call per API call used in datapath as well as a lot of boilerplate
>
> Please trim commit messages to 73 characters so that they still look good
> in git show output.
>
> > +bool dma_iova_try_alloc(struct device *dev, struct dma_iova_state *state,
> > + phys_addr_t phys, size_t size)
> > +{
> > + memset(state, 0, sizeof(*state));
> > + if (!use_dma_iommu(dev))
> > + return false;
> > + if (static_branch_unlikely(&iommu_deferred_attach_enabled) &&
> > + iommu_deferred_attach(dev, iommu_get_domain_for_dev(dev)))
> > + return false;
> > + return iommu_dma_iova_alloc(dev, state, phys, size);
> > +}
>
> Now that dma_iova_try_alloc is the only caller of iommu_dma_iova_alloc,
> maybe merge the two?

Sure, will do

>
> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Thanks a lot.