Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11157257ybi; Thu, 25 Jul 2019 11:00:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2ZesHtEDTKzM3drdGGI+WX4aEia91aPjNXQOgo4ehSMp3ynhBHUxVpdy+zeQGAIXBByVQ X-Received: by 2002:a17:902:a714:: with SMTP id w20mr92342642plq.127.1564077616280; Thu, 25 Jul 2019 11:00:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564077616; cv=none; d=google.com; s=arc-20160816; b=eLx+OoeegLS8nRnYVoLTE16Sd01uiuhiv+SXVVkHpfOJZwAXQbld9fYCbtEqOGfIIc hz/HFL+/mBC63rZx84RdOMzl9dddlHf7yqoujvuTPelKNY9S68b9wdjoyue99bfB66BH baf0ObNAM08l7awYhYaAIdQLnjV6zYhzAM3zHqoGS5auslDiw1q6smsGjJT7D/bmVELB NQHj3UcM6VnZErVSISVWaE7zN5bEN4vXqrKf2g2yu+Twz7HHvzXah5kqr2yNxQ15ETxc FOCuzpaoPLTNLtF74GeTCpDD8LL9TQtToFOr90LxFa+kxzALAoujNI6ZPylhLTisC6bk wOSA== 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:dkim-signature; bh=baZh7QxoKZtzw8ak6rup4hEOX7fMuLrzq9J4PcrZ70g=; b=ijwugClegRovejluljP8TNW9lb37ld2hlXOB/4UMDcFGkn/GDqKLV/ojf9qFM2VjYY VBNawBalmlq+N6iR1T1IXhP+mraY7Z9ZdhywWa5Izu+atmZ/47TuSPOSnU63P1ouGC8E G/1o3VQK6lmMjGVqMJGyOLeRaQla25+JgV56NmhXQjQBN5yBo2zwKZLVud6eWmgfs43T caswd1zdvAObFx5h4LfUEBqJ1BUnI4IVBy+h/rcfxjpBy4INl4LKkwzFr2XyiaG73Jn2 NzUNPtbhtaJkh5JVSaobs6GoQ6rcIMeBoQu1Wl/jHb9UKI3drYkMBINXv4YeelVeXcE9 iS2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mOvYBVlT; 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 m11si18495783pgd.261.2019.07.25.11.00.01; Thu, 25 Jul 2019 11:00: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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mOvYBVlT; 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 S2388396AbfGYOas (ORCPT + 99 others); Thu, 25 Jul 2019 10:30:48 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47152 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387891AbfGYOar (ORCPT ); Thu, 25 Jul 2019 10:30:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=baZh7QxoKZtzw8ak6rup4hEOX7fMuLrzq9J4PcrZ70g=; b=mOvYBVlTj5Ruoi40lVB+P6p8c BSMs1x4PNyBf5/bH1fPqYbbl92JXAbFFJ3JtYcPKrFFm4w/30w3ucN4eHwo+sYapNtsQ6r8heuRkP ZUbJdT8J812sepTge4Kym3DuUiPmJ7R4ozti1mmyLqyPQ3vzEFq2dCfEHCVM0qMpyMtovsDSgoJFe PUFgn+7MaKr+ltvbabYE8GJymn4TX+ge8HY5ZfLUrsM/eoZIbmqNnvMav8PBKk4HRXZk/AG04a4Jw 1MpkqxZslCmrNxHsCtYsJulc4S69QZptY0vySSBGZyjGl0t7RPott+cjAH5UKHjSn/ebCFlF7TYjg O0X4qpARw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hqelV-00077H-KE; Thu, 25 Jul 2019 14:30:43 +0000 Date: Thu, 25 Jul 2019 07:30:41 -0700 From: Christoph Hellwig To: "Andrew F. Davis" Cc: Christoph Hellwig , John Stultz , lkml , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , Xu YiPing , "Chenfeng (puck)" , butao , "Xiaqing (A)" , Yudongbin , Chenbo Feng , Alistair Strachan , dri-devel Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps Message-ID: <20190725143040.GA21894@infradead.org> References: <20190718100840.GB19666@infradead.org> <20190724065958.GC16225@infradead.org> <8e6f8e4f-20fc-1f1f-2228-f4fd7c7c5c1f@ti.com> <20190725125014.GD20286@infradead.org> <0eae0024-1fdf-bd06-a8ff-1a41f0af3c69@ti.com> <20190725140448.GA25010@infradead.org> <8e2ec315-5d18-68b2-8cb5-2bfb8a116d1b@ti.com> <20190725141144.GA14609@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 25, 2019 at 10:25:50AM -0400, Andrew F. Davis wrote: > On 7/25/19 10:11 AM, Christoph Hellwig wrote: > > On Thu, Jul 25, 2019 at 10:10:08AM -0400, Andrew F. Davis wrote: > >> Pages yes, but not "normal" pages from the kernel managed area. > >> page_to_pfn() will return bad values on the pages returned by this > >> allocator and so will any of the kernel sync/map functions. Therefor > >> those operations cannot be common and need special per-heap handling. > > > > Well, that means this thing is buggy and abuses the scatterlist API > > and we can't merge it anyway, so it is irrelevant. > > > > Since when do scatterlists need to only have kernel virtual backed > memory pages? Device memory is stored in scatterlists and > dma_sync_sg_for_* would fail just the same when the cache ops were > attempted. I'm not sure what you mean with virtual backed memory pages, as we don't really have that concept. But a page in the scatterlist needs to be able to be used everywhere we'd normally use a page, e.g. page_to_phys, page_to_pfn, kmap, page_address (if !highmem) as consumers including the dma mapping interface do all that. If you want to dma map memory that does not have page backing you need to use dma_map_resource.