Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7131352ybp; Wed, 16 Oct 2019 04:21:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOtd94ZeOWhlJdYjPFTucogUl3yeFLdqHEdD2qxdze9PiCIle87nD8hCnFMndpjFpPH/d5 X-Received: by 2002:a17:906:3913:: with SMTP id f19mr39585901eje.161.1571224915574; Wed, 16 Oct 2019 04:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571224915; cv=none; d=google.com; s=arc-20160816; b=R4stynoTUHHU5M3HHxFl+gjS2vipz6dflhsVu2kwyJnE1uE3rrcdydHY7Ipf9qU5S3 K3Wt5xnAgOHuCUNNvezD6pt6gKr94HwRx25SJZ0kuYdOiInDhmioM/1SD/2xzTktiSLS BtOlhNEryVjnpSRysl+tkjM5lw6chtJqZ2D3+UImfBipJHgkssm2QmnC+EHlvpFSgZUz sRGW3qNwpxdbc6oRmpOeVhGBdc4/dt1jWyD/uu/e7eqvrsdhu4hkmO5Ui92N0mNRIDIj w1ex39UkHXAmiNrB+3vQcY7+YVZYFCCeuBFbcdJ7GMOe7gbHn8JOhLYgql1Ioijq2K0r ae+g== 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=S/rDPRsRlTxMy2rne/MIgdkDHWGSApH+mV0H6BgPyzE=; b=FlWHGwdnrQ2u1E/3PQrEOyVXu22yPLUVgC4AnY2yNPBBTr2xsDuKD1mAPtPkH7S+my Z5CWtsGU+OmQxd5dLHpFrFhBL5zad/POmj2kNgKzhH6Zf67NsdvUP23WE1CfMMVaES1C 1KWTS++IRFEpoLDJeef7HfZWQ13fAdp686An/gUt2yDnsAr77eANr9OyOpxzfm1wS0gg JhoQQvl6BJegBbHXKUna/sW9fLs09CBmbGUC7N0n6Avs7j+gdNqOpnVyVzvYGFgbunM3 rhwGBibfS63OK0hiRfLNrBR1Iqwx0Ua0TmJhCpNDj1XxAb/viW3zM3kPozYOADt04jZM bVTA== 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 d58si15781582eda.62.2019.10.16.04.21.32; Wed, 16 Oct 2019 04:21:55 -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 S2403945AbfJPDeG (ORCPT + 99 others); Tue, 15 Oct 2019 23:34:06 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:53455 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2403911AbfJPDeE (ORCPT ); Tue, 15 Oct 2019 23:34:04 -0400 X-UUID: 210265b7e8e940978e9c985f1f19396b-20191016 X-UUID: 210265b7e8e940978e9c985f1f19396b-20191016 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1890987996; Wed, 16 Oct 2019 11:33:59 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 16 Oct 2019 11:33:56 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 16 Oct 2019 11:33:55 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Will Deacon CC: Evan Green , Robin Murphy , Tomasz Figa , , , , , , , , Nicolas Boichat , , , , Subject: [PATCH v4 4/7] iommu/mediatek: Delete the leaf in the tlb_flush Date: Wed, 16 Oct 2019 11:33:09 +0800 Message-ID: <1571196792-12382-5-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1571196792-12382-1-git-send-email-yong.wu@mediatek.com> References: <1571196792-12382-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: E8A02799B48257988FAC1A4C5347391867372FABBA3D2DB71B9738816F1062AF2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In our tlb range flush, we don't care the "leaf". Remove it to simplify the code. no functional change. "granule" also is unnecessary for us, Keep it satisfy the format of tlb_flush_walk. Signed-off-by: Yong Wu Reviewed-by: Robin Murphy --- drivers/iommu/mtk_iommu.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 81ac95f..1d7254c 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -174,8 +174,7 @@ static void mtk_iommu_tlb_flush_all(void *cookie) } static void mtk_iommu_tlb_add_flush_nosync(unsigned long iova, size_t size, - size_t granule, bool leaf, - void *cookie) + size_t granule, void *cookie) { struct mtk_iommu_data *data = cookie; @@ -223,19 +222,7 @@ static void mtk_iommu_tlb_flush_walk(unsigned long iova, size_t size, unsigned long flags; spin_lock_irqsave(&data->tlb_lock, flags); - mtk_iommu_tlb_add_flush_nosync(iova, size, granule, false, cookie); - mtk_iommu_tlb_sync(cookie); - spin_unlock_irqrestore(&data->tlb_lock, flags); -} - -static void mtk_iommu_tlb_flush_leaf(unsigned long iova, size_t size, - size_t granule, void *cookie) -{ - struct mtk_iommu_data *data = cookie; - unsigned long flags; - - spin_lock_irqsave(&data->tlb_lock, flags); - mtk_iommu_tlb_add_flush_nosync(iova, size, granule, true, cookie); + mtk_iommu_tlb_add_flush_nosync(iova, size, granule, cookie); mtk_iommu_tlb_sync(cookie); spin_unlock_irqrestore(&data->tlb_lock, flags); } @@ -253,7 +240,7 @@ static void mtk_iommu_tlb_flush_page_nosync(struct iommu_iotlb_gather *gather, static const struct iommu_flush_ops mtk_iommu_flush_ops = { .tlb_flush_all = mtk_iommu_tlb_flush_all, .tlb_flush_walk = mtk_iommu_tlb_flush_walk, - .tlb_flush_leaf = mtk_iommu_tlb_flush_leaf, + .tlb_flush_leaf = mtk_iommu_tlb_flush_walk, .tlb_add_page = mtk_iommu_tlb_flush_page_nosync, }; @@ -475,7 +462,7 @@ static void mtk_iommu_iotlb_sync(struct iommu_domain *domain, spin_lock_irqsave(&data->tlb_lock, flags); mtk_iommu_tlb_add_flush_nosync(gather->start, length, gather->pgsize, - false, data); + data); mtk_iommu_tlb_sync(data); spin_unlock_irqrestore(&data->tlb_lock, flags); } -- 1.9.1