Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp921618ybp; Wed, 9 Oct 2019 06:20:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxW37/KyCOGl9KeiUZMK5wOGIB7nZlmuiGPTNA5AWIhdqt9oqkBSf36q5DwbdX1Opd/PSkf X-Received: by 2002:a17:906:4a95:: with SMTP id x21mr2893538eju.18.1570627259550; Wed, 09 Oct 2019 06:20:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570627259; cv=none; d=google.com; s=arc-20160816; b=DO6HgXDAVoz6JZmh0iG0N792yjgs8tfsmYlKz+z/4y6Tz16amFtNLsNxbuA5Bm7adR V2UHm6LJP/hEiohP/SiHVcUB4TDVuPr+wVusZxZni8oVlXd0zi3mfHVX2pfv7q7x0rAn AIQYdavWLPku//vN2AvvlXKgvcO1aUOIAGQ7XLMHuhvBTMkxbpoM9aS8x6x48yjI1pr7 QejjqeI0V85vby+ck/2OlkxKd+pDsOhjKYeGZAK9V6JXfZrmbjrfXE+dFj5EU8lFrfzT slDiE8X2b+ufkHQ+kKdLbrPrmXdek8rU1UWSLN+RzD5CeQIbCHVxmh61PSuYDOfKAFWA 4XzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=072ykBiR1G22RSqLe7g6uEn0c5GpMF15tG+l/zx1O1w=; b=IgTtMcif7N8gLMxIKQV+H8XejScqIPGhN35rxLKXOeBmXenHZGZbp4DHzaoVgQE26n iRDp5AavWaa4y4KCRaasdZKkADZBZhJklPccTYpUKeT104IMkOcBgykdw90KnQpyMm/Q JWhmOzxxpMzKD4kT5Ul7lJHN2OW75OEwoCbQK1MofYdGG6euWAlXRUaGfqdAkPovx5GB JOgOSTcz513T2J58T6770VNS/i6nM4+AD71tvUPuK0loKcZs+sJdhUt3ndONjXSo6Gr7 ZJkXHaQbL4O5TZ0o3IyJ0qim+cQ2TtdibXhyvvAfsv4JZ4czfrKHguh3mkcXPXjjq9nM Txuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id a16si1142628ejb.54.2019.10.09.06.20.36; Wed, 09 Oct 2019 06:20:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1731393AbfJINT0 (ORCPT + 99 others); Wed, 9 Oct 2019 09:19:26 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:47085 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729883AbfJINT0 (ORCPT ); Wed, 9 Oct 2019 09:19:26 -0400 X-UUID: b439e525e90148db9f2b6353af71c18e-20191009 X-UUID: b439e525e90148db9f2b6353af71c18e-20191009 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 340920298; Wed, 09 Oct 2019 21:19:20 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 9 Oct 2019 21:19:16 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 9 Oct 2019 21:19:15 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Will Deacon CC: Evan Green , Robin Murphy , Tomasz Figa , , , , , , , , Nicolas Boichat , , , Subject: [PATCH v2 3/4] iommu/mediatek: Use writel for TLB range invalidation Date: Wed, 9 Oct 2019 21:19:02 +0800 Message-ID: <1570627143-29441-3-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1570627143-29441-1-git-send-email-yong.wu@mediatek.com> References: <1570627143-29441-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use writel for the register F_MMU_INV_RANGE which is for triggering the HW work. We expect all the setting(iova_start/iova_end...) have already been finished before F_MMU_INV_RANGE. Signed-off-by: Anan.Sun Signed-off-by: Yong Wu --- This is a improvement rather than fixing a issue. --- drivers/iommu/mtk_iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 24a13a6..607f92c 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -187,8 +187,7 @@ static void mtk_iommu_tlb_add_flush(unsigned long iova, size_t size, writel_relaxed(iova, data->base + REG_MMU_INVLD_START_A); writel_relaxed(iova + size - 1, data->base + REG_MMU_INVLD_END_A); - writel_relaxed(F_MMU_INV_RANGE, - data->base + REG_MMU_INVALIDATE); + writel(F_MMU_INV_RANGE, data->base + REG_MMU_INVALIDATE); /* * There is no tlb flush queue in the HW, the HW always expect -- 1.9.1