Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4163490ybp; Sun, 13 Oct 2019 23:43:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnb2T++kaJJawfc6aH2idvDtxlsSepn2UfPGPGhNBH1RbbyJUlLb2mvIEukqX7b9iBzfo1 X-Received: by 2002:a05:6402:503:: with SMTP id m3mr26900389edv.157.1571035388267; Sun, 13 Oct 2019 23:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571035388; cv=none; d=google.com; s=arc-20160816; b=RZjbDieOJk+OXWMdtm+zPz+CwCot0lRjtFqcDAlhWX8M652uQBZktHkeg57xqv5/v9 yxjcvY610MEFegkucP8BEuVb6cIsj94LdpBEWbDoH+njuqreryTkUDDtBFMqg5GQ/UQP Ur1cw7wbCd9+8J5z1tY3tyDOWnurwvoK2gNrg1HenH5X4ssQppGOx0BI/B7OD7D/40OS rsTrsiuf7eFRAl459nTYBFjbBw/8NCtrvqixe7rxyw2BGilwLdEGsNo+x0IdLeXGbh1e jtzrfcHGfFxBNRsCuXt9m7oZoQGqS2h6wVAAq7aSdUnpcbdoQ9vMUcotkJyIJu1QkOqd 6pTg== 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=+cgBZHYOFH9tFUJ8RsunhtIzyqCpreyOrAvOXMHuNpY=; b=KHlCsIBfLIvwuPgyS6Km+/o7E0HScjAitXTQWmfa4C6uV86HdzgmZtZGDcCKclCMC+ 2rokh00Wzh80GslcDu/MpYx+1crFOlcuN5c4SEZ6L7BjFlI/Llq4QleRQ+IKEzwZddTP JcFntxldTzk2vj++MHX7baHe4mYhOSSd0gIs53Hahr2OsIu78rg+U/x6lFuLCFYKfnTU 8kq3NuUUNv4F3A+VQFJVpPsYqBNrOz2oHOj15JSIqJ8Xhp0RITAMGwzH1E9QPu6ivhIh rK8gV0X4/AwfxyBnda9ZPcVgpl8OQjrceK+ftt3vhEaxsyAnAAIjsdepDNMOkxIzJKt7 1lCQ== 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 m1si11092784ejb.44.2019.10.13.23.42.44; Sun, 13 Oct 2019 23:43:08 -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 S1730158AbfJNGj2 (ORCPT + 99 others); Mon, 14 Oct 2019 02:39:28 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:36879 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726406AbfJNGj1 (ORCPT ); Mon, 14 Oct 2019 02:39:27 -0400 X-UUID: 8610414fe4804ef0b75331352bbb39c0-20191014 X-UUID: 8610414fe4804ef0b75331352bbb39c0-20191014 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1251768365; Mon, 14 Oct 2019 14:39:22 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 14 Oct 2019 14:39:19 +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; Mon, 14 Oct 2019 14:39:19 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Will Deacon CC: Evan Green , Robin Murphy , Tomasz Figa , , , , , , , , Nicolas Boichat , , , , Subject: [PATCH v3 6/7] iommu/mediatek: Use writel for TLB range invalidation Date: Mon, 14 Oct 2019 14:38:20 +0800 Message-ID: <1571035101-4213-7-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1571035101-4213-1-git-send-email-yong.wu@mediatek.com> References: <1571035101-4213-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 --- 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, -- 1.9.1