Linux IOMMU Development
 help / color / mirror / Atom feed
From: Brian Starkey <brian.starkey@arm.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: iommu@lists.linux-foundation.org, nd@arm.com,
	liviu.dudau@arm.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/arm/malidp: Stop using iommu_present()
Date: Wed, 6 Apr 2022 10:27:00 +0100	[thread overview]
Message-ID: <20220406092700.t7o7ujk4eqn7ckgr@000377403353> (raw)
In-Reply-To: <5049994e6c2ba92c2f30d51850c8929136d0f8ca.1649167878.git.robin.murphy@arm.com>

Hi Robin,

On Tue, Apr 05, 2022 at 03:11:18PM +0100, Robin Murphy wrote:
> iommu_get_domain_for_dev() is already perfectly happy to return NULL
> if the given device has no IOMMU. Drop the unnecessary check.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

LGTM, Acked-by: Brian Starkey <brian.starkey@arm.com>

I'll have to leave it to Liviu to push though.

Thanks,
-Brian

> ---
>  drivers/gpu/drm/arm/malidp_planes.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> index 0562bdaac00c..81d9f5004025 100644
> --- a/drivers/gpu/drm/arm/malidp_planes.c
> +++ b/drivers/gpu/drm/arm/malidp_planes.c
> @@ -310,17 +310,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,
>  
>  static u32 malidp_get_pgsize_bitmap(struct malidp_plane *mp)
>  {
> -	u32 pgsize_bitmap = 0;
> +	struct iommu_domain *mmu_dom;
>  
> -	if (iommu_present(&platform_bus_type)) {
> -		struct iommu_domain *mmu_dom =
> -			iommu_get_domain_for_dev(mp->base.dev->dev);
> +	mmu_dom = iommu_get_domain_for_dev(mp->base.dev->dev);
> +	if (mmu_dom)
> +		return mmu_dom->pgsize_bitmap;
>  
> -		if (mmu_dom)
> -			pgsize_bitmap = mmu_dom->pgsize_bitmap;
> -	}
> -
> -	return pgsize_bitmap;
> +	return 0;
>  }
>  
>  /*
> -- 
> 2.28.0.dirty
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2022-04-06  9:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 14:11 [PATCH] drm/arm/malidp: Stop using iommu_present() Robin Murphy
2022-04-06  9:27 ` Brian Starkey [this message]
2022-04-11 17:34   ` Liviu Dudau

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=20220406092700.t7o7ujk4eqn7ckgr@000377403353 \
    --to=brian.starkey@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=liviu.dudau@arm.com \
    --cc=nd@arm.com \
    --cc=robin.murphy@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