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

Leon Romanovsky
2024-12-12T08:47:32Z

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@lst.de>

Thanks a lot.