Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp150643imu; Thu, 6 Dec 2018 17:39:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/WDxQdUJ78ZPjaEygeDu1jZlfgALo739JlzqK5SN/Ck/wdHTxwMgKhAX4FP3hhoEl3uVwPV X-Received: by 2002:a17:902:7005:: with SMTP id y5mr292745plk.7.1544146784159; Thu, 06 Dec 2018 17:39:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544146784; cv=none; d=google.com; s=arc-20160816; b=birWXAyhtf1IvNUtao6ybPwd6MrK09HeXsznU4T8k+2zAxpGNA2JUIPpJGM1ZS7pXf fLBs0s3q7eyNy5y8Ix1iPNlPXx/CanBom5+gNXs0EHbmFn5LaGKK0ulixzjjt1xdr5ub iOGCfbxG1bckxs5M2XdtOuoc8K8spMQ1OqhjsZ/JEoWNkH7T5GwLj+7nPJ70q4XzHpDJ xHsnPg+rUzc6GqeYRh5hWELnlj2hFFTUVGBUjyWlDTfPAUT11ZO94gZNMs4+cLoRo65u Ui22sZl4mtCThyKFBkaAcsChLU2I6DOUR3mngH2O+ZlcqVRHYtfPNHX0ljvufDqqWTtR LoAw== 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:to :from:date; bh=8pKMVrd/2Xu1qFs4dkQAeSdoGRhFObHtDdf8BgSCvoM=; b=cqzKik9nFF9aDNdCkTFreNJObqJ/wuYcRiaMFRB7k/+eX9FXvbaWVY6DyBDgaIopjb WR7p7LlPTwqOrU3O3Unaej3pfwBd/oUcGlUg/qoNXI1nUPn0ZsFuUQd1usgMMOLlopOB QjGiK/GJc0FfDrSyQqZFaDKVwcrBrmmgDVMMyFEnNSA4sa5VyIxh8ioaYdQEYVc4K/Rp TB4ELCLUtXrTON+GUN1AFZ07cTf4JLaVKVs/uka7Y18ENH8q1hAEkxS9Bf3iSaQyQtDC mZBtnOFBglaiZmInTmzqMBtYnjz8170HBVRVBA/4OwQIGTFJdVnFgLzB/zSePBnuhnQU hC0w== 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 d8si1683724pln.128.2018.12.06.17.39.26; Thu, 06 Dec 2018 17:39:44 -0800 (PST) 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 S1726008AbeLGBim (ORCPT + 99 others); Thu, 6 Dec 2018 20:38:42 -0500 Received: from verein.lst.de ([213.95.11.211]:60775 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbeLGBim (ORCPT ); Thu, 6 Dec 2018 20:38:42 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 303C168AA6; Fri, 7 Dec 2018 02:38:41 +0100 (CET) Date: Fri, 7 Dec 2018 02:38:41 +0100 From: Christoph Hellwig To: Christoph Hellwig , "Clark, Rob" , Dave Airlie , linux-arm-msm , Linux Kernel Mailing List , dri-devel , Tomasz Figa , Sean Paul , vivek.gautam@codeaurora.org, freedreno , Robin Murphy Subject: Re: [PATCH v3 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* Message-ID: <20181207013841.GA4530@lst.de> References: <20181129140315.28476-1-vivek.gautam@codeaurora.org> <20181129141429.GA22638@lst.de> <20181129155758.GC26537@lst.de> <20181129162807.GL21184@phenom.ffwll.local> <20181129165715.GA27786@lst.de> <20181129183334.GB30281@lst.de> <20181130094604.GV21184@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181130094604.GV21184@phenom.ffwll.local> 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 Fri, Nov 30, 2018 at 10:46:04AM +0100, Daniel Vetter wrote: > > Being able to dip into CMA and maybe iommu coalescing if we want to > > get fancy is indeed the only reason for this API. If we just wanted > > to map pages we could already do that now with just a little bit > > of boilerplate code (and quite a few drivers do - just adding this > > new API will remove tons of code). > > Sounds like the future is very bright indeed \o/ So, I spent some time with this and instead of a new API I think it makes sure we have DMA_ATTR_NON_CONSISTENT consistently available and with well defined semantics, that is virt_to_page on the return value works, it is contiguos and we can use dma_sync_single_for_cpu and dma_sync_single_for_device for ownership tranfers. Can you graphics folks check if this: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-noncoherent-allocator is something to work with? Especially to get rid of the horrible dma_get_sgtable hacks?