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

From: Christoph Hellwig
Date: Thu Dec 12 2024 - 03:42:32 EST


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?

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>