Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1769809ybg; Sat, 19 Oct 2019 02:08:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyELl+AJrh1Oi0M8lgDyD15RPSgnryBTPheyNYFyRpWJ2w1rFkumFFT1bGLyZtfIknwhm1x X-Received: by 2002:a50:8dc5:: with SMTP id s5mr14086816edh.115.1571476100627; Sat, 19 Oct 2019 02:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571476100; cv=none; d=google.com; s=arc-20160816; b=azCmnW8JhXxVAoQnfT+34lfg17kNwQ63U2rGNQWMWm2jOAATUUBZMm6m+li7UVHqcO +5Xf0QW8Ojda1KpjtbEvrTiicPFPoor2ZV16nlqduuVhV1MztyZpis+kCrAQfvcD7HG3 bwYgw7rRFr0hFd2XGF7JzcNb28PjfKXt5RgxVUFeuLh7JwcS6CxtvtFeSc868ZiR+Obw yYGmFWL18ciN8+MmV9FjIn4WO9bpK4u+P/nVNY7I1w9Gsv8TV1K3HUCCQ46A4hOdrWu+ fiPRpDeDo9oS83eJ3m08YZqwpjyPj4T+xcmW15ZSFVxzuA0xGs0PR92DPgE4DKgRBO0Z 950w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=aHwrkkqK+v7ttT3hkVnbsvrpjAbQK2fYZ6a+Ri81jgQ=; b=uNSGfIgXQzPi4IXfctAHNNWRnW00wCriNr9vlv2/RG2vsEwRoNmSjDr9J+/B9MJNVj vLCEOpYVT3mpK0W1ihB1+JNQJYu2wgCf/6zntU1Bevrrfyd+m+dEXO+2by/fq9L2bsM7 eHV6G8OL3I0ZmpXj1PiwO/P01684WtJ+Ka1fv7a0H8kNIs+AdGsIIZQ4IHgtk30aZhmW 2pwAlcu2drWrIVWJ7mqmWw+3EfqDt20zuCpW0qTI7II5qL7jHNrTEoyMG21YJGN44dCw yM8CjPxJAegdTAp9ffgUUssLxxmye3W6aTcj6ZH8kDuf1QSnNR7d2LMFIk05z8EbzSkf uwNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C87WZN4l; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si303320ejq.72.2019.10.19.02.07.57; Sat, 19 Oct 2019 02:08:20 -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=pass header.i=@linaro.org header.s=google header.b=C87WZN4l; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732028AbfJRSth (ORCPT + 99 others); Fri, 18 Oct 2019 14:49:37 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37678 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfJRSth (ORCPT ); Fri, 18 Oct 2019 14:49:37 -0400 Received: by mail-wr1-f66.google.com with SMTP id p14so7316989wro.4 for ; Fri, 18 Oct 2019 11:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aHwrkkqK+v7ttT3hkVnbsvrpjAbQK2fYZ6a+Ri81jgQ=; b=C87WZN4lrYok7x6kNxv0f0V7ppeKpanyF4cDM/PfsE+M+YjE0iuSVN+/VcRd49e7LA YE5LPYMob7fMxbLpv+EoYWVR0inRsUItRnCdIt397m1VUWWqVVjuM4LV2vX49cSP8Rxm nUTrkPsAeE8JTzCJsyWV6DVzjCCsDRC94wvzybXU4QMjBBeSSVm9lJuPPzt6o+PjrX9T AlKObj5riecOiesJDhAZOw4aUgNmajjyk/183XTLhsiNsq8rtaBDNHJV94i/IMp5FIBY yVPl40u3fOh1qcLW0geb+swIlPmpweHyjqV4geYV557h3Xhlc+u4ylm2rQACxFKbjwlx q4zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aHwrkkqK+v7ttT3hkVnbsvrpjAbQK2fYZ6a+Ri81jgQ=; b=ZBZ5TfRgFpw5RCy2G173+s22kdKS4EiSWke0KglsLoNYsp0/S3EEs41c8PU6d8x/96 +dmDJdzQTjyP7VjpAcb8pQdFLnKQNodz/ePMERcPyxAa7OT2CyRCIh0XZVimqoROQy+K QQ7jtGhv5dHAZWGh1Y05deXlOepUVWlUVrKBbz8szVyfMk6h2fyKONFwqG01By++7arW wZNps+hG3wLfmW4r0QcSQulMXWS24ShWWqe1JGPLbGxc6H/alLoQqp8B9+JwrMh5m8Ck UQ72vMRkegISteRmN+0PMhA1glcBAoi3FpWjbU5NPYHBpfBN0oc/bouOIDEzBy5FTfxO XkKg== X-Gm-Message-State: APjAAAU207f87pP59sW6t/bTdYZO2NWGNqdbbhswSQ286mYGOjP3luOV uxOvOCTCCEWa2RehbUd4fCle5LM2OwGFWcmI9YgQkQ== X-Received: by 2002:a5d:50c9:: with SMTP id f9mr8710623wrt.36.1571424573429; Fri, 18 Oct 2019 11:49:33 -0700 (PDT) MIME-Version: 1.0 References: <20190924162217.GA12974@arm.com> <20191009173742.GA2682@arm.com> <20191014090729.lwusl5zxa32a7uua@DESKTOP-E1NTVVP.localdomain> <20191018095516.inwes5avdeixl5nr@DESKTOP-E1NTVVP.localdomain> <20191018184123.GA10634@arm.com> In-Reply-To: <20191018184123.GA10634@arm.com> From: John Stultz Date: Fri, 18 Oct 2019 11:49:22 -0700 Message-ID: Subject: Re: [RESEND][PATCH v8 0/5] DMA-BUF Heaps (destaging ION) To: Ayan Halder Cc: Brian Starkey , "Andrew F. Davis" , nd , Sudipto Paul , Vincent Donnefort , Chenbo Feng , Alistair Strachan , Liam Mark , lkml , Christoph Hellwig , DRI mailing list , Hridya Valsaraju , Pratik Patel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 18, 2019 at 11:41 AM Ayan Halder wrote: > On Fri, Oct 18, 2019 at 09:55:17AM +0000, Brian Starkey wrote: > > On Thu, Oct 17, 2019 at 01:57:45PM -0700, John Stultz wrote: > > > On Thu, Oct 17, 2019 at 12:29 PM Andrew F. Davis wrote: > > > > On 10/17/19 3:14 PM, John Stultz wrote: > > > > > But if the objection stands, do you have a proposal for an alternative > > > > > way to enumerate a subset of CMA heaps? > > > > > > > > > When in staging ION had to reach into the CMA framework as the other > > > > direction would not be allowed, so cma_for_each_area() was added. If > > > > DMA-BUF heaps is not in staging then we can do the opposite, and have > > > > the CMA framework register heaps itself using our framework. That way > > > > the CMA system could decide what areas to export or not (maybe based on > > > > a DT property or similar). > > > > > > Ok. Though the CMA core doesn't have much sense of DT details either, > > > so it would probably have to be done in the reserved_mem logic, which > > > doesn't feel right to me. > > > > > > I'd probably guess we should have some sort of dt binding to describe > > > a dmabuf cma heap and from that node link to a CMA node via a > > > memory-region phandle. Along with maybe the default heap as well? Not > > > eager to get into another binding review cycle, and I'm not sure what > > > non-DT systems will do yet, but I'll take a shot at it and iterate. > > > > > > > The end result is the same so we can make this change later (it has to > > > > come after DMA-BUF heaps is in anyway). > > > > > > Well, I'm hesitant to merge code that exposes all the CMA heaps and > > > then add patches that becomes more selective, should anyone depend on > > > the initial behavior. :/ > > > > How about only auto-adding the system default CMA region (cma->name == > > "reserved")? > > > > And/or the CMA auto-add could be behind a config option? It seems a > > shame to further delay this, and the CMA heap itself really is useful. > > > A bit of a detour, comming back to the issue why the following node > was not getting detected by the dma-buf heaps framework. > > reserved-memory { > #address-cells = <2>; > #size-cells = <2>; > ranges; > > display_reserved: framebuffer@60000000 { > compatible = "shared-dma-pool"; > linux,cma-default; > reusable; <<<<<<<<<<<<-----------This was missing in our > earlier node > reg = <0 0x60000000 0 0x08000000>; > }; Right. It has to be a CMA region for us to expose it from the cma heap. > With 'reusable', rmem_cma_setup() succeeds , but the kernel crashes as follows :- > > [ 0.450562] WARNING: CPU: 2 PID: 1 at mm/cma.c:110 cma_init_reserved_areas+0xec/0x22c Is the value 0x60000000 you're using something you just guessed at? It seems like the warning here is saying the pfn calculated from the base address isn't valid. thanks -john