Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp505417pxb; Thu, 23 Sep 2021 05:07:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0250ZBTeE8NdyFA8jr3HbakF0/0IZzhivUgRZzuXDvkuTpUJT7l/bDiUNTU5kPZvkXf+g X-Received: by 2002:a17:907:76e7:: with SMTP id kg7mr4715697ejc.344.1632398832221; Thu, 23 Sep 2021 05:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632398832; cv=none; d=google.com; s=arc-20160816; b=euVhtonG2pwessr7+OGEO9JlBN6FRunHPOreYqo6wLIyPARUmVPY9ggeXHqKOPy4az 5utzISZc01YEOrMkaRyHkUloxb+3YMZ+A7tmjVoVVh1iM22Pj/pcZ+aSV1WIRC9SKYlS yZjVWoLNCPLx7vk5KbigWuL2W1moEuZh8mHIbkuTBy/RpTaiTYF4q/sXOGl668XC/mGa UoJ7dsNJr4NGcLiXNx7VnyUzDX6QNEEJ8DlxcTsE7y4pHaa4aJxjTAU76/J/r2/VAH1I 1TLrge0q5wMVyH8uduRmeHn90P0UloFVfrb5KhaAQgOAjGK7uGATNifK23W2hMb2jT9x rL1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=aYF+2dKqKYNe5D2Pbo6bThVpwVxLpFOUX7ZGJj+JvBg=; b=xz7TfG1Yz1s9f6qUPJg8bARkSgkwZqWMlqype4xcJcDrR5b95gp+y4hF3r4yeIQcYO XIcJiIjsLY7T+H6q0NVOpHzVqLUtncLKN+xJzxLq/680cPdxsNdHveH1F+6RUfBcNl7Y HK+qDrCdAMf2R9qf2U/bq1TxDS1OZPFD7sbxkVC+UltFsp4vn4BFwhGtLD3eZiNypF0u GfDuO2pSMYozu07PSRP3aMc5t64a9lv6TgCFwiiAKpMwWtWOcIVhnJRajnuo5Ju2n4xK GE+NuwK4/5wBnCpm3zk2icCdElarnrG4yXAvWZ1PGSkX0RWGxG1qtemGqwv4qEhfe1Si kqog== 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si5733603ejh.227.2021.09.23.05.06.46; Thu, 23 Sep 2021 05:07:12 -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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240733AbhIWMEC (ORCPT + 99 others); Thu, 23 Sep 2021 08:04:02 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:54802 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S240899AbhIWMDx (ORCPT ); Thu, 23 Sep 2021 08:03:53 -0400 X-UUID: a15b9c223ceb4d16ad8ac852f6d297e1-20210923 X-UUID: a15b9c223ceb4d16ad8ac852f6d297e1-20210923 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 768908821; Thu, 23 Sep 2021 20:02:15 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 23 Sep 2021 20:02:14 +0800 Received: from localhost.localdomain (10.17.3.154) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 23 Sep 2021 20:02:13 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , Matthias Brugger , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Tomasz Figa , , , , , , , Hsin-Yi Wang , , , , , Subject: [PATCH v3 20/33] iommu/mediatek: Allow IOMMU_DOMAIN_UNMANAGED for PCIe VFIO Date: Thu, 23 Sep 2021 19:58:27 +0800 Message-ID: <20210923115840.17813-21-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210923115840.17813-1-yong.wu@mediatek.com> References: <20210923115840.17813-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow the type IOMMU_DOMAIN_UNMANAGED since vfio_iommu_type1.c always call iommu_domain_alloc. The PCIe EP works ok when going through vfio. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 2818b984c905..d103e4f33078 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -450,7 +450,7 @@ static struct iommu_domain *mtk_iommu_domain_alloc(unsigned type) { struct mtk_iommu_domain *dom; - if (type != IOMMU_DOMAIN_DMA) + if (type != IOMMU_DOMAIN_DMA && type != IOMMU_DOMAIN_UNMANAGED) return NULL; dom = kzalloc(sizeof(*dom), GFP_KERNEL); -- 2.18.0