Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp341053pxb; Tue, 5 Apr 2022 08:03:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzovbK2oncAlCDqtl9HBEwyMckm9Ml8H2pHWJmM16guf5/7rWWCKoJfbOnWAzPK5A6OYLXj X-Received: by 2002:a17:906:c092:b0:6cd:f3a1:a11e with SMTP id f18-20020a170906c09200b006cdf3a1a11emr3936590ejz.185.1649171000218; Tue, 05 Apr 2022 08:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649171000; cv=none; d=google.com; s=arc-20160816; b=izjqN/zdOjxoyFCFUT3QsiVE5rrgBZvzU7+s8cUhHBqfMSKfUToCYHktPhqy1j5Kvx Up9DKWuvHRzzVx6RJK2D8gQXtXU+QuWJqPpHEi0i2cBRo3dOSYeMzRVRJ7DGWGA1HJAd tI1DoxfkOyVf4baucjBCucPSIybnBlmD+lcty1tNcPxnS+OwRYhF3yZIxjEKbE111jw4 mFw+FKd50JQOwVst5mY1gMz1OL4lgLWVbMHZJqJJB1MwFgm71hxdtQf6gb9UPKMrTK0u EMx12Fj5+YWnk/70zbOkbWpTaqUpcOhS9fGngcmoTiaXzIkAMiTogDeKIvBKyMY6nTJR dGKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=GDBJnTQXpXHW180XpUSABt69q2hDnnjViQlY8JJmh7A=; b=PvngU6NGUesfGOSQKWRCvzqKYcvDnkVdIzcJL4HbiR3/LzbYbPVzeaRql1lAn5G+CF 6kBPkh/n8dq8S9XyiX6m3mcuJ43RVFqHxDiOrJE1AyPlFlQV3f/tWP+3MUQNrf90JLTq NwotatBMKGj/W4OP9Mo8E5yAKXNy0950omqChxHCKSfXtJjS9Dv6PZuREUmgJfWrpxl2 5CM6p7CHABGi24yTtUegBeHhjXTTGXBmOFl3d0ilXe65/2SGD4ixsygibsULE4tSxffL glOBOUtreIj7UUo8+MSK9FR2/V5gS1phcB204zlpEs/rzAMRbI8YePNEMsck4czx5ZzV aBWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m23-20020a1709062ad700b006e80032e47bsi3435073eje.726.2022.04.05.08.02.18; Tue, 05 Apr 2022 08:03:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236610AbiDEPBI (ORCPT + 99 others); Tue, 5 Apr 2022 11:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388178AbiDENVW (ORCPT ); Tue, 5 Apr 2022 09:21:22 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A137113A; Tue, 5 Apr 2022 05:25:15 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3159FD6E; Tue, 5 Apr 2022 05:25:15 -0700 (PDT) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2B3F53F5A1; Tue, 5 Apr 2022 05:25:14 -0700 (PDT) From: Robin Murphy To: giovanni.cabiddu@intel.com, herbert@gondor.apana.org.au, davem@davemloft.net Cc: qat-linux@intel.com, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: qat - stop using iommu_present() Date: Tue, 5 Apr 2022 13:25:11 +0100 Message-Id: X-Mailer: git-send-email 2.28.0.dirty MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- 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 #include #include -#include #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