Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3646370pxj; Tue, 15 Jun 2021 05:43:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC/+36U7x2GAlInUqGldJbPprNFCEEim42OuZLbKkdq4H7RXkmoMD5xtF1rPkF/JfNxiv8 X-Received: by 2002:a5e:9602:: with SMTP id a2mr18681079ioq.146.1623761021888; Tue, 15 Jun 2021 05:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623761021; cv=none; d=google.com; s=arc-20160816; b=dYc/qjYvhpZ2fdjJ9ikE8Z2XJPNVE+vmtj6Ey1/BfSk686FS3A06rPGERnYydW1BxH HImgaqDDqiX5FZrOaJwKWl30KC2YgRVXgQWt6SBi6nKdL37sFOHjFxrqdk11yMJ7rF31 pPDioH2GIkuqn93nCGndNvY/odMnp9GhIXITe5SQ7RNjg0X93Tu0V6eqYw1eIEbIT7yp oUmCEfxNR3um47xI2rln5xc3eASxbHM34ug6A/9KkBKJscsxYfw084AcJ1DlbIGkMxfy QpEqs7u+Q6dzM/v5NQ5jVkb1FHb6DMatN9MxZYpcHEB/udCx11FBXLsvBvjZB8j2pY8H U/6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=PPT/VglSqab31Xc8AIUfaVurMH3Qd4VpGq/LAz8zJh8=; b=CcMa+pZvsIzJ+6Njl491DfvFLnaFxSEEfTYoYitQah+sEoJCMJhkiUsq3AazgPFt2a jDgWWHn2oDfOBE1dnVGcaz5lZlecNpGuSdd7RqwpOiC/Yfd2Z9NgszMaPo2ZQ+npi7oC chrYF/7lFKgoRtZw2SV+aawEI838fD3N3DFzUdNJ4NXGpg0vdw3PQ/Dd/JQzNISfsATp 3UuVlGGa8Kb0v1M7jlZ2XULDh45phIYyZoxEmnzKG1o+J0Ob/hc03z26kxFZ5/XuQOTv XpmZAZCGr0ktAYk1EPJEJi4rteyIvKSuhTDjSn8m4ejP4mfa9FkvdCPlkZnBOCypVInb ddLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q9si21940852ilo.56.2021.06.15.05.43.28; Tue, 15 Jun 2021 05:43:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbhFOMoE (ORCPT + 99 others); Tue, 15 Jun 2021 08:44:04 -0400 Received: from foss.arm.com ([217.140.110.172]:34450 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbhFOMoD (ORCPT ); Tue, 15 Jun 2021 08:44:03 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6EBC51063; Tue, 15 Jun 2021 05:41:59 -0700 (PDT) Received: from [10.57.9.136] (unknown [10.57.9.136]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5FDAC3F719; Tue, 15 Jun 2021 05:41:58 -0700 (PDT) Subject: Re: [PATCH v3 3/6] iommu: Improve iommu_iotlb_gather helpers To: Yong Wu , Nadav Amit Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Jiajun Cao , Will Deacon References: <20210607182541.119756-1-namit@vmware.com> <20210607182541.119756-4-namit@vmware.com> <1623760166.24285.1.camel@mhfsdcap03> From: Robin Murphy Message-ID: <5f176808-20ab-1d51-fcae-eb2307117f5b@arm.com> Date: Tue, 15 Jun 2021 13:41:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <1623760166.24285.1.camel@mhfsdcap03> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-06-15 13:29, Yong Wu wrote: > On Mon, 2021-06-07 at 11:25 -0700, Nadav Amit wrote: >> From: Robin Murphy >> >> The Mediatek driver is not the only one which might want a basic >> address-based gathering behaviour, so although it's arguably simple >> enough to open-code, let's factor it out for the sake of cleanliness. >> Let's also take this opportunity to document the intent of these >> helpers for clarity. >> >> Cc: Joerg Roedel >> Cc: Will Deacon >> Cc: Jiajun Cao >> Cc: Robin Murphy >> Cc: Lu Baolu >> Cc: iommu@lists.linux-foundation.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Robin Murphy >> >> --- >> >> Changes from Robin's version: >> * Added iommu_iotlb_gather_add_range() stub !CONFIG_IOMMU_API >> * Use iommu_iotlb_gather_add_range() in iommu_iotlb_gather_add_page() >> --- >> drivers/iommu/mtk_iommu.c | 5 +---- >> include/linux/iommu.h | 43 ++++++++++++++++++++++++++++++++++----- >> 2 files changed, 39 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c >> index e06b8a0e2b56..0af4a91ac7da 100644 >> --- a/drivers/iommu/mtk_iommu.c >> +++ b/drivers/iommu/mtk_iommu.c >> @@ -523,10 +523,7 @@ static size_t mtk_iommu_unmap(struct iommu_domain *domain, >> struct mtk_iommu_domain *dom = to_mtk_domain(domain); >> unsigned long end = iova + size - 1; > > Please also help delete this "end". Yes, that was part of my original patch - not sure what happened here :/ Robin. >> >> - if (gather->start > iova) >> - gather->start = iova; >> - if (gather->end < end) >> - gather->end = end; >> + iommu_iotlb_gather_add_range(gather, iova, size); >> return dom->iop->unmap(dom->iop, iova, size, gather); >> } > > [snip] > > > _______________________________________________ > iommu mailing list > iommu@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/iommu >