Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp14794pxv; Wed, 21 Jul 2021 14:08:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTP61/zsuzWBEbtGx+MTQ+jHo134Ej8ahJiRy5b8eslAR5Ut5Fd9s6a3QzYfG53D1IoYNT X-Received: by 2002:a92:cb0b:: with SMTP id s11mr25125654ilo.292.1626901578537; Wed, 21 Jul 2021 14:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626901578; cv=none; d=google.com; s=arc-20160816; b=CyzI6H8tgJ+MSiAebU24pwuJDbsNwWAmKP5rV8gclXvck2JfC/1dnn8YMH1SWcm+I/ XXQH9ePlZdSInN5X1znCDdW9a5AhPRuXFiEmxlJoWZqZS7VQ9VbDhQMhZ0mNyuPPwC1x /y/DJsgjbleC35jmYuc1grtADOeAOBS8X1FLGX/wFa0rXrGbKJFAVH6moiwUFjZRQFUc NOdyVgQbLHXsEU11eE3Lm9ZReUWSdkh/ZiCwQJCLK4H6NYn1+lNuTyBRrdrBlOtt+vwg 5VxopUWEwLaiEtSRBe/2Gs6XjhKoAf0TnvTCBUL9itESzp3txp5Bx2DBmKlFvaKOJePS KCYQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=U0iG/PhFvnMyH6t4Mp6EYbEzeCdpOy3CzoKpP832nms=; b=GvjSm2Mz7wPi3iE9/fPwnioddSDO+gJAOZRpEY2wmElwBUwyKCKGmCzU3Sv94DMR6O qA7VcB95G5Or0wls8yF9IGWYYTbJGBbWoyJdWAzw5g/zZGdeKvPQKEIrnDgIbq9q+7t0 4BqDs3UMURVsFfTBo7sWJGNuSsgYFv5lgkKGcCAhiw+zf+bAYx0isjqviOEcvES6/I/B iLAoSnn9u4wsbqk1Ta2nQqueqwTDCsqX3sjTdIOmtLZITKYxFCVE7UZPA7EFnJKiHGU1 QCeTFtKUjViiLTBRbUmfHzp0bUbUjUnTAlE83WidD/SHpbIMPK9szyYtXUX2f9+0UuAS ITKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si26379943ioj.88.2021.07.21.14.06.07; Wed, 21 Jul 2021 14:06:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S238513AbhGURkn (ORCPT + 99 others); Wed, 21 Jul 2021 13:40:43 -0400 Received: from foss.arm.com ([217.140.110.172]:33328 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235622AbhGURka (ORCPT ); Wed, 21 Jul 2021 13:40:30 -0400 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 4AA8E11FB; Wed, 21 Jul 2021 11:21:06 -0700 (PDT) Received: from 010265703453.arm.com (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CD8493F694; Wed, 21 Jul 2021 11:21:04 -0700 (PDT) From: Robin Murphy To: joro@8bytes.org, will@kernel.org Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, suravee.suthikulpanit@amd.com, baolu.lu@linux.intel.com, john.garry@huawei.com, dianders@chromium.org Subject: [PATCH 12/23] iommu/dma: Unexport IOVA cookie management Date: Wed, 21 Jul 2021 19:20:23 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org IOVA cookies are now got and put by core code, so we no longer need to export these to modular drivers. The export for getting MSI cookies stays, since VFIO can still be a module, but it was already relying on someone else putting them, so that aspect is unaffected. Signed-off-by: Robin Murphy --- drivers/iommu/dma-iommu.c | 7 ------- drivers/iommu/iommu.c | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 98ba927aee1a..10067fbc4309 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -98,9 +98,6 @@ static struct iommu_dma_cookie *cookie_alloc(enum iommu_dma_cookie_type type) /** * iommu_get_dma_cookie - Acquire DMA-API resources for a domain * @domain: IOMMU domain to prepare for DMA-API usage - * - * IOMMU drivers should normally call this from their domain_alloc - * callback when domain->type == IOMMU_DOMAIN_DMA. */ int iommu_get_dma_cookie(struct iommu_domain *domain) { @@ -113,7 +110,6 @@ int iommu_get_dma_cookie(struct iommu_domain *domain) return 0; } -EXPORT_SYMBOL(iommu_get_dma_cookie); /** * iommu_get_msi_cookie - Acquire just MSI remapping resources @@ -151,8 +147,6 @@ EXPORT_SYMBOL(iommu_get_msi_cookie); * iommu_put_dma_cookie - Release a domain's DMA mapping resources * @domain: IOMMU domain previously prepared by iommu_get_dma_cookie() or * iommu_get_msi_cookie() - * - * IOMMU drivers should normally call this from their domain_free callback. */ void iommu_put_dma_cookie(struct iommu_domain *domain) { @@ -172,7 +166,6 @@ void iommu_put_dma_cookie(struct iommu_domain *domain) kfree(cookie); domain->iova_cookie = NULL; } -EXPORT_SYMBOL(iommu_put_dma_cookie); /** * iommu_dma_get_resv_regions - Reserved region driver helper diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 0952de57c466..e23d0c9be9db 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1942,8 +1942,7 @@ static struct iommu_domain *__iommu_domain_alloc(struct bus_type *bus, /* Assume all sizes by default; the driver may override this later */ domain->pgsize_bitmap = bus->iommu_ops->pgsize_bitmap; - /* Temporarily ignore -EEXIST while drivers still get their own cookies */ - if (type == IOMMU_DOMAIN_DMA && iommu_get_dma_cookie(domain) == -ENOMEM) { + if (type == IOMMU_DOMAIN_DMA && iommu_get_dma_cookie(domain)) { iommu_domain_free(domain); domain = NULL; } -- 2.25.1