iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>,
	iommu@lists.linux-foundation.org
Cc: Ashok Raj <ashok.raj@intel.com>,
	Will Deacon <will.deacon@arm.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH V2 2/5] iommu/vt-d: Rename device_def_domain_type() to intel_iommu_dev_def_domain_type()
Date: Sun, 23 Feb 2020 07:42:27 +0800	[thread overview]
Message-ID: <5cbc8651-3a7f-95fa-3db0-704cb15978f5@linux.intel.com> (raw)
In-Reply-To: <cd79477f93816a4b0940a8f6770327772b9786af.1581619464.git.sai.praneeth.prakhya@intel.com>

Hi,

On 2020/2/17 5:57, Sai Praneeth Prakhya wrote:
> The functionality needed for iommu_ops->dev_def_domain_type() is already
> provided by device_def_domain_type() in intel_iommu.c. But, every call back
> function in intel_iommu_ops starts with intel_iommu prefix, hence rename
> device_def_domain_type() to intel_iommu_dev_def_domain_type() so that it
> follows the same semantics.

How about keep device_def_domain_type() and call it in the new
intel_iommu_dev_def_domain_type()?

Best regards,
baolu

> 
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Ashok Raj <ashok.raj@intel.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Lu Baolu <baolu.lu@linux.intel.com>
> Cc: Sohil Mehta <sohil.mehta@intel.com>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
> Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
> ---
>   drivers/iommu/intel-iommu.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index 64ddccf1d5fe..68f10d271ac0 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -3034,7 +3034,7 @@ static bool device_is_rmrr_locked(struct device *dev)
>    *  - IOMMU_DOMAIN_IDENTITY: device requires an identical mapping domain
>    *  - 0: both identity and dynamic domains work for this device
>    */
> -static int device_def_domain_type(struct device *dev)
> +static int intel_iommu_dev_def_domain_type(struct device *dev)
>   {
>   	if (dev_is_pci(dev)) {
>   		struct pci_dev *pdev = to_pci_dev(dev);
> @@ -5796,7 +5796,8 @@ static int intel_iommu_add_device(struct device *dev)
>   	domain = iommu_get_domain_for_dev(dev);
>   	dmar_domain = to_dmar_domain(domain);
>   	if (domain->type == IOMMU_DOMAIN_DMA) {
> -		if (device_def_domain_type(dev) == IOMMU_DOMAIN_IDENTITY) {
> +		if (intel_iommu_dev_def_domain_type(dev) ==
> +		    IOMMU_DOMAIN_IDENTITY) {
>   			ret = iommu_request_dm_for_dev(dev);
>   			if (ret) {
>   				dmar_remove_one_dev_info(dev);
> @@ -5807,7 +5808,7 @@ static int intel_iommu_add_device(struct device *dev)
>   			}
>   		}
>   	} else {
> -		if (device_def_domain_type(dev) == IOMMU_DOMAIN_DMA) {
> +		if (intel_iommu_dev_def_domain_type(dev) == IOMMU_DOMAIN_DMA) {
>   			ret = iommu_request_dma_domain_for_dev(dev);
>   			if (ret) {
>   				dmar_remove_one_dev_info(dev);
> @@ -6194,6 +6195,7 @@ const struct iommu_ops intel_iommu_ops = {
>   	.dev_enable_feat	= intel_iommu_dev_enable_feat,
>   	.dev_disable_feat	= intel_iommu_dev_disable_feat,
>   	.is_attach_deferred	= intel_iommu_is_attach_deferred,
> +	.dev_def_domain_type	= intel_iommu_dev_def_domain_type,
>   	.pgsize_bitmap		= INTEL_IOMMU_PGSIZES,
>   };
>   
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2020-02-22 23:42 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16 21:57 [PATCH V2 0/5] iommu: Add support to change default domain of a group Sai Praneeth Prakhya
2020-02-16 21:57 ` [PATCH V2 1/5] iommu: Add dev_def_domain_type() call back function to iommu_ops Sai Praneeth Prakhya
2020-02-22 23:37   ` Lu Baolu
2020-02-22 23:39     ` Prakhya, Sai Praneeth
2020-02-16 21:57 ` [PATCH V2 2/5] iommu/vt-d: Rename device_def_domain_type() to intel_iommu_dev_def_domain_type() Sai Praneeth Prakhya
2020-02-22 23:42   ` Lu Baolu [this message]
2020-02-22 23:59     ` Prakhya, Sai Praneeth
2020-02-23  1:50       ` Lu Baolu
2020-02-24  3:23         ` Prakhya, Sai Praneeth
2020-02-16 21:57 ` [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group Sai Praneeth Prakhya
2020-02-23  1:20   ` Lu Baolu
2020-02-24  3:20     ` Prakhya, Sai Praneeth
2020-02-24  5:46       ` Lu Baolu
2020-02-24  7:03         ` Prakhya, Sai Praneeth
2020-02-24  7:39           ` Lu Baolu
2020-02-24  7:57             ` Prakhya, Sai Praneeth
2020-02-24  8:12               ` Lu Baolu
2020-02-24  8:39                 ` Lu Baolu
2020-02-24  8:44                   ` Prakhya, Sai Praneeth
2020-03-02 15:08   ` Joerg Roedel
2020-03-03  6:47     ` Lu Baolu
2020-03-03 13:13       ` Joerg Roedel
2020-03-04 12:17         ` Lu Baolu
2020-02-16 21:57 ` [PATCH V2 4/5] iommu: Take lock before reading iommu_group default domain type Sai Praneeth Prakhya
2020-02-16 21:57 ` [PATCH V2 5/5] iommu: Document usage of "/sys/kernel/iommu_groups/<grp_id>/type" file Sai Praneeth Prakhya
2020-02-23  1:38   ` Lu Baolu
2020-02-24  2:18     ` Prakhya, Sai Praneeth
2020-02-22 23:40 ` [PATCH V2 0/5] iommu: Add support to change default domain of a group Prakhya, Sai Praneeth

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=5cbc8651-3a7f-95fa-3db0-704cb15978f5@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=robin.murphy@arm.com \
    --cc=sai.praneeth.prakhya@intel.com \
    --cc=will.deacon@arm.com \
    /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;
as well as URLs for NNTP newsgroup(s).