mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Joerg Roedel <joro@8bytes.org>,
	iommu@lists.linux-foundation.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joerg Roedel <jroedel@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] iommu/of: Use device_iommu_mapped()
Date: Wed, 5 Dec 2018 17:17:54 +0000	[thread overview]
Message-ID: <44c82503-bc36-e8de-6932-7c4fd2b597f8@arm.com> (raw)
In-Reply-To: <20181204172504.19708-3-joro@8bytes.org>

On 04/12/2018 17:25, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> Use Use device_iommu_mapped() to check if the device is
> already mapped by an IOMMU.

FWIW, this check (and its ACPI equivalent in patch #3) is specifically 
asking "has .add_device() already been called?", rather than the more 
general "is this device managed by an IOMMU?" (to which the exact answer 
at this point is "yes, provided we return successfully from here").

I have no objection to the change as-is - especially if that usage is 
within the intended scope of this API - I just wanted to call it out in 
case you're also planning to introduce something else which would be 
even more appropriate for that.

Robin.

> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>   drivers/iommu/of_iommu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
> index c5dd63072529..bfcf139503f0 100644
> --- a/drivers/iommu/of_iommu.c
> +++ b/drivers/iommu/of_iommu.c
> @@ -220,7 +220,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
>   	 * If we have reason to believe the IOMMU driver missed the initial
>   	 * add_device callback for dev, replay it to get things in order.
>   	 */
> -	if (ops && ops->add_device && dev->bus && !dev->iommu_group)
> +	if (ops && ops->add_device && dev->bus && !device_iommu_mapped(dev))
>   		err = ops->add_device(dev);
>   
>   	/* Ignore all other errors apart from EPROBE_DEFER */
> 

  reply	other threads:[~2018-12-05 17:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 17:24 [PATCH 0/5] Introduce device_iommu_maped() function Joerg Roedel
2018-12-04 17:25 ` [PATCH 1/5] driver core: Introduce device_iommu_mapped() function Joerg Roedel
2018-12-06 12:55   ` Greg Kroah-Hartman
2018-12-06 15:39     ` Joerg Roedel
2018-12-04 17:25 ` [PATCH 2/5] iommu/of: Use device_iommu_mapped() Joerg Roedel
2018-12-05 17:17   ` Robin Murphy [this message]
2018-12-06 15:35     ` Joerg Roedel
2018-12-06 17:42       ` Robin Murphy
2018-12-07  9:31         ` Joerg Roedel
2018-12-04 17:25 ` [PATCH 3/5] ACPI/IORT: " Joerg Roedel
2018-12-04 17:25 ` [PATCH 4/5] powerpc/iommu: " Joerg Roedel
2018-12-04 17:25 ` [PATCH 5/5] xhci: " Joerg Roedel
2018-12-05 17:17 ` [PATCH 0/5] Introduce device_iommu_maped() function Robin Murphy
2018-12-06 15:36   ` 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=44c82503-bc36-e8de-6932-7c4fd2b597f8@arm.com \
    --to=robin.murphy@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.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

Powered by JetHome