public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
	qat-linux@intel.com, linux-crypto@vger.kernel.org,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: qat - stop using iommu_present()
Date: Sun, 10 Apr 2022 20:52:14 +0100	[thread overview]
Message-ID: <YlM1bmo8M80Wjnov@silpixa00400314> (raw)
In-Reply-To: <ef01fbd7d2c60d56a0b8e8847a08ccb3ee5132af.1649161511.git.robin.murphy@arm.com>

On Tue, Apr 05, 2022 at 01:25:11PM +0100, Robin Murphy wrote:
> Even if an IOMMU might be present for some PCI segment in the system,
> that doesn't necessarily mean it provides translation for the device
> we care about. Replace iommu_present() with a more appropriate check.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
>  drivers/crypto/qat/qat_common/adf_sriov.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/qat/qat_common/adf_sriov.c b/drivers/crypto/qat/qat_common/adf_sriov.c
> index b960bca1f9d2..7f9c18dc4540 100644
> --- a/drivers/crypto/qat/qat_common/adf_sriov.c
> +++ b/drivers/crypto/qat/qat_common/adf_sriov.c
> @@ -3,7 +3,6 @@
>  #include <linux/workqueue.h>
>  #include <linux/pci.h>
>  #include <linux/device.h>
> -#include <linux/iommu.h>
>  #include "adf_common_drv.h"
>  #include "adf_cfg.h"
>  #include "adf_pfvf_pf_msg.h"
> @@ -176,7 +175,7 @@ int adf_sriov_configure(struct pci_dev *pdev, int numvfs)
>  		return -EFAULT;
>  	}
>  
> -	if (!iommu_present(&pci_bus_type))
> +	if (!device_iommu_mapped(&pdev->dev))
>  		dev_warn(&pdev->dev, "IOMMU should be enabled for SR-IOV to work correctly\n");
>  
>  	if (accel_dev->pf.vf_info) {
> -- 
> 2.28.0.dirty
> 
I tried this patch and it appears to work as expected.

Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>

Regards,

-- 
Giovanni

  reply	other threads:[~2022-04-10 19:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 12:25 [PATCH] crypto: qat - stop using iommu_present() Robin Murphy
2022-04-10 19:52 ` Giovanni Cabiddu [this message]
2022-04-15  8:39 ` Herbert Xu

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=YlM1bmo8M80Wjnov@silpixa00400314 \
    --to=giovanni.cabiddu@intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qat-linux@intel.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