linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: David Airlie <airlied@linux.ie>, Joerg Roedel <joro@8bytes.org>,
	Will Deacon <will@kernel.org>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Nathan Myers <ncm@cantrip.org>
Cc: baolu.lu@linux.intel.com,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Robin Murphy <robin.murphy@arm.com>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] agp/intel: Use per device iommu check
Date: Tue, 8 Mar 2022 14:42:24 +0800	[thread overview]
Message-ID: <2cde656d-ad3e-6371-1647-489963ab3c33@linux.intel.com> (raw)
In-Reply-To: <20220211030531.2398789-2-baolu.lu@linux.intel.com>

On 2022/2/11 11:05, Lu Baolu wrote:
> The IOMMU subsystem has already provided an interface to query whether
> the IOMMU hardware is enabled for a specific device. This changes the
> check from Intel specific intel_iommu_gfx_mapped (globally exported by
> the Intel IOMMU driver) to probing the presence of IOMMU on a specific
> device using the generic device_iommu_mapped().
> 
> This follows commit cca084692394a ("drm/i915: Use per device iommu check")
> which converted drm/i915 driver to use device_iommu_mapped().
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>   drivers/char/agp/intel-gtt.c | 17 +++++++----------
>   1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
> index c53cc9868cd8..9631cbc7002e 100644
> --- a/drivers/char/agp/intel-gtt.c
> +++ b/drivers/char/agp/intel-gtt.c
> @@ -20,7 +20,7 @@
>   #include <linux/kernel.h>
>   #include <linux/pagemap.h>
>   #include <linux/agp_backend.h>
> -#include <linux/intel-iommu.h>
> +#include <linux/iommu.h>
>   #include <linux/delay.h>
>   #include <asm/smp.h>
>   #include "agp.h"
> @@ -573,18 +573,15 @@ static void intel_gtt_cleanup(void)
>    */
>   static inline int needs_ilk_vtd_wa(void)
>   {
> -#ifdef CONFIG_INTEL_IOMMU
>   	const unsigned short gpu_devid = intel_private.pcidev->device;
>   
> -	/* Query intel_iommu to see if we need the workaround. Presumably that
> -	 * was loaded first.
> +	/*
> +	 * Query iommu subsystem to see if we need the workaround. Presumably
> +	 * that was loaded first.
>   	 */
> -	if ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG ||
> -	     gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
> -	     intel_iommu_gfx_mapped)
> -		return 1;
> -#endif
> -	return 0;
> +	return ((gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG ||
> +		 gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
> +		device_iommu_mapped(&intel_private.pcidev->dev));
>   }
>   
>   static bool intel_gtt_can_wc(void)

A gentle ping ...:-)

Best regards,
baolu

  reply	other threads:[~2022-03-08  6:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11  3:05 [PATCH 0/2] Replace intel_iommu_gfx_mapped with device_iommu_mapped() Lu Baolu
2022-02-11  3:05 ` [PATCH 1/2] agp/intel: Use per device iommu check Lu Baolu
2022-03-08  6:42   ` Lu Baolu [this message]
2022-02-11  3:05 ` [PATCH 2/2] iommu/vt-d: Remove unnecessary exported symbol Lu Baolu

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=2cde656d-ad3e-6371-1647-489963ab3c33@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=chris@chris-wilson.co.uk \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=ncm@cantrip.org \
    --cc=robin.murphy@arm.com \
    --cc=tvrtko.ursulin@intel.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;
as well as URLs for NNTP newsgroup(s).