Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5433600ybp; Mon, 14 Oct 2019 22:40:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgqAhK3oT1lp/nkrekLnofmrLrd0k6dJz7x+9poyrc0eJjbbaYIOMq4MuN8gMuhaqUC1U8 X-Received: by 2002:a17:906:c49:: with SMTP id t9mr32468102ejf.267.1571118017700; Mon, 14 Oct 2019 22:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571118017; cv=none; d=google.com; s=arc-20160816; b=BBJO28v9lSWm9FUZTzg08TzSHOKcmGDfSGm7JFsqh0eRDbrOTWTgyoizt3Y9/n5SZj vMaiaYGSELMOH2e8kGC9jSmRNJQxxMy/Cg+X6llMsjFZWeZph38vCgdMrzRZgrU8/4GR z9JrlTZhRhwnE0/Fcr9FJqYMwJxXtx9us1Xeri3Xkb+wpyz0ForvqBnoURaQcfOMwDIm +qPH4fFn8BLaG5QBqHyTInTQdfdjioqvWW5X6wrbhDplPbx4NImUBx8gl0tfuyJ6Nda6 HvpSFoglznJlziDE+bwuimWMQDG7kdlKUKwqCehAIltjAJ2Jvx7mFZ7Ayv0N2IF3LQgU wxeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=7NOdS7H2uh18ZcOULlCEqceFlsW4z19MafeP+1ZnENs=; b=avz/C1YQfEO2fvxcDsi/70irsr+xgIyYUZnVamInY5y2lUx+rL80pnm05QLvkcOMDV A0tVUG1e16T5Du3ws0CxELqiJsZejDar7HvF0mT0jhbJ7TB7OTllyjX6bB8KzrIu/Kbe eWVYsF7VOhLBQJ05wHUw8vPotg1FE/jsNd39HfX201y2T2Vk1vJhMYZ0WMnGzETQ5pQ8 FmQeUwkcSYfWzzPxhr6GlddjRLaNUi9tHGEpwGaivVaRF4lVLgv/wlaPBhi8e1GC2hja n7CnHH8gVnhECUfG7xVrmvqlZxBI6ExN4NJu37z6bbwWOzQV90FhM4fI1NK43kNILAWT SJ8w== 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 f5si12073068edx.302.2019.10.14.22.39.53; Mon, 14 Oct 2019 22:40:17 -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 S1728301AbfJOFZ4 (ORCPT + 99 others); Tue, 15 Oct 2019 01:25:56 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:27611 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728254AbfJOFZz (ORCPT ); Tue, 15 Oct 2019 01:25:55 -0400 X-UUID: f6e622fa625d41909af3235d2d7e170c-20191015 X-UUID: f6e622fa625d41909af3235d2d7e170c-20191015 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2005909881; Tue, 15 Oct 2019 13:25:41 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 15 Oct 2019 13:25:39 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 15 Oct 2019 13:25:39 +0800 Message-ID: <1571117141.19130.82.camel@mhfsdcap03> Subject: Re: [PATCH v3 6/7] iommu/mediatek: Use writel for TLB range invalidation From: Yong Wu To: Robin Murphy CC: Matthias Brugger , Joerg Roedel , Will Deacon , , , Nicolas Boichat , , , , , , Evan Green , Tomasz Figa , , , Date: Tue, 15 Oct 2019 13:25:41 +0800 In-Reply-To: References: <1571035101-4213-1-git-send-email-yong.wu@mediatek.com> <1571035101-4213-7-git-send-email-yong.wu@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-SNTS-SMTP: F7B169CFC27DA96FE703EAD572803384264DF78C3B40C94DC763E2363F6E10A82000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-10-14 at 15:04 +0100, Robin Murphy wrote: > On 14/10/2019 07:38, Yong Wu wrote: > > 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. > > For Arm CPUs, these registers should be mapped as Device memory, > therefore the same-peripheral rule should implicitly enforce that the > accesses are made in program order, hence you're unlikely to have seen a > problem in reality. However, the logical reasoning for the change seems > valid in general, so I'd argue that it's still worth making if only for > the sake of good practice: > > Acked-by: Robin Murphy Thanks very much for the view. If this patch is not so necessary, I will remove it this time. > > > Signed-off-by: Anan.Sun > > Signed-off-by: Yong Wu > > --- > > 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 dbbacc3..d285457 100644 > > --- a/drivers/iommu/mtk_iommu.c > > +++ b/drivers/iommu/mtk_iommu.c > > @@ -187,8 +187,7 @@ static void mtk_iommu_tlb_flush_range_sync(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); > > > > /* tlb sync */ > > ret = readl_poll_timeout_atomic(data->base + REG_MMU_CPE_DONE, > > > > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek