Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5361959pxv; Wed, 28 Jul 2021 09:01:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWOP4OyVNBdlZ4oWdEV3LMpa7hCGkYvbKvNGAJ8R7ZglHq+QC27cPOz3jVBnKA2GxW0tjl X-Received: by 2002:a5e:8519:: with SMTP id i25mr162769ioj.152.1627488081292; Wed, 28 Jul 2021 09:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627488081; cv=none; d=google.com; s=arc-20160816; b=ZsNsiaJ6FLsVf03r2fFry0tylD3ZA2lZF6QyQGjsmO4J5HODU4S9r4LjrFcf9Qd1Qx Pn9yThXVQxOaNEviXKcv/S61YhuDVvLcv4ESVvdFWkHCXf43KMG+Q4SI8WWpb8yPLAP3 jVLZBJyj0F3VsoxbcyIUFAyFQ/ytkW3utcmjQZA0bxG1GlV6gUk+VD/2jTYgjPRz/i0J lvPa6slyXnWeSqcT6uFPTBMvfhPQkTeh1tMJ54k33Tp5fnNkgjjGuU9ltLdISRd84XIe A0B8a2bPxl6c51zX/j3tgfOI6RYw3z8vvrHrs7Y5d6cwCrzGT/dTl06qJt64xx1DVj1y E38w== 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=krNgNJy/dhFO5pc6HxzIeu83X3i9CZrcGh7GgpKwa8M=; b=lYRKV06vIq5DTAKgojkTMZI9EMrFL5okBCi92oB5S7tZF5Z7DRjMLGJnmfQgWy3BZV sW8s9AfUpVdWElgOyZvl80jkPBAUuAMKm/ZQafaH35PnTOjl65ZtEfo5dxiCcLCIFojW Pb01H023zPfZqooJsxgG9v0PFkteHSi9wBJg1vYDxZ9RYCVMfNka07LVJNh1tQWHtGYv idjSfnsFrtwCkuFQfiolvrMAiPlUUrtWZUNpAX+n5KRmjuIGlH3Gxm1Nq0UtsDjJSBHn +EQGlqDeNHMCdUnoaW5RZ4aW+MyyOqdiYx+ILwJJq2GyrqBjX7uMkR1N+xTH2sYStWOU BKZA== 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 q11si237164ilv.18.2021.07.28.09.01.09; Wed, 28 Jul 2021 09:01:21 -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 S237528AbhG1P7s (ORCPT + 99 others); Wed, 28 Jul 2021 11:59:48 -0400 Received: from foss.arm.com ([217.140.110.172]:59426 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237358AbhG1P7e (ORCPT ); Wed, 28 Jul 2021 11:59:34 -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 DEAD9D6E; Wed, 28 Jul 2021 08:59:32 -0700 (PDT) Received: from 010265703453.arm.com (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 667AA3F70D; Wed, 28 Jul 2021 08:59:31 -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 v2 15/24] iommu/amd: Prepare for multiple DMA domain types Date: Wed, 28 Jul 2021 16:58:36 +0100 Message-Id: <350e1380a60dece383ab358e4b30f27b0b9a497c.1627468309.git.robin.murphy@arm.com> 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 The DMA ops reset/setup can simply be unconditional, since iommu-dma already knows only to touch DMA domains. Signed-off-by: Robin Murphy --- drivers/iommu/amd/iommu.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 0fd98d35d73b..02f9b4fffe90 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -1707,14 +1707,9 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev) static void amd_iommu_probe_finalize(struct device *dev) { - struct iommu_domain *domain; - /* Domains are initialized for this device - have a look what we ended up with */ - domain = iommu_get_domain_for_dev(dev); - if (domain->type == IOMMU_DOMAIN_DMA) - iommu_setup_dma_ops(dev, 0, U64_MAX); - else - set_dma_ops(dev, NULL); + set_dma_ops(dev, NULL); + iommu_setup_dma_ops(dev, 0, U64_MAX); } static void amd_iommu_release_device(struct device *dev) -- 2.25.1