Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1139265ybp; Fri, 11 Oct 2019 09:30:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDinzkoguTLjUD3Ee+qMRDOpdQZuYcQJSODt2WaW/g8P9WKhRfetOZEVn89F9u7DP5dDXf X-Received: by 2002:a17:906:1f44:: with SMTP id d4mr14486042ejk.16.1570811451149; Fri, 11 Oct 2019 09:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570811451; cv=none; d=google.com; s=arc-20160816; b=mGOZco5w3nom3F7ynHKm01YeKb8x6HAHPjEclHiNkjxNLDjyBxWqnrDfY88Ny5l/OW ifJYQwCtpvsMlQoTG3n12UpDAGSHpmkqshO6iu56zryxqzF60D2nEcRdgcUBJC/37AqG +9Tn1AgTcKNVDyJtG2USDfFuT4J+AdrmaTZHHtbzoJv5LI8DqnKsCer3NRy7FP+/A7tB 9Dy93qeDcskS0XVeklQt0JQfECszlveNR52YwgRqnCjP/Oa7N62egL3efArJRHNY8IkD Njwvi5Zqv4evj4biBMtpdKAniuUgMsg8WsNXOg6ovjxvISlXj7xxaSu9Bk8qfOUO3npN fbfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GoLilvbuSE0lKcoA8B88R/O6eopsYzqWkvlggDeXKOM=; b=CcQRU8zNKFZuRQC0UhrUVM7+0IDuZBFY35zO6AWiJyPWFhSL4RzBHqU/Qo0Q/ZIaCG 08UXbZ/S5mKMkm4JXKbsGOv5uczlBxJKRbyEji22f2HQ5niSkeWfui/pVvIfGA81rcbM ue4jhY+PuSUhRKGzoOzhH/CWPORK5WEmUTMXitsKw+d5HMfc430U2uxPsvocWKPaj8d+ kv6K/R4bH2Y47y+rQ5KlF3aFW61hRfZM9rtpzCmmvtmxGMDGwFi5eCisN+g6TMQYQmrY 9UN2zS0oq0nUa3SqpqVA+9ru3Xo1iFqn8MX7Ay1yRZj5l4gk9+4VIbc69HyQaNOyZXoR jLGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OomCe3cn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35si6937937edb.204.2019.10.11.09.30.26; Fri, 11 Oct 2019 09:30:51 -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; dkim=pass header.i=@kernel.org header.s=default header.b=OomCe3cn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727149AbfJKQ36 (ORCPT + 99 others); Fri, 11 Oct 2019 12:29:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:39118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726331AbfJKQ36 (ORCPT ); Fri, 11 Oct 2019 12:29:58 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B46B206A1; Fri, 11 Oct 2019 16:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570811397; bh=fnuGUPlEYnveHJBCoFm6BNlgI5r2U57EfCBDivju0X0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OomCe3cnkNKTi9sl0Vi5Ay7Kjv8WBCQ1b6XD1IwK/cm0Z+poV3hmYgh7RkrBqwCoM pjntqLBD5FtPdil6R7y2/5GQGrCBGjJDN/rnwS1X4L1SuTDzWaZMxCS07pnlNkO1A9 MsvzOVh7vA25gXMtLUEaPzD9qiGr3zcnOdprfiRU= Date: Fri, 11 Oct 2019 17:29:51 +0100 From: Will Deacon To: Yong Wu Cc: Matthias Brugger , Joerg Roedel , Will Deacon , Evan Green , Robin Murphy , Tomasz Figa , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, youlin.pei@mediatek.com, Nicolas Boichat , anan.sun@mediatek.com, cui.zhang@mediatek.com, chao.hao@mediatek.com Subject: Re: [PATCH v2 3/4] iommu/mediatek: Use writel for TLB range invalidation Message-ID: <20191011162950.yg4o77mlaicacne5@willie-the-truck> References: <1570627143-29441-1-git-send-email-yong.wu@mediatek.com> <1570627143-29441-3-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1570627143-29441-3-git-send-email-yong.wu@mediatek.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 09, 2019 at 09:19:02PM +0800, 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. > > 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); I don't understand this change. Why is it an "improvement" and which accesses are you ordering with the writel? Will