Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3681392yba; Tue, 23 Apr 2019 07:55:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxO3TOnCV6IcQrwdRj+XewkKuVMrUrk45dgrgJKlG7GBZFrdIwXJD2J1pGqp/BCdCMU/0Jh X-Received: by 2002:aa7:8252:: with SMTP id e18mr27239922pfn.105.1556031316344; Tue, 23 Apr 2019 07:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556031316; cv=none; d=google.com; s=arc-20160816; b=Mtx1fF9BKmPW6LdBLo01uDq8+sa+JjgruC5mKI92E9ALM13yedZsdmSw1+5Y0ZT4c0 /8WNHNyPyyiWM5Y7ln5/1RX9F6tWXECOlM8CgWTPpsk2LALK7imdn0g5MpzYrfPOAXvA oifqxfqe19v4ZnPDm/PqCyYZPuJQ1H+fPssXg5CeOQLIeCXiCqKNQWN+fs1yh0aEJv7A a9FcCsQofKb12SLrcBpWk5MfpGXJ2alBuox7Ig7z784wTZM7Vb+bw9hpKt7KC0rqTah/ 5LQlmroWo0kDzVEWLnnjU4QTghb0OQ6CKv8agoV8YD5/KKvyiDtyIycpFaaCSh4s+3W6 9OgA== 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; bh=GLLvPNoZjKkirYf9ZRD0sK8S4d2YVXpfEeWrVFXvGoA=; b=jUkZjoGhd5t0/tKL4jhxloaniRn2BQ1fSdKx56ifIdgTSMDVGhUSazLwN3wwjk7Pef f5bZt+KAc9PNHkFCQIQ0vg/eMPNgpdx9EsB21B6txwvZWbNise5T66OZox7nJIKhv5DQ wCpbnHtDmwEGKhfjUaL3MbBsdDXoInyywj4Di7XgoeJ6H0DP+HVo6+C/eNHwaWTMkajc xbvHyVvIA9d4Y++zdHzmxeWbMGB50ifKFiSz+QE2Bm10U1qhnWv9AJuRPsutiVU6C2hE fFi+8vj/NYSeUjIr6ruIMyXy2x7AqWrX2eHt3ymxGXQcth+w2XTn9283208S9hKQ6qXh 6F5g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si15908490pls.15.2019.04.23.07.55.00; Tue, 23 Apr 2019 07:55:16 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728263AbfDWOwx (ORCPT + 99 others); Tue, 23 Apr 2019 10:52:53 -0400 Received: from verein.lst.de ([213.95.11.211]:47332 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727467AbfDWOww (ORCPT ); Tue, 23 Apr 2019 10:52:52 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id C167F68AFE; Tue, 23 Apr 2019 16:52:36 +0200 (CEST) Date: Tue, 23 Apr 2019 16:52:36 +0200 From: Christoph Hellwig To: Robin Murphy Cc: Christoph Hellwig , Joerg Roedel , Catalin Marinas , Will Deacon , Tom Lendacky , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 12/21] dma-iommu: factor atomic pool allocations into helpers Message-ID: <20190423145236.GA22253@lst.de> References: <20190327080448.5500-1-hch@lst.de> <20190327080448.5500-13-hch@lst.de> <20190410061157.GA5278@lst.de> <20190417063358.GA24139@lst.de> <83615173-a8b4-e0eb-bac3-1a58d61ea4ef@arm.com> <20190418163512.GA25347@lst.de> <228ee57a-d7b2-48e0-a34e-81d5fba0a090@arm.com> <20190419082348.GA22299@lst.de> <0a6b3f53-79e5-af83-be39-f04c9acd8384@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a6b3f53-79e5-af83-be39-f04c9acd8384@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 23, 2019 at 11:01:44AM +0100, Robin Murphy wrote: > On 19/04/2019 09:23, Christoph Hellwig wrote: >> On Thu, Apr 18, 2019 at 07:15:00PM +0100, Robin Murphy wrote: >>> Still, I've worked in the vm_map_pages() stuff pending in MM and given them >>> the same treatment to finish the picture. Both x86_64_defconfig and >>> i386_defconfig do indeed compile and link fine as I expected, so I really >>> would like to understand the concern around #ifdefs better. >> >> This looks generally fine to me. One thing I'd like to do is to >> generally make use of the fact that __iommu_dma_get_pages returns NULL >> for the force contigous case as that cleans up a few things. Also >> for the !DMA_REMAP case we need to try the page allocator when >> dma_alloc_from_contiguous does not return a page. What do you thing >> of the following incremental diff? If that is fine with you I can >> fold that in and add back in the remaining patches from my series >> not obsoleted by your patches and resend. > > Wouldn't this suffice? Since we also use alloc_pages() in the coherent > atomic case, the free path should already be able to deal with it. Yepp, that is about what I've done in v3, except that I've also folded that coherent atomic case in a way very similar to dma-direct.