Re: [PATCH 02/11] driver core: Set DMA ownership during driver bind/unbind

From: Christoph Hellwig
Date: Mon Nov 15 2021 - 08:20:44 EST


On Mon, Nov 15, 2021 at 10:05:43AM +0800, Lu Baolu wrote:
> @@ -566,6 +567,12 @@ static int really_probe(struct device *dev, struct device_driver *drv)
> goto done;
> }
>
> + if (!drv->suppress_auto_claim_dma_owner) {
> + ret = iommu_device_set_dma_owner(dev, DMA_OWNER_KERNEL, NULL);
> + if (ret)
> + return ret;
> + }

I'd expect this to go into iommu_setup_dma_ops (and its arm and s390
equivalents), as that is what claims an IOMMU for in-kernel usage