Re: [PATCH v2 6/6] iommu: Delete iommu_dev_has_feature()

From: John Garry
Date: Thu Jan 07 2021 - 04:15:58 EST


On 07/01/2021 01:18, Lu Baolu wrote:
On 1/6/21 9:35 PM, John Garry wrote:
Function iommu_dev_has_feature() has never been referenced in the tree,
and there does not appear to be anything coming soon to use it, so delete
it.


Hi baolu,

It will be used by the device driver which want to support the aux-
domain capability, for example, below series is under discussion.

https://lore.kernel.org/linux-pci/160408357912.912050.17005584526266191420.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxx/

So I did check linux-iommu lore for recent references, above, but did not see this one - that really should have cc'ed linux-iommu list (which it didn't).


The typical use case is

        if (iommu_dev_has_feature(dev, IOMMU_DEV_FEAT_AUX)) {
                rc = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_AUX);
                if (rc < 0) {
                        dev_warn(dev, "Failed to enable aux-domain: %d\n", rc);
                        return rc;
                }
        }

So please don't remove it.


ok, fine. It also seems that this API has not had a user since it was introduced in v5.2.

Thanks,
John

Ps. I suppose a v3 series is not needed ATM - this patch can just be dropped.