Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5368576pxv; Wed, 28 Jul 2021 09:08:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1EYU4NmR8paW14oYLa7+ptH49Xpv6WD4Fba/+zBmUDnygU2USMEPmNxx7O655aWi+idOE X-Received: by 2002:a05:6402:111a:: with SMTP id u26mr689767edv.260.1627488499308; Wed, 28 Jul 2021 09:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627488499; cv=none; d=google.com; s=arc-20160816; b=iAdQIekSC/n/1HV2Inf7P5CiY9C1OaS75I3Mwj1AlFq2QPtUCbalal1Y7dK8JW+IUY RSxpMmaFEmHwowELO9C7+NTpojch+N3biKg9NCv8+LM1/8iphuTTXEVO0ty72xFoy/Rx az6larWp85RjKzwtoOo80eLqZJLbO2so123YSWoRcVG5P4gFSbprjciW9olJ5+0b+DKI 1i4hrX39P/7r8BSBiZw4e7EfhY36EPSabwyP9D4xdc7yG5ckTtSSDTuTgNDRTsxzr82Z AiD/kTNv3R7Su7An+VMOC7CHrR2nx3KOGFczT1tE8m0YuxVl2AG3YnpZVvEbBtQCYKev 5v+w== 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=2S6RJRJx1gmS06gFyCZkk8YiS1qzhsg0ysY4XXSltOU=; b=eb2yKfuozNyP7SnYMOiuqEA8aiza+NtBlQIJQsPU3HOgw1FMqbI6ez7wAbnQcncB4u oMaOOCrsM2AqJsf9YMoQ2pxBm9xnJ6hcSxaKEwKTU3ZFV7+CL+6QlNQMFsqhhr3aFY3P 2vGFhLZxWE89wYq2lLhwN/lR6egjumKY12GuomInEPWiHJYiBbZ6ECvIFAWPFQaHcTbG 1wvwQAexexSjmqyaCqPtZaNdyjYyiQXP5QciQgfQjDunKb17QjLhvDeS6XpJ3jLv348m Dl9KdTOdb1timI0rRep9hKQrxiN0Cy72k516CgwsXhbSCquZrs4zeWukVzl9Qa3hmoVP 0jPw== 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 kw22si188955ejc.489.2021.07.28.09.07.51; Wed, 28 Jul 2021 09:08:19 -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 S237550AbhG1P7x (ORCPT + 99 others); Wed, 28 Jul 2021 11:59:53 -0400 Received: from foss.arm.com ([217.140.110.172]:59488 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237477AbhG1P7g (ORCPT ); Wed, 28 Jul 2021 11:59:36 -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 9DCF71FB; Wed, 28 Jul 2021 08:59:34 -0700 (PDT) Received: from 010265703453.arm.com (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2D26C3F70D; Wed, 28 Jul 2021 08:59:33 -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 16/24] iommu/arm-smmu: Prepare for multiple DMA domain types Date: Wed, 28 Jul 2021 16:58:37 +0100 Message-Id: <1b8de44ba75f130964c89d748c5dd939f67f366f.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 In preparation for the strict vs. non-strict decision for DMA domains to be expressed in the domain type, make sure we expose our flush queue awareness by accepting the new domain type. Signed-off-by: Robin Murphy --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 + drivers/iommu/arm/arm-smmu/arm-smmu.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 4c648da447bf..a1f0d83d1eb5 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1972,6 +1972,7 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned type) if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA && + type != IOMMU_DOMAIN_DMA_FQ && type != IOMMU_DOMAIN_IDENTITY) return NULL; diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 970d9e4dcd69..936c5e9d5e82 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -869,7 +869,8 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned type) struct arm_smmu_domain *smmu_domain; if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_IDENTITY) { - if (using_legacy_binding || type != IOMMU_DOMAIN_DMA) + if (using_legacy_binding || + (type != IOMMU_DOMAIN_DMA && type != IOMMU_DOMAIN_DMA_FQ)) return NULL; } /* -- 2.25.1