From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 811F2C7618B for ; Thu, 25 Jul 2019 06:43:43 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 646BA21852 for ; Thu, 25 Jul 2019 06:43:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 646BA21852 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=verge.net.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A02241645; Thu, 25 Jul 2019 06:43:37 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 902A21649 for ; Thu, 25 Jul 2019 06:43:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kirsty.vergenet.net (kirsty.vergenet.net [202.4.237.240]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 2A837B0 for ; Thu, 25 Jul 2019 06:43:34 +0000 (UTC) Received: from penelope.horms.nl (ip4dab7138.direct-adsl.nl [77.171.113.56]) by kirsty.vergenet.net (Postfix) with ESMTPA id 0672425BE27; Thu, 25 Jul 2019 16:33:31 +1000 (AEST) Received: by penelope.horms.nl (Postfix, from userid 7100) id 0939CE2209B; Thu, 25 Jul 2019 08:33:29 +0200 (CEST) Date: Thu, 25 Jul 2019 08:33:28 +0200 From: Simon Horman To: Sergei Shtylyov Subject: Re: [PATCH v8 2/5] iommu/dma: Add a new dma_map_ops of get_merge_boundary() Message-ID: <20190725063328.ua5fu6dqig2a4rrf@verge.net.au> References: <1563859608-19456-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> <1563859608-19456-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organisation: Horms Solutions BV User-Agent: NeoMutt/20170113 (1.7.2) Cc: axboe@kernel.dk, linux-renesas-soc@vger.kernel.org, ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, hch@lst.de, linux-block@vger.kernel.org, wsa+renesas@sang-engineering.com, iommu@lists.linux-foundation.org, robin.murphy@arm.com X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org On Tue, Jul 23, 2019 at 11:17:19AM +0300, Sergei Shtylyov wrote: > Hello! > > On 23.07.2019 8:26, Yoshihiro Shimoda wrote: > > > This patch adds a new dma_map_ops of get_merge_boundary() to > > expose the DMA merge boundary if the domain type is IOMMU_DOMAIN_DMA. > > > > Signed-off-by: Yoshihiro Shimoda Sergei's comment notwithstanding, Reviewed-by: Simon Horman > > --- > > drivers/iommu/dma-iommu.c | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c > > index a7f9c3e..f3e5f2b 100644 > > --- a/drivers/iommu/dma-iommu.c > > +++ b/drivers/iommu/dma-iommu.c > > @@ -1085,6 +1085,16 @@ static int iommu_dma_get_sgtable(struct device *dev, struct sg_table *sgt, > > return ret; > > } > > +static unsigned long iommu_dma_get_merge_boundary(struct device *dev) > > +{ > > + struct iommu_domain *domain = iommu_get_dma_domain(dev); > > + > > + if (domain->type != IOMMU_DOMAIN_DMA) > > + return 0; /* can't merge */ > > + > > + return (1 << __ffs(domain->pgsize_bitmap)) - 1; > > Not 1UL? > > > +} > > + > > static const struct dma_map_ops iommu_dma_ops = { > > .alloc = iommu_dma_alloc, > > .free = iommu_dma_free, > [...] > > MBR, Sergei > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu