All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Lu Baolu <baolu.lu@linux.intel.com>
Cc: John Garry <john.garry@huawei.com>,
	joro@8bytes.org, will@kernel.org,
	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: Sat, 9 Jan 2021 09:09:21 +0000	[thread overview]
Message-ID: <20210109090921.GA93456@infradead.org> (raw)
In-Reply-To: <f05ee600-705a-0c94-2a12-78eb8538234b@linux.intel.com>

On Thu, Jan 07, 2021 at 09:18:06AM +0800, Lu Baolu wrote:
> 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.

This doesn't have an upstream user, and did not have for years!  If
new users show up they can add it back.  Note that the above API with
a separate has vs enable is horrible anyway - the right way is to just
enable and fail it with a specific error code if not supported.

We have a general rule that APIs should only be introduced with their
users, and this example just confirms the reasons of why that rule is in
place once again.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Lu Baolu <baolu.lu@linux.intel.com>
Cc: will@kernel.org, linux-kernel@vger.kernel.org,
	iommu@lists.linux-foundation.org, robin.murphy@arm.com
Subject: Re: [PATCH v2 6/6] iommu: Delete iommu_dev_has_feature()
Date: Sat, 9 Jan 2021 09:09:21 +0000	[thread overview]
Message-ID: <20210109090921.GA93456@infradead.org> (raw)
In-Reply-To: <f05ee600-705a-0c94-2a12-78eb8538234b@linux.intel.com>

On Thu, Jan 07, 2021 at 09:18:06AM +0800, Lu Baolu wrote:
> 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.

This doesn't have an upstream user, and did not have for years!  If
new users show up they can add it back.  Note that the above API with
a separate has vs enable is horrible anyway - the right way is to just
enable and fail it with a specific error code if not supported.

We have a general rule that APIs should only be introduced with their
users, and this example just confirms the reasons of why that rule is in
place once again.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  parent reply	other threads:[~2021-01-09  9:11 UTC|newest]

Thread overview: 24+ 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 ` 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   ` John Garry
2021-01-06 13:35 ` [PATCH v2 2/6] iova: Delete copy_reserved_iova() John Garry
2021-01-06 13:35   ` John Garry
2021-01-06 13:35 ` [PATCH v2 3/6] iova: Stop exporting some more functions John Garry
2021-01-06 13:35   ` 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   ` John Garry
2021-01-06 13:35 ` [PATCH v2 5/6] iommu: Delete iommu_domain_window_disable() John Garry
2021-01-06 13:35   ` John Garry
2021-01-06 13:35 ` [PATCH v2 6/6] iommu: Delete iommu_dev_has_feature() John Garry
2021-01-06 13:35   ` John Garry
2021-01-07  1:18   ` Lu Baolu
2021-01-07  1:18     ` Lu Baolu
2021-01-07  9:13     ` John Garry
2021-01-07  9:13       ` John Garry
2021-01-09  9:09     ` Christoph Hellwig [this message]
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-18 11:21   ` Will Deacon
2021-01-27 11:29 ` Joerg Roedel
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=20210109090921.GA93456@infradead.org \
    --to=hch@infradead.org \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.