Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4902800pxv; Tue, 29 Jun 2021 19:38:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyT/v+BjnAIGSjXPdNxmKUV5OwhJVKX1VWNYaIcaCXB7aZtgn8n2npLl5Eu7Iq+GyHF9s0A X-Received: by 2002:a17:906:a20b:: with SMTP id r11mr32671664ejy.221.1625020726791; Tue, 29 Jun 2021 19:38:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625020726; cv=none; d=google.com; s=arc-20160816; b=YZjT3HQn8OU6ls14TQ4wB9YGUe9JbAepG9soK5taM65qmCPswb/v6tNcX0PyltPwXv 1aa6Tw4Fl773f5dUh6ugV9fr92Bn3uMzrzoNH7WfShXn47x5SUNmofy/Xu/JtEAuuxK0 nyy3EJ8CGUxD5yXs6f+xVDhrK90+yeFkFJx8iBn8wI7aDZ4Z6SLBockr8J/EsuYxknLN L/zBMK4dR7f93n+0JGM35ygz26+X5/Umsjl/N5gaD1yVFGJFTiQAuBKIhlWE/KOnuY8d UMa6diIXYzrakCtVKmqjTmpgHyIMiEBOQGQs67nCay31Llpin5OnWaVTnoQ8gJiHN7yB oE0w== 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=FV0Fvm8TIqPf+3WrLse0leU/LTJCfbgv8pXHi05ACig=; b=ePqpPh7w8QHsQDja/jxoudu9xjR0dcOI47n8BxGD/q5UtZbElmAW7B5MOrK0SBERYd xvYGjtJZ6fY0Wjr5YfPkmPDzkbRgdfvEYXssgJ34C1f1kCBKT7zqbUOhYjwpR9PA0BNp AOVQwdZ9gxV6dXulURMQrqi5oBFTFdn66LNngzJ13eJiD4dHhy9cIzHlUWaH/MecR60e L1LMGnoDzMb88K0/ZpuEXJisxrh135n0oHOAVr1qPgNILooHMpPKH1Ql34lFPlev7m36 YiPfK1u+kPx5boPLMMFMig8CTi2yQIhcU5ICGcoohY//KPkxu994WIUWsnVp+HRiwMk6 uZXA== 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 d10si17844283ejl.552.2021.06.29.19.38.20; Tue, 29 Jun 2021 19:38:46 -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 S233183AbhF3CjP (ORCPT + 99 others); Tue, 29 Jun 2021 22:39:15 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:34390 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S233175AbhF3CjO (ORCPT ); Tue, 29 Jun 2021 22:39:14 -0400 X-UUID: 9133614e654a4f41ace6830a2ab031df-20210630 X-UUID: 9133614e654a4f41ace6830a2ab031df-20210630 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1337792272; Wed, 30 Jun 2021 10:36:41 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Jun 2021 10:36:40 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 30 Jun 2021 10:36:39 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , Matthias Brugger , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Evan Green , Tomasz Figa , Tomasz Figa , , , , , , , , , Nicolas Boichat , , Subject: [PATCH 10/24] iommu/mediatek: Always enable output PA over 32bits in isr Date: Wed, 30 Jun 2021 10:34:50 +0800 Message-ID: <20210630023504.18177-11-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210630023504.18177-1-yong.wu@mediatek.com> References: <20210630023504.18177-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 Currently the output PA[32:33] is contained by the flag IOVA_34. This is not right. the iova_34 has no relation with pa[32:33]. the 32bits iova still could map to pa[32:33], This patch move it out of the flag. This patch no need fix tag since currently only mt8192 use the calulation and it always has this IOVA_34 flag. This is preparing for the IOMMU that still use IOVA 32bits. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index fcf70787d3d1..35e321ed6d3d 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -287,11 +287,11 @@ static irqreturn_t mtk_iommu_isr(int irq, void *dev_id) write = fault_iova & F_MMU_FAULT_VA_WRITE_BIT; if (MTK_IOMMU_HAS_FLAG(data->plat_data, IOVA_34_EN)) { va34_32 = FIELD_GET(F_MMU_INVAL_VA_34_32_MASK, fault_iova); - pa34_32 = FIELD_GET(F_MMU_INVAL_PA_34_32_MASK, fault_iova); fault_iova = fault_iova & F_MMU_INVAL_VA_31_12_MASK; fault_iova |= (u64)va34_32 << 32; - fault_pa |= (u64)pa34_32 << 32; } + pa34_32 = FIELD_GET(F_MMU_INVAL_PA_34_32_MASK, fault_iova); + fault_pa |= (u64)pa34_32 << 32; fault_port = F_MMU_INT_ID_PORT_ID(regval); if (MTK_IOMMU_HAS_FLAG(data->plat_data, HAS_SUB_COMM)) { -- 2.18.0