Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp284282pxu; Fri, 11 Dec 2020 02:13:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJytJ3enPw8Wi5N70VHDVIlcH9clOLl1BFHoJMgsE8bJV/T3QIwaz6YhP61AcPHMMfrMIlDY X-Received: by 2002:a17:906:4d52:: with SMTP id b18mr9768196ejv.405.1607681628823; Fri, 11 Dec 2020 02:13:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607681628; cv=none; d=google.com; s=arc-20160816; b=H/3qKo0fFuh7VvgR2g2iqIV51Q4zL2SchX72km9QqIGA8xrR3gVVNOLQIx84ZGac/q /NoO/q5SVJlPdmXY23y8U5JE9fxM8fNIrOhVS9VaVqPA/5m9AyLnVYXTXYU3Sj9eRRpD TnHrD/lTVcLI63D0qdZ5H0kg+vRapkU0sDMRMK0nEzUwM6o5mGi8kY+N40VnL+3sYwOw ER220uxd6E/A103JBPmNk9K4UY5A0WmBkm2hm+xQnY0MEnvMZMYT1kdYx72FJtuqqiJK jGX6hpJ/aGtBK7eNzqgaUICwaAd5/DqRkMtHZuod5PHRrjZbOg1XKK4JWuIPScJ/4Jdc B5mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tQWc8Ya/SQ8yu30f2oZK/6gpauwPuWfx0xpCfyzU+rc=; b=OllU1F37j5kKa6fqhB0n6wbQQyTGhVj/3wTYzzM7AuWuFiZHw72P46h8rTkWAvOsx+ ItpmyPfo03ejvDBrTGwd4nUYkdSWxHl5dKxYyAp8nsSAuzVZzbYeeflc4Z0aBbmkDo+/ L/nsFsDNI5IVoa5jJAbTLlSFK9HCZ0lYX8gARqQmSl5xfgWcCBQ7fIiJJZF76T8dGW97 xRK9E/vzTeRDQxuKiBC41sHkNiynuTZfWfin6BHdTjn/X27N6Fkk75E6zR50794pBJSy PTPyF/85fwyKnGE4rCnvo6pw4Pj9kEzRlKLwjGBOsyzrOqgaINKNjuUl+YubsTnmHx+F V1Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x0OoNs2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id e9si4667247ejq.721.2020.12.11.02.13.24; Fri, 11 Dec 2020 02:13:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x0OoNs2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2391844AbgLJW6y (ORCPT + 99 others); Thu, 10 Dec 2020 17:58:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726995AbgLJWzN (ORCPT ); Thu, 10 Dec 2020 17:55:13 -0500 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E933C0611BB for ; Thu, 10 Dec 2020 14:40:52 -0800 (PST) Received: by mail-lj1-x244.google.com with SMTP id m13so8578446ljo.11 for ; Thu, 10 Dec 2020 14:40:52 -0800 (PST) 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=tQWc8Ya/SQ8yu30f2oZK/6gpauwPuWfx0xpCfyzU+rc=; b=x0OoNs2LTcACOemmbvVWROexONVqsHi3sxvsxjEkiZzo8yXWD3n2DmqzuWPVW+Lr4b ZJhgIZibF4dI8oEPYTgpj3vnCqYB525AAWOvKChixhX1HbwGJ8vSAaE0408WP1YA75TG S1Nhwojylv6YfsOD+wxBGPQMRLauPSsMloHkNDFklJ1y2vMtdHU/V7YoC69m6DevORi4 kF+vdp2hTOIddsuNkaW670CKMwdt6o8sgaDP56d/wvUEluoyEdEpeOxAOCz6ZjYRN2lS 7NBmhYBNu2YeZZpzS7fwTANlplEp0hZ2PXtBjnNT5YVv1HOonto2C0QmjPttLym4AgAA KM9Q== 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=tQWc8Ya/SQ8yu30f2oZK/6gpauwPuWfx0xpCfyzU+rc=; b=WViqqxRJ84Rb7UCPHIgX+BWLc8+zUh0+BATMcN1rtGCjMH/Jxh5m+s8v44fj55Iq2E MoFscVzIqTEmRRlatMY21JXnecL+x7BVwecEQcTudPuUaIcq9nH+XNVBk7o3u75yfNwO FUrnrN5fomLqmOosXbRJkjvQdZdgzqrHCuY902C2cj7GzivV2Xu8XCs7m6zd2jPvdRWZ NAkSyRK/yTKoEVV9zJ60vpkg7aGXAHef2D4wobHt9aUQwPMI2ZGavtazTKG7jRrx4kxH yQPSUZpfA7Rsgd17X3EdOWEdVZfs6dFQx/TdI4dI9usFBwfWU28LowkdgWV8wd3Uz1zI e7zQ== X-Gm-Message-State: AOAM5322jwbUj98uKk1966g2YCSk31t+DABbzdbdu0dNGS/OY+83Zm/E GPsWnPCQks1kAPDDe2vl0IEuDExeJN1AEE/qbdhhBg== X-Received: by 2002:a05:651c:10e:: with SMTP id a14mr3979348ljb.128.1607640050539; Thu, 10 Dec 2020 14:40:50 -0800 (PST) MIME-Version: 1.0 References: <20201117181935.3613581-1-minchan@kernel.org> <20201117181935.3613581-5-minchan@kernel.org> <20201119011431.GA136599@KEI> In-Reply-To: From: John Stultz Date: Thu, 10 Dec 2020 14:40:38 -0800 Message-ID: Subject: Re: [PATCH 4/4] dma-heap: Devicetree binding for chunk heap To: Minchan Kim Cc: Hyesoo Yu , Andrew Morton , LKML , linux-mm , Matthew Wilcox , david@redhat.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, Suren Baghdasaryan , KyongHo Cho , John Dias , Hridya Valsaraju , Sumit Semwal , Brian Starkey , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Herring , Christian Koenig , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Kunihiko Hayashi Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 10, 2020 at 8:06 AM Minchan Kim wrote: > On Thu, Dec 10, 2020 at 12:15:15AM -0800, John Stultz wrote: > > Well, while I agree that conceptually the dmabuf heaps allow for > > allocations for multi-device pipelines, and thus are not tied to > > specific devices. I do think that the memory types exposed are likely > > to have specific devices/drivers in the pipeline that it matters most > > to. So I don't see a big issue with the in-kernel driver registering a > > specific CMA region as a dmabuf heap. > > Then, I am worry about that we spread out dma_heap_add_cma to too many > drivers since kernel doesn't how userspace will use it. > For example, system 1 could have device A-B-C pipeline so they added > it A driver. After that, system 2 could have device B-C-D pipeline > so they add dma_heap_add_cma into B device. I'm not sure I see this as a major issue? If the drivers add it based on the dt memory reference, those will be configured to not add duplicate heaps (and even so the heap driver can also ensure we don't try to add a heap twice). > > Yea, an un-upstreamable dummy driver is maybe what it devolves to in > > the worst case. But I suspect it would be cleaner for a display or ISP > > driver that benefits most from the heap type to add the reserved > > memory reference to their DT node, and on init for them to register > > the region with the dmabuf heap code. > > As I mentioned above, it could be a display at this moment but it could > be different driver next time. If I miss your point, let me know. > I guess I just don't see potentially having the registration calls added to multiple drivers as a big problem. Ideally, yes, I'd probably rather see a DT node that would allow the heap driver to register specified regions, but that's been NACKed multiple times. Given that, having hooks in device drivers to export the region seems to me like the next best approach, as it avoids DT ABI ( if ends up its a bad approach, its not something we have to keep). The bigger problem right now is not that there are too many places the registration call would be made from, but that there aren't upstream drivers which I'm aware of where it would currently make sense to add specific dma_heap_add_cma() registration hooks to. We need an upstream user of Kunihiko Hayashi's patch. thanks -john