public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: John Garry <john.garry@huawei.com>, joro@8bytes.org, will@kernel.org
Cc: baolu.lu@linux.intel.com, iommu@lists.linux-foundation.org,
	robin.murphy@arm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 6/6] iommu: Delete iommu_dev_has_feature()
Date: Thu, 7 Jan 2021 09:18:06 +0800	[thread overview]
Message-ID: <f05ee600-705a-0c94-2a12-78eb8538234b@linux.intel.com> (raw)
In-Reply-To: <1609940111-28563-7-git-send-email-john.garry@huawei.com>

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.

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@djiang5-desk3.ch.intel.com/

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.

Best regards,
baolu

> 
> Signed-off-by: John Garry <john.garry@huawei.com>
> ---
>   drivers/iommu/iommu.c | 11 -----------
>   include/linux/iommu.h |  7 -------
>   2 files changed, 18 deletions(-)
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 20201ef97b8f..91f7871f5a37 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -2853,17 +2853,6 @@ EXPORT_SYMBOL_GPL(iommu_fwspec_add_ids);
>   /*
>    * Per device IOMMU features.
>    */
> -bool iommu_dev_has_feature(struct device *dev, enum iommu_dev_features feat)
> -{
> -	const struct iommu_ops *ops = dev->bus->iommu_ops;
> -
> -	if (ops && ops->dev_has_feat)
> -		return ops->dev_has_feat(dev, feat);
> -
> -	return false;
> -}
> -EXPORT_SYMBOL_GPL(iommu_dev_has_feature);
> -
>   int iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features feat)
>   {
>   	const struct iommu_ops *ops = dev->bus->iommu_ops;
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index 72059fcfa108..91d94c014f47 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -626,7 +626,6 @@ static inline void dev_iommu_priv_set(struct device *dev, void *priv)
>   int iommu_probe_device(struct device *dev);
>   void iommu_release_device(struct device *dev);
>   
> -bool iommu_dev_has_feature(struct device *dev, enum iommu_dev_features f);
>   int iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features f);
>   int iommu_dev_disable_feature(struct device *dev, enum iommu_dev_features f);
>   bool iommu_dev_feature_enabled(struct device *dev, enum iommu_dev_features f);
> @@ -975,12 +974,6 @@ const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode)
>   	return NULL;
>   }
>   
> -static inline bool
> -iommu_dev_has_feature(struct device *dev, enum iommu_dev_features feat)
> -{
> -	return false;
> -}
> -
>   static inline bool
>   iommu_dev_feature_enabled(struct device *dev, enum iommu_dev_features feat)
>   {
> 

  reply	other threads:[~2021-01-07  1:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 13:35 [PATCH v2 0/6] IOMMU: Some more IOVA and core code tidy-up John Garry
2021-01-06 13:35 ` [PATCH v2 1/6] iova: Make has_iova_flush_queue() private John Garry
2021-01-06 13:35 ` [PATCH v2 2/6] iova: Delete copy_reserved_iova() John Garry
2021-01-06 13:35 ` [PATCH v2 3/6] iova: Stop exporting some more functions John Garry
2021-01-06 13:35 ` [PATCH v2 4/6] iommu: Stop exporting iommu_map_sg_atomic() John Garry
2021-01-06 13:35 ` [PATCH v2 5/6] iommu: Delete iommu_domain_window_disable() John Garry
2021-01-06 13:35 ` [PATCH v2 6/6] iommu: Delete iommu_dev_has_feature() John Garry
2021-01-07  1:18   ` Lu Baolu [this message]
2021-01-07  9:13     ` John Garry
2021-01-09  9:09     ` Christoph Hellwig
2021-01-18 11:21 ` [PATCH v2 0/6] IOMMU: Some more IOVA and core code tidy-up Will Deacon
2021-01-27 11:29 ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f05ee600-705a-0c94-2a12-78eb8538234b@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=john.garry@huawei.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox