From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps Date: Thu, 25 Jul 2019 07:04:48 -0700 Message-ID: <20190725140448.GA25010@infradead.org> References: <20190624194908.121273-1-john.stultz@linaro.org> <20190624194908.121273-5-john.stultz@linaro.org> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <0eae0024-1fdf-bd06-a8ff-1a41f0af3c69@ti.com> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: dri-devel@lists.freedesktop.org On Thu, Jul 25, 2019 at 09:31:50AM -0400, Andrew F. Davis wrote: > But that's just it, dma-buf does not assume buffers are backed by normal > kernel managed memory, it is up to the buffer exporter where and when to > allocate the memory. The memory backed by this SRAM buffer does not have > the normal struct page backing. So moving the map, sync, etc functions > to common code would fail for this and many other heap types. This was a > major problem with Ion that prompted this new design. The code clearly shows it has page backing, e.g. this: + sg_set_page(table->sgl, pfn_to_page(PFN_DOWN(buffer->paddr)), buffer->len, 0); and the fact that it (and the dma-buf API) uses scatterlists, which requires pages.